<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[164601] trunk/Source/WebKit2</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/164601">164601</a></dd>
<dt>Author</dt> <dd>simon.fraser@apple.com</dd>
<dt>Date</dt> <dd>2014-02-24 12:53:02 -0800 (Mon, 24 Feb 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>Move non-API files out of WebKit2/UIProcess/API/mac
https://bugs.webkit.org/show_bug.cgi?id=129267

Reviewed by Anders Carlsson.

* UIProcess/mac/FindIndicatorWindow.h: Renamed from Source/WebKit2/UIProcess/API/mac/FindIndicatorWindow.h.
* UIProcess/mac/FindIndicatorWindow.mm: Renamed from Source/WebKit2/UIProcess/API/mac/FindIndicatorWindow.mm.
* UIProcess/mac/PDFViewController.h: Renamed from Source/WebKit2/UIProcess/API/mac/PDFViewController.h.
* UIProcess/mac/PDFViewController.mm: Renamed from Source/WebKit2/UIProcess/API/mac/PDFViewController.mm.
* UIProcess/mac/WKPrintingView.h: Renamed from Source/WebKit2/UIProcess/API/mac/WKPrintingView.h.
* UIProcess/mac/WKPrintingView.mm: Renamed from Source/WebKit2/UIProcess/API/mac/WKPrintingView.mm.
* UIProcess/mac/WKTextInputWindowController.h: Renamed from Source/WebKit2/UIProcess/API/mac/WKTextInputWindowController.h.
* UIProcess/mac/WKTextInputWindowController.mm: Renamed from Source/WebKit2/UIProcess/API/mac/WKTextInputWindowController.mm.
* WebKit2.xcodeproj/project.pbxproj:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2WebKit2xcodeprojprojectpbxproj">trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourceWebKit2UIProcessmacFindIndicatorWindowh">trunk/Source/WebKit2/UIProcess/mac/FindIndicatorWindow.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessmacFindIndicatorWindowmm">trunk/Source/WebKit2/UIProcess/mac/FindIndicatorWindow.mm</a></li>
<li><a href="#trunkSourceWebKit2UIProcessmacPDFViewControllerh">trunk/Source/WebKit2/UIProcess/mac/PDFViewController.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessmacPDFViewControllermm">trunk/Source/WebKit2/UIProcess/mac/PDFViewController.mm</a></li>
<li><a href="#trunkSourceWebKit2UIProcessmacPageClientImplh">trunk/Source/WebKit2/UIProcess/mac/PageClientImpl.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessmacPageClientImplmm">trunk/Source/WebKit2/UIProcess/mac/PageClientImpl.mm</a></li>
<li><a href="#trunkSourceWebKit2UIProcessmacWKPrintingViewh">trunk/Source/WebKit2/UIProcess/mac/WKPrintingView.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessmacWKPrintingViewmm">trunk/Source/WebKit2/UIProcess/mac/WKPrintingView.mm</a></li>
<li><a href="#trunkSourceWebKit2UIProcessmacWKTextInputWindowControllerh">trunk/Source/WebKit2/UIProcess/mac/WKTextInputWindowController.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessmacWKTextInputWindowControllermm">trunk/Source/WebKit2/UIProcess/mac/WKTextInputWindowController.mm</a></li>
</ul>

<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkSourceWebKit2UIProcessAPImacFindIndicatorWindowh">trunk/Source/WebKit2/UIProcess/API/mac/FindIndicatorWindow.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPImacFindIndicatorWindowmm">trunk/Source/WebKit2/UIProcess/API/mac/FindIndicatorWindow.mm</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPImacPDFViewControllerh">trunk/Source/WebKit2/UIProcess/API/mac/PDFViewController.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPImacPDFViewControllermm">trunk/Source/WebKit2/UIProcess/API/mac/PDFViewController.mm</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPImacPageClientImplh">trunk/Source/WebKit2/UIProcess/API/mac/PageClientImpl.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPImacPageClientImplmm">trunk/Source/WebKit2/UIProcess/API/mac/PageClientImpl.mm</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPImacWKPrintingViewh">trunk/Source/WebKit2/UIProcess/API/mac/WKPrintingView.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPImacWKPrintingViewmm">trunk/Source/WebKit2/UIProcess/API/mac/WKPrintingView.mm</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPImacWKTextInputWindowControllerh">trunk/Source/WebKit2/UIProcess/API/mac/WKTextInputWindowController.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPImacWKTextInputWindowControllermm">trunk/Source/WebKit2/UIProcess/API/mac/WKTextInputWindowController.mm</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (164600 => 164601)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2014-02-24 20:51:05 UTC (rev 164600)
+++ trunk/Source/WebKit2/ChangeLog        2014-02-24 20:53:02 UTC (rev 164601)
</span><span class="lines">@@ -1,5 +1,22 @@
</span><span class="cx"> 2014-02-24  Simon Fraser  &lt;simon.fraser@apple.com&gt;
</span><span class="cx"> 
</span><ins>+        Move non-API files out of WebKit2/UIProcess/API/mac
+        https://bugs.webkit.org/show_bug.cgi?id=129267
+
+        Reviewed by Anders Carlsson.
+
+        * UIProcess/mac/FindIndicatorWindow.h: Renamed from Source/WebKit2/UIProcess/API/mac/FindIndicatorWindow.h.
+        * UIProcess/mac/FindIndicatorWindow.mm: Renamed from Source/WebKit2/UIProcess/API/mac/FindIndicatorWindow.mm.
+        * UIProcess/mac/PDFViewController.h: Renamed from Source/WebKit2/UIProcess/API/mac/PDFViewController.h.
+        * UIProcess/mac/PDFViewController.mm: Renamed from Source/WebKit2/UIProcess/API/mac/PDFViewController.mm.
+        * UIProcess/mac/WKPrintingView.h: Renamed from Source/WebKit2/UIProcess/API/mac/WKPrintingView.h.
+        * UIProcess/mac/WKPrintingView.mm: Renamed from Source/WebKit2/UIProcess/API/mac/WKPrintingView.mm.
+        * UIProcess/mac/WKTextInputWindowController.h: Renamed from Source/WebKit2/UIProcess/API/mac/WKTextInputWindowController.h.
+        * UIProcess/mac/WKTextInputWindowController.mm: Renamed from Source/WebKit2/UIProcess/API/mac/WKTextInputWindowController.mm.
+        * WebKit2.xcodeproj/project.pbxproj:
+
+2014-02-24  Simon Fraser  &lt;simon.fraser@apple.com&gt;
+
</ins><span class="cx">         Move non-API files in the API/ios directory out to UIProcess/ios
</span><span class="cx">         https://bugs.webkit.org/show_bug.cgi?id=129264
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPImacFindIndicatorWindowh"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebKit2/UIProcess/API/mac/FindIndicatorWindow.h (164600 => 164601)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/mac/FindIndicatorWindow.h        2014-02-24 20:51:05 UTC (rev 164600)
+++ trunk/Source/WebKit2/UIProcess/API/mac/FindIndicatorWindow.h        2014-02-24 20:53:02 UTC (rev 164601)
</span><span class="lines">@@ -1,75 +0,0 @@
</span><del>-/*
- * Copyright (C) 2010 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef FindIndicatorWindow_h
-#define FindIndicatorWindow_h
-
-#import &quot;WebKitSystemInterface.h&quot;
-#import &lt;wtf/Noncopyable.h&gt;
-#import &lt;wtf/RefPtr.h&gt;
-#import &lt;wtf/RetainPtr.h&gt;
-#import &lt;wtf/RunLoop.h&gt;
-
-@class WKFindIndicatorWindowAnimation;
-@class WKView;
-
-namespace WebKit {
-
-class FindIndicator;
-
-class FindIndicatorWindow {
-    WTF_MAKE_NONCOPYABLE(FindIndicatorWindow);
-
-public:
-    explicit FindIndicatorWindow(WKView *);
-    ~FindIndicatorWindow();
-
-    void setFindIndicator(PassRefPtr&lt;FindIndicator&gt;, bool fadeOut, bool animate);
-
-private:
-    void closeWindow();
-
-    void startFadeOutTimerFired();
-
-    void fadeOutAnimationCallback(double);
-    void fadeOutAnimationDidEnd();
-
-    void bounceAnimationCallback(double);
-    void bounceAnimationDidEnd();
-
-    WKView* m_wkView;
-    RefPtr&lt;FindIndicator&gt; m_findIndicator;
-    RetainPtr&lt;NSWindow&gt; m_findIndicatorWindow;
-
-    WKWindowBounceAnimationContextRef m_bounceAnimationContext;
-    RetainPtr&lt;WKFindIndicatorWindowAnimation&gt; m_bounceAnimation;
-
-    RunLoop::Timer&lt;FindIndicatorWindow&gt; m_startFadeOutTimer;
-    RetainPtr&lt;WKFindIndicatorWindowAnimation&gt; m_fadeOutAnimation;
-};
-
-} // namespace WebKit
-
-#endif // FindIndicatorWindow_h
</del></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPImacFindIndicatorWindowmm"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebKit2/UIProcess/API/mac/FindIndicatorWindow.mm (164600 => 164601)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/mac/FindIndicatorWindow.mm        2014-02-24 20:51:05 UTC (rev 164600)
+++ trunk/Source/WebKit2/UIProcess/API/mac/FindIndicatorWindow.mm        2014-02-24 20:53:02 UTC (rev 164601)
</span><span class="lines">@@ -1,246 +0,0 @@
</span><del>-/*
- * Copyright (C) 2010 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#import &quot;config.h&quot;
-#import &quot;FindIndicatorWindow.h&quot;
-
-#import &quot;FindIndicator.h&quot;
-#import &quot;WKView.h&quot;
-#import &lt;WebCore/GraphicsContext.h&gt;
-
-static const double bounceAnimationDuration = 0.12;
-static const double timeBeforeFadeStarts = bounceAnimationDuration + 0.2;
-static const double fadeOutAnimationDuration = 0.3;
-
-using namespace WebCore;
-
-@interface WKFindIndicatorView : NSView {
-    RefPtr&lt;WebKit::FindIndicator&gt; _findIndicator;
-}
-
-- (id)_initWithFindIndicator:(PassRefPtr&lt;WebKit::FindIndicator&gt;)findIndicator;
-@end
-
-@implementation WKFindIndicatorView
-
-- (id)_initWithFindIndicator:(PassRefPtr&lt;WebKit::FindIndicator&gt;)findIndicator
-{
-    if ((self = [super initWithFrame:NSZeroRect]))
-        _findIndicator = findIndicator;
-
-    return self;
-}
-
-- (void)drawRect:(NSRect)rect
-{
-    GraphicsContext graphicsContext(static_cast&lt;CGContextRef&gt;([[NSGraphicsContext currentContext] graphicsPort]));
-
-    _findIndicator-&gt;draw(graphicsContext, enclosingIntRect(rect));
-}
-
-- (BOOL)isFlipped
-{
-    return YES;
-}
-
-@end
-
-@interface WKFindIndicatorWindowAnimation : NSAnimation&lt;NSAnimationDelegate&gt; {
-    WebKit::FindIndicatorWindow* _findIndicatorWindow;
-    void (WebKit::FindIndicatorWindow::*_animationProgressCallback)(double progress);
-    void (WebKit::FindIndicatorWindow::*_animationDidEndCallback)();
-}
-
-- (id)_initWithFindIndicatorWindow:(WebKit::FindIndicatorWindow *)findIndicatorWindow 
-                 animationDuration:(CFTimeInterval)duration
-         animationProgressCallback:(void (WebKit::FindIndicatorWindow::*)(double progress))animationProgressCallback
-           animationDidEndCallback:(void (WebKit::FindIndicatorWindow::*)())animationDidEndCallback;
-@end
-
-@implementation WKFindIndicatorWindowAnimation
-
-- (id)_initWithFindIndicatorWindow:(WebKit::FindIndicatorWindow *)findIndicatorWindow 
-                 animationDuration:(CFTimeInterval)animationDuration
-         animationProgressCallback:(void (WebKit::FindIndicatorWindow::*)(double progress))animationProgressCallback
-           animationDidEndCallback:(void (WebKit::FindIndicatorWindow::*)())animationDidEndCallback
-{
-    if ((self = [super initWithDuration:animationDuration animationCurve:NSAnimationEaseInOut])) {
-        _findIndicatorWindow = findIndicatorWindow;
-        _animationProgressCallback = animationProgressCallback;
-        _animationDidEndCallback = animationDidEndCallback;
-        [self setDelegate:self];
-        [self setAnimationBlockingMode:NSAnimationNonblocking];
-    }
-    return self;
-}
-
-- (void)setCurrentProgress:(NSAnimationProgress)progress
-{
-    (_findIndicatorWindow-&gt;*_animationProgressCallback)(progress);
-}
-
-- (void)animationDidEnd:(NSAnimation *)animation
-{
-    ASSERT(animation == self);
-
-    (_findIndicatorWindow-&gt;*_animationDidEndCallback)();
-}
-
-@end
-
-namespace WebKit {
-
-FindIndicatorWindow::FindIndicatorWindow(WKView *wkView)
-    : m_wkView(wkView)
-    , m_bounceAnimationContext(0)
-    , m_startFadeOutTimer(RunLoop::main(), this, &amp;FindIndicatorWindow::startFadeOutTimerFired)
-{
-}
-
-FindIndicatorWindow::~FindIndicatorWindow()
-{
-    closeWindow();
-}
-
-void FindIndicatorWindow::setFindIndicator(PassRefPtr&lt;FindIndicator&gt; findIndicator, bool fadeOut, bool animate)
-{
-    if (m_findIndicator == findIndicator)
-        return;
-
-    m_findIndicator = findIndicator;
-
-    // Get rid of the old window.
-    closeWindow();
-
-    if (!m_findIndicator)
-        return;
-
-    NSRect contentRect = m_findIndicator-&gt;frameRect();
-    NSRect windowFrameRect = NSIntegralRect([m_wkView convertRect:contentRect toView:nil]);
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored &quot;-Wdeprecated-declarations&quot;
-    windowFrameRect.origin = [[m_wkView window] convertBaseToScreen:windowFrameRect.origin];
-#pragma clang diagnostic pop
-    NSRect windowContentRect = [NSWindow contentRectForFrameRect:windowFrameRect styleMask:NSBorderlessWindowMask];
-    
-    m_findIndicatorWindow = adoptNS([[NSWindow alloc] initWithContentRect:windowContentRect 
-                                                              styleMask:NSBorderlessWindowMask 
-                                                                backing:NSBackingStoreBuffered
-                                                                  defer:NO]);
-
-    [m_findIndicatorWindow setBackgroundColor:[NSColor clearColor]];
-    [m_findIndicatorWindow setOpaque:NO];
-    [m_findIndicatorWindow setIgnoresMouseEvents:YES];
-
-    RetainPtr&lt;WKFindIndicatorView&gt; findIndicatorView = adoptNS([[WKFindIndicatorView alloc] _initWithFindIndicator:m_findIndicator]);
-    [m_findIndicatorWindow setContentView:findIndicatorView.get()];
-
-    [[m_wkView window] addChildWindow:m_findIndicatorWindow.get() ordered:NSWindowAbove];
-    [m_findIndicatorWindow setReleasedWhenClosed:NO];
-
-    if (animate) {
-        // Start the bounce animation.
-        m_bounceAnimationContext = WKWindowBounceAnimationContextCreate(m_findIndicatorWindow.get());
-        m_bounceAnimation = adoptNS([[WKFindIndicatorWindowAnimation alloc] _initWithFindIndicatorWindow:this
-                                                                                    animationDuration:bounceAnimationDuration
-                                                                            animationProgressCallback:&amp;FindIndicatorWindow::bounceAnimationCallback
-                                                                              animationDidEndCallback:&amp;FindIndicatorWindow::bounceAnimationDidEnd]);
-        [m_bounceAnimation startAnimation];
-    }
-
-    if (fadeOut)
-        m_startFadeOutTimer.startOneShot(timeBeforeFadeStarts);
-}
-
-void FindIndicatorWindow::closeWindow()
-{
-    if (!m_findIndicatorWindow)
-        return;
-
-    m_startFadeOutTimer.stop();
-
-    if (m_fadeOutAnimation) {
-        [m_fadeOutAnimation stopAnimation];
-        m_fadeOutAnimation = nullptr;
-    }
-
-    if (m_bounceAnimation) {
-        [m_bounceAnimation stopAnimation];
-        m_bounceAnimation = nullptr;
-    }
-
-    if (m_bounceAnimationContext)
-        WKWindowBounceAnimationContextDestroy(m_bounceAnimationContext);
-    
-    [[m_findIndicatorWindow parentWindow] removeChildWindow:m_findIndicatorWindow.get()];
-    [m_findIndicatorWindow close];
-    m_findIndicatorWindow = nullptr;
-}
-
-void FindIndicatorWindow::startFadeOutTimerFired()
-{
-    ASSERT(!m_fadeOutAnimation);
-    
-    m_fadeOutAnimation = adoptNS([[WKFindIndicatorWindowAnimation alloc] _initWithFindIndicatorWindow:this
-                                                                                   animationDuration:fadeOutAnimationDuration
-                                                                           animationProgressCallback:&amp;FindIndicatorWindow::fadeOutAnimationCallback
-                                                                             animationDidEndCallback:&amp;FindIndicatorWindow::fadeOutAnimationDidEnd]);
-    [m_fadeOutAnimation startAnimation];
-}
-                        
-void FindIndicatorWindow::fadeOutAnimationCallback(double progress)
-{
-    ASSERT(m_fadeOutAnimation);
-
-    [m_findIndicatorWindow setAlphaValue:1.0 - progress];
-}
-
-void FindIndicatorWindow::fadeOutAnimationDidEnd()
-{
-    ASSERT(m_fadeOutAnimation);
-    ASSERT(m_findIndicatorWindow);
-
-    closeWindow();
-}
-
-void FindIndicatorWindow::bounceAnimationCallback(double progress)
-{
-    ASSERT(m_bounceAnimation);
-    ASSERT(m_bounceAnimationContext);
-
-    WKWindowBounceAnimationSetAnimationProgress(m_bounceAnimationContext, progress);
-}
-
-void FindIndicatorWindow::bounceAnimationDidEnd()
-{
-    ASSERT(m_bounceAnimation);
-    ASSERT(m_bounceAnimationContext);
-    ASSERT(m_findIndicatorWindow);
-
-    WKWindowBounceAnimationContextDestroy(m_bounceAnimationContext);
-    m_bounceAnimationContext = 0;
-}
-
-} // namespace WebKit
</del></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPImacPDFViewControllerh"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebKit2/UIProcess/API/mac/PDFViewController.h (164600 => 164601)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/mac/PDFViewController.h        2014-02-24 20:51:05 UTC (rev 164600)
+++ trunk/Source/WebKit2/UIProcess/API/mac/PDFViewController.h        2014-02-24 20:53:02 UTC (rev 164601)
</span><span class="lines">@@ -1,96 +0,0 @@
</span><del>-/*
- * Copyright (C) 2010, 2011 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef PDFViewController_h
-#define PDFViewController_h
-
-#include &quot;WebFindOptions.h&quot;
-#include &lt;wtf/Forward.h&gt;
-#include &lt;wtf/Noncopyable.h&gt;
-#include &lt;wtf/PassOwnPtr.h&gt;
-#include &lt;wtf/RetainPtr.h&gt;
-#include &lt;wtf/text/WTFString.h&gt;
-
-@class PDFView;
-@class WKView;
-@class WKPDFView;
-
-namespace IPC {
-    class DataReference;
-}
-
-namespace WebKit {
-
-class WebPageProxy;
-
-class PDFViewController {
-    WTF_MAKE_NONCOPYABLE(PDFViewController);
-
-public:
-    static PassOwnPtr&lt;PDFViewController&gt; create(WKView *);
-    ~PDFViewController();
-
-    WKView* wkView() const { return m_wkView; }
-    WebPageProxy* page() const;
-    NSView* pdfView() const;
-    
-    void setPDFDocumentData(const String&amp; mimeType, const String&amp; suggestedFilename, const IPC::DataReference&amp;);
-
-    double zoomFactor() const;
-    void setZoomFactor(double);
-
-    static Class pdfPreviewViewClass();
-
-    bool forwardScrollWheelEvent(NSEvent *);
-
-    NSPrintOperation *makePrintOperation(NSPrintInfo *);
-    void openPDFInFinder();
-    void savePDFToDownloadsFolder();
-    void linkClicked(const String&amp; url);
-    void print();
-
-    void findString(const String&amp;, FindOptions, unsigned maxMatchCount);
-    void countStringMatches(const String&amp;, FindOptions, unsigned maxMatchCount);
-
-private:
-    explicit PDFViewController(WKView *wkView);
-
-    static Class pdfDocumentClass();
-    static NSBundle* pdfKitBundle();
-
-    WKView* m_wkView;
-
-    RetainPtr&lt;WKPDFView&gt; m_wkPDFView;
-    PDFView* m_pdfView;
-
-    RetainPtr&lt;NSString&gt; m_suggestedFilename;
-    RetainPtr&lt;CFDataRef&gt; m_pdfData;
-
-    String m_temporaryPDFUUID;
-};
-
-} // namespace WebKit
-
-#endif // PDFViewController_h
</del></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPImacPDFViewControllermm"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebKit2/UIProcess/API/mac/PDFViewController.mm (164600 => 164601)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/mac/PDFViewController.mm        2014-02-24 20:51:05 UTC (rev 164600)
+++ trunk/Source/WebKit2/UIProcess/API/mac/PDFViewController.mm        2014-02-24 20:53:02 UTC (rev 164601)
</span><span class="lines">@@ -1,678 +0,0 @@
</span><del>-/*
- * Copyright (C) 2010, 2011 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#import &quot;config.h&quot;
-#import &quot;PDFViewController.h&quot;
-
-#import &quot;DataReference.h&quot;
-#import &quot;WKAPICast.h&quot;
-#import &quot;WKViewPrivate.h&quot;
-#import &quot;WebData.h&quot;
-#import &quot;WebEventFactory.h&quot;
-#import &quot;WebPageGroup.h&quot;
-#import &quot;WebPageProxy.h&quot;
-#import &quot;WebPreferences.h&quot;
-#import &lt;PDFKit/PDFKit.h&gt;
-#import &lt;WebCore/LocalizedStrings.h&gt;
-#import &lt;WebCore/UUID.h&gt;
-#import &lt;wtf/ObjcRuntimeExtras.h&gt;
-#import &lt;wtf/text/CString.h&gt;
-#import &lt;wtf/text/WTFString.h&gt;
-
-// Redeclarations of PDFKit notifications. We can't use the API since we use a weak link to the framework.
-#define _webkit_PDFViewDisplayModeChangedNotification @&quot;PDFViewDisplayModeChanged&quot;
-#define _webkit_PDFViewScaleChangedNotification @&quot;PDFViewScaleChanged&quot;
-#define _webkit_PDFViewPageChangedNotification @&quot;PDFViewChangedPage&quot;
-
-using namespace WebCore;
-using namespace WebKit;
-
-@class PDFDocument;
-@class PDFView;
-
-@interface PDFDocument (PDFDocumentDetails)
-- (NSPrintOperation *)getPrintOperationForPrintInfo:(NSPrintInfo *)printInfo autoRotate:(BOOL)doRotate;
-@end
-
-extern &quot;C&quot; NSString *_NSPathForSystemFramework(NSString *framework);
-
-// MARK: C UTILITY FUNCTIONS
-
-static void _applicationInfoForMIMEType(NSString *type, NSString **name, NSImage **image)
-{
-    ASSERT(name);
-    ASSERT(image);
-    
-    CFURLRef appURL = 0;
-
-    OSStatus error = LSCopyApplicationForMIMEType((CFStringRef)type, kLSRolesAll, &amp;appURL);
-    if (error != noErr)
-        return;
-
-    NSString *appPath = [(NSURL *)appURL path];
-    if (appURL)
-        CFRelease(appURL);
-
-    *image = [[NSWorkspace sharedWorkspace] iconForFile:appPath];
-    [*image setSize:NSMakeSize(16, 16)];
-
-    *name = [[NSFileManager defaultManager] displayNameAtPath:appPath];
-}
-
-// FIXME 4182876: We can eliminate this function in favor if -isEqual: if [PDFSelection isEqual:] is overridden
-// to compare contents.
-static BOOL _PDFSelectionsAreEqual(PDFSelection *selectionA, PDFSelection *selectionB)
-{
-    NSArray *aPages = [selectionA pages];
-    NSArray *bPages = [selectionB pages];
-
-    if (![aPages isEqual:bPages])
-        return NO;
-
-    NSUInteger count = [aPages count];
-    for (NSUInteger i = 0; i &lt; count; ++i) {
-        NSRect aBounds = [selectionA boundsForPage:[aPages objectAtIndex:i]];
-        NSRect bBounds = [selectionB boundsForPage:[bPages objectAtIndex:i]];
-        if (!NSEqualRects(aBounds, bBounds))
-            return NO;
-    }
-
-    return YES;
-}
-
-@interface WKPDFView : NSView
-{
-    PDFViewController* _pdfViewController;
-
-    RetainPtr&lt;NSView&gt; _pdfPreviewView;
-    PDFView *_pdfView;
-    BOOL _ignoreScaleAndDisplayModeAndPageNotifications;
-    BOOL _willUpdatePreferencesSoon;
-}
-
-- (id)initWithFrame:(NSRect)frame PDFViewController:(PDFViewController*)pdfViewController;
-- (void)invalidate;
-- (PDFView *)pdfView;
-- (void)setDocument:(PDFDocument *)pdfDocument;
-
-- (BOOL)forwardScrollWheelEvent:(NSEvent *)wheelEvent;
-- (void)_applyPDFPreferences;
-- (PDFSelection *)_nextMatchFor:(NSString *)string direction:(BOOL)forward caseSensitive:(BOOL)caseFlag wrap:(BOOL)wrapFlag fromSelection:(PDFSelection *)initialSelection startInSelection:(BOOL)startInSelection;
-@end
-
-@implementation WKPDFView
-
-- (id)initWithFrame:(NSRect)frame PDFViewController:(PDFViewController*)pdfViewController
-{
-    if ((self = [super initWithFrame:frame])) {
-        _pdfViewController = pdfViewController;
-
-        [self setAutoresizingMask:NSViewWidthSizable | NSViewHeightSizable];
-
-        Class previewViewClass = PDFViewController::pdfPreviewViewClass();
-        ASSERT(previewViewClass);
-
-        _pdfPreviewView = adoptNS([[previewViewClass alloc] initWithFrame:frame]);
-        [_pdfPreviewView.get() setAutoresizingMask:NSViewWidthSizable | NSViewHeightSizable];
-        [self addSubview:_pdfPreviewView.get()];
-
-        _pdfView = [_pdfPreviewView.get() performSelector:@selector(pdfView)];
-        [_pdfView setDelegate:self];
-    }
-
-    return self;
-}
-
-- (void)invalidate
-{
-    _pdfViewController = 0;
-}
-
-- (PDFView *)pdfView
-{
-    return _pdfView;
-}
-
-- (void)setDocument:(PDFDocument *)pdfDocument
-{
-    _ignoreScaleAndDisplayModeAndPageNotifications = YES;
-    [_pdfView setDocument:pdfDocument];
-    [self _applyPDFPreferences];
-    _ignoreScaleAndDisplayModeAndPageNotifications = NO;
-}
-
-- (void)_applyPDFPreferences
-{
-    if (!_pdfViewController)
-        return;
-
-    WebPreferences *preferences = _pdfViewController-&gt;page()-&gt;pageGroup()-&gt;preferences();
-
-    CGFloat scaleFactor = preferences-&gt;pdfScaleFactor();
-    if (!scaleFactor)
-        [_pdfView setAutoScales:YES];
-    else {
-        [_pdfView setAutoScales:NO];
-        [_pdfView setScaleFactor:scaleFactor];
-    }
-    [_pdfView setDisplayMode:preferences-&gt;pdfDisplayMode()];
-}
-
-- (void)_updatePreferences:(id)ignored
-{
-    _willUpdatePreferencesSoon = NO;
-
-    if (!_pdfViewController)
-        return;
-
-    WebPreferences* preferences = _pdfViewController-&gt;page()-&gt;pageGroup()-&gt;preferences();
-
-    CGFloat scaleFactor = [_pdfView autoScales] ? 0 : [_pdfView scaleFactor];
-    preferences-&gt;setPDFScaleFactor(scaleFactor);
-    preferences-&gt;setPDFDisplayMode([_pdfView displayMode]);
-}
-
-- (void)_updatePreferencesSoon
-{   
-    if (_willUpdatePreferencesSoon)
-        return;
-
-    [self performSelector:@selector(_updatePreferences:) withObject:nil afterDelay:0];
-    _willUpdatePreferencesSoon = YES;
-}
-
-- (void)_scaleOrDisplayModeOrPageChanged:(NSNotification *)notification
-{
-    ASSERT_ARG(notification, [notification object] == _pdfView);
-    if (!_ignoreScaleAndDisplayModeAndPageNotifications)
-        [self _updatePreferencesSoon];
-}
-
-- (void)_openWithFinder:(id)sender
-{
-    _pdfViewController-&gt;openPDFInFinder();
-}
-
-- (PDFSelection *)_nextMatchFor:(NSString *)string direction:(BOOL)forward caseSensitive:(BOOL)caseFlag wrap:(BOOL)wrapFlag fromSelection:(PDFSelection *)initialSelection startInSelection:(BOOL)startInSelection
-{
-    if (![string length])
-        return nil;
-
-    int options = 0;
-    if (!forward)
-        options |= NSBackwardsSearch;
-
-    if (!caseFlag)
-        options |= NSCaseInsensitiveSearch;
-
-    PDFDocument *document = [_pdfView document];
-
-    PDFSelection *selectionForInitialSearch = [initialSelection copy];
-    if (startInSelection) {
-        // Initially we want to include the selected text in the search.  So we must modify the starting search 
-        // selection to fit PDFDocument's search requirements: selection must have a length &gt;= 1, begin before 
-        // the current selection (if searching forwards) or after (if searching backwards).
-        int initialSelectionLength = [[initialSelection string] length];
-        if (forward) {
-            [selectionForInitialSearch extendSelectionAtStart:1];
-            [selectionForInitialSearch extendSelectionAtEnd:-initialSelectionLength];
-        } else {
-            [selectionForInitialSearch extendSelectionAtEnd:1];
-            [selectionForInitialSearch extendSelectionAtStart:-initialSelectionLength];
-        }
-    }
-    PDFSelection *foundSelection = [document findString:string fromSelection:selectionForInitialSearch withOptions:options];
-    [selectionForInitialSearch release];
-
-    // If we first searched in the selection, and we found the selection, search again from just past the selection
-    if (startInSelection &amp;&amp; _PDFSelectionsAreEqual(foundSelection, initialSelection))
-        foundSelection = [document findString:string fromSelection:initialSelection withOptions:options];
-
-    if (!foundSelection &amp;&amp; wrapFlag)
-        foundSelection = [document findString:string fromSelection:nil withOptions:options];
-
-    return foundSelection;
-}
-
-- (NSUInteger)_countMatches:(NSString *)string caseSensitive:(BOOL)caseFlag
-{
-    if (![string length])
-        return 0;
-
-    int options = caseFlag ? 0 : NSCaseInsensitiveSearch;
-
-    return [[[_pdfView document] findString:string withOptions:options] count];
-}
-
-// MARK: NSView overrides
-
-- (void)viewDidMoveToWindow
-{
-    if (![self window])
-        return;
-
-    NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter];
-    [notificationCenter addObserver:self selector:@selector(_scaleOrDisplayModeOrPageChanged:) name:_webkit_PDFViewScaleChangedNotification object:_pdfView];
-    [notificationCenter addObserver:self selector:@selector(_scaleOrDisplayModeOrPageChanged:) name:_webkit_PDFViewDisplayModeChangedNotification object:_pdfView];
-    [notificationCenter addObserver:self selector:@selector(_scaleOrDisplayModeOrPageChanged:) name:_webkit_PDFViewPageChangedNotification object:_pdfView];
-}
-
-- (void)viewWillMoveToWindow:(NSWindow *)newWindow
-{
-    if (![self window])
-        return;
-
-    NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter];
-    [notificationCenter removeObserver:self name:_webkit_PDFViewScaleChangedNotification object:_pdfView];
-    [notificationCenter removeObserver:self name:_webkit_PDFViewDisplayModeChangedNotification object:_pdfView];
-    [notificationCenter removeObserver:self name:_webkit_PDFViewPageChangedNotification object:_pdfView];
-}
-
-- (NSView *)hitTest:(NSPoint)point
-{
-    // Override hitTest so we can override menuForEvent.
-    NSEvent *event = [NSApp currentEvent];
-    NSEventType type = [event type];
-    if (type == NSRightMouseDown || (type == NSLeftMouseDown &amp;&amp; ([event modifierFlags] &amp; NSControlKeyMask)))
-        return self;
-
-    return [super hitTest:point];
-}
-
-static void insertOpenWithDefaultPDFMenuItem(NSMenu *menu, NSUInteger index)
-{
-    // Add in an &quot;Open with &lt;default PDF viewer&gt;&quot; item
-    NSString *appName = nil;
-    NSImage *appIcon = nil;
-    
-    _applicationInfoForMIMEType(@&quot;application/pdf&quot;, &amp;appName, &amp;appIcon);
-    if (!appName)
-        appName = WEB_UI_STRING(&quot;Finder&quot;, &quot;Default application name for Open With context menu&quot;);
-    
-    // To match the PDFKit style, we'll add Open with Preview even when there's no document yet to view, and
-    // disable it using validateUserInterfaceItem.
-    NSString *title = [NSString stringWithFormat:WEB_UI_STRING(&quot;Open with %@&quot;, &quot;context menu item for PDF&quot;), appName];
-    
-    NSMenuItem *item = [[NSMenuItem alloc] initWithTitle:title action:@selector(_openWithFinder:) keyEquivalent:@&quot;&quot;];
-    if (appIcon)
-        [item setImage:appIcon];
-    [menu insertItem:item atIndex:index];
-    [item release];
-}
-
-- (NSMenu *)menuForEvent:(NSEvent *)theEvent
-{
-    NSMenu *menu = [[NSMenu alloc] initWithTitle:@&quot;&quot;];
-
-    bool insertedOpenWithItem = false;
-    
-    NSEnumerator *menuItemEnumerator = [[[_pdfView menuForEvent:theEvent] itemArray] objectEnumerator];
-    while (NSMenuItem *item = [menuItemEnumerator nextObject]) {
-        NSMenuItem *itemCopy = [item copy];
-        [menu addItem:itemCopy];
-        [itemCopy release];
-
-        if (insertedOpenWithItem)
-            continue;
-        
-        // If a &quot;Copy&quot; item is present, place the &quot;Open With&quot; item just after it, with an intervening separator.
-        if ([item action] != @selector(copy:))
-            continue;
-        
-        [menu addItem:[NSMenuItem separatorItem]];
-        insertOpenWithDefaultPDFMenuItem(menu, [menu numberOfItems]);
-        insertedOpenWithItem = true;
-    }
-    
-    if (!insertedOpenWithItem) {
-        // No &quot;Copy&quot; item was found; place the &quot;Open With&quot; item at the top of the menu, with a trailing separator.
-        insertOpenWithDefaultPDFMenuItem(menu, 0);
-        [menu insertItem:[NSMenuItem separatorItem] atIndex:1];
-    }
-
-    return [menu autorelease];
-}
-
-// MARK: NSUserInterfaceValidations PROTOCOL IMPLEMENTATION
-
-- (BOOL)validateUserInterfaceItem:(id &lt;NSValidatedUserInterfaceItem&gt;)item
-{
-    SEL action = [item action];
-    if (action == @selector(_openWithFinder:))
-        return [_pdfView document] != nil;
-    return YES;
-}
-
-// MARK: PDFView delegate methods
-
-- (void)PDFViewWillClickOnLink:(PDFView *)sender withURL:(NSURL *)URL
-{
-    _pdfViewController-&gt;linkClicked([URL absoluteString]);
-}
-
-- (void)PDFViewOpenPDFInNativeApplication:(PDFView *)sender
-{
-    _pdfViewController-&gt;openPDFInFinder();
-}
-
-- (void)PDFViewSavePDFToDownloadFolder:(PDFView *)sender
-{
-    _pdfViewController-&gt;savePDFToDownloadsFolder();
-}
-
-- (void)PDFViewPerformPrint:(PDFView *)sender
-{
-    _pdfViewController-&gt;print();
-}
-
-- (BOOL)forwardScrollWheelEvent:(NSEvent *)wheelEvent
-{
-    return _pdfViewController-&gt;forwardScrollWheelEvent(wheelEvent);
-}
-
-@end
-
-namespace WebKit {
-
-PassOwnPtr&lt;PDFViewController&gt; PDFViewController::create(WKView *wkView)
-{
-    return adoptPtr(new PDFViewController(wkView));
-}
-
-PDFViewController::PDFViewController(WKView *wkView)
-    : m_wkView(wkView)
-    , m_wkPDFView(adoptNS([[WKPDFView alloc] initWithFrame:[m_wkView bounds] PDFViewController:this]))
-    , m_pdfView([m_wkPDFView.get() pdfView])
-{
-    [m_wkView addSubview:m_wkPDFView.get()];
-}
-
-PDFViewController::~PDFViewController()
-{
-    [m_wkPDFView.get() removeFromSuperview];
-    [m_wkPDFView.get() invalidate];
-    m_wkPDFView = nullptr;
-}
-
-WebPageProxy* PDFViewController::page() const
-{
-    return toImpl([m_wkView pageRef]);
-}
-
-NSView* PDFViewController::pdfView() const
-{ 
-    return m_wkPDFView.get(); 
-}
-    
-static RetainPtr&lt;CFDataRef&gt; convertPostScriptDataSourceToPDF(const IPC::DataReference&amp; dataReference)
-{
-    // Convert PostScript to PDF using Quartz 2D API
-    // http://developer.apple.com/documentation/GraphicsImaging/Conceptual/drawingwithquartz2d/dq_ps_convert/chapter_16_section_1.html
-    
-    CGPSConverterCallbacks callbacks = { 0, 0, 0, 0, 0, 0, 0, 0 };    
-    RetainPtr&lt;CGPSConverterRef&gt; converter = adoptCF(CGPSConverterCreate(0, &amp;callbacks, 0));
-    ASSERT(converter);
-
-    RetainPtr&lt;NSData&gt; nsData = adoptNS([[NSData alloc] initWithBytesNoCopy:const_cast&lt;uint8_t*&gt;(dataReference.data()) length:dataReference.size() freeWhenDone:NO]);   
-
-    RetainPtr&lt;CGDataProviderRef&gt; provider = adoptCF(CGDataProviderCreateWithCFData((CFDataRef)nsData.get()));
-    ASSERT(provider);
-
-    RetainPtr&lt;CFMutableDataRef&gt; result = adoptCF(CFDataCreateMutable(kCFAllocatorDefault, 0));
-    ASSERT(result);
-    
-    RetainPtr&lt;CGDataConsumerRef&gt; consumer = adoptCF(CGDataConsumerCreateWithCFData(result.get()));
-    ASSERT(consumer);
-    
-    CGPSConverterConvert(converter.get(), provider.get(), consumer.get(), 0);
-
-    if (!result)
-        return 0;
-
-    return result;
-}
-
-void PDFViewController::setPDFDocumentData(const String&amp; mimeType, const String&amp; suggestedFilename, const IPC::DataReference&amp; dataReference)
-{
-    if (equalIgnoringCase(mimeType, &quot;application/postscript&quot;)) {
-        m_pdfData = convertPostScriptDataSourceToPDF(dataReference);
-        if (!m_pdfData)
-            return;
-        m_suggestedFilename = String(suggestedFilename + &quot;.pdf&quot;);
-    } else {
-        // Make sure to copy the data.
-        m_pdfData = adoptCF(CFDataCreate(0, dataReference.data(), dataReference.size()));
-        m_suggestedFilename = suggestedFilename;
-    }
-
-    RetainPtr&lt;PDFDocument&gt; pdfDocument = adoptNS([[pdfDocumentClass() alloc] initWithData:(NSData *)m_pdfData.get()]);
-    [m_wkPDFView.get() setDocument:pdfDocument.get()];
-}
-
-double PDFViewController::zoomFactor() const
-{
-    return [m_pdfView scaleFactor];
-}
-
-void PDFViewController::setZoomFactor(double zoomFactor)
-{
-    [m_pdfView setScaleFactor:zoomFactor];
-}
-
-Class PDFViewController::pdfDocumentClass()
-{
-    static Class pdfDocumentClass = [pdfKitBundle() classNamed:@&quot;PDFDocument&quot;];
-    
-    return pdfDocumentClass;
-}
-
-Class PDFViewController::pdfPreviewViewClass()
-{
-    static Class pdfPreviewViewClass = [pdfKitBundle() classNamed:@&quot;PDFPreviewView&quot;];
-    
-    return pdfPreviewViewClass;
-}
-
-bool PDFViewController::forwardScrollWheelEvent(NSEvent *wheelEvent)
-{
-    CGFloat deltaX = [wheelEvent deltaX];
-    if ((deltaX &gt; 0 &amp;&amp; !page()-&gt;canGoBack()) || (deltaX &lt; 0 &amp;&amp; !page()-&gt;canGoForward()))
-        return false;
-
-    [m_wkView scrollWheel:wheelEvent];
-    return true;
-}
-
-static IMP oldPDFViewScrollView_scrollWheel;
-
-static WKPDFView *findEnclosingWKPDFView(NSView *view)
-{
-    for (NSView *superview = [view superview]; superview; superview = [superview superview]) {
-        if ([superview isKindOfClass:[WKPDFView class]])
-            return static_cast&lt;WKPDFView *&gt;(superview);
-    }
-
-    return nil;
-}
-
-static void PDFViewScrollView_scrollWheel(NSScrollView* self, SEL _cmd, NSEvent *wheelEvent)
-{
-    CGFloat deltaX = [wheelEvent deltaX];
-    CGFloat deltaY = [wheelEvent deltaY];
-
-    NSSize contentsSize = [[self documentView] bounds].size;
-    NSRect visibleRect = [self documentVisibleRect];
-
-    // We only want to forward the wheel events if the horizontal delta is non-zero,
-    // and only if we're pinned to either the left or right side.
-    // We also never want to forward momentum scroll events.
-    if ([wheelEvent momentumPhase] == NSEventPhaseNone &amp;&amp; deltaX &amp;&amp; fabsf(deltaY) &lt; fabsf(deltaX)
-        &amp;&amp; ((deltaX &gt; 0 &amp;&amp; visibleRect.origin.x &lt;= 0) || (deltaX &lt; 0 &amp;&amp; contentsSize.width &lt;= NSMaxX(visibleRect)))) {
-    
-        if (WKPDFView *pdfView = findEnclosingWKPDFView(self)) {
-            if ([pdfView forwardScrollWheelEvent:wheelEvent])
-                return;
-        }
-    }
-
-    wtfCallIMP&lt;void&gt;(oldPDFViewScrollView_scrollWheel, self, _cmd, wheelEvent);
-}
-
-NSBundle* PDFViewController::pdfKitBundle()
-{
-    static NSBundle *pdfKitBundle;
-    if (pdfKitBundle)
-        return pdfKitBundle;
-
-    NSString *pdfKitPath = [_NSPathForSystemFramework(@&quot;Quartz.framework&quot;) stringByAppendingString:@&quot;/Frameworks/PDFKit.framework&quot;];
-    if (!pdfKitPath) {
-        LOG_ERROR(&quot;Couldn't find PDFKit.framework&quot;);
-        return nil;
-    }
-
-    pdfKitBundle = [NSBundle bundleWithPath:pdfKitPath];
-    if (![pdfKitBundle load])
-        LOG_ERROR(&quot;Couldn't load PDFKit.framework&quot;);
-
-    if (Class pdfViewScrollViewClass = [pdfKitBundle classNamed:@&quot;PDFViewScrollView&quot;]) {
-        if (Method scrollWheel = class_getInstanceMethod(pdfViewScrollViewClass, @selector(scrollWheel:)))
-            oldPDFViewScrollView_scrollWheel = method_setImplementation(scrollWheel, reinterpret_cast&lt;IMP&gt;(PDFViewScrollView_scrollWheel));
-    }
-
-    return pdfKitBundle;
-}
-
-NSPrintOperation *PDFViewController::makePrintOperation(NSPrintInfo *printInfo)
-{
-    return [[m_pdfView document] getPrintOperationForPrintInfo:printInfo autoRotate:YES];
-}
-
-void PDFViewController::openPDFInFinder()
-{
-    // We don't want to open the PDF until we have a document to write. (see 4892525).
-    if (![m_pdfView document]) {
-        NSBeep();
-        return;
-    }
-
-    if (!m_temporaryPDFUUID) {
-        ASSERT(m_pdfData);
-        m_temporaryPDFUUID = createCanonicalUUIDString();
-        page()-&gt;savePDFToTemporaryFolderAndOpenWithNativeApplicationRaw(m_suggestedFilename.get(), page()-&gt;mainFrame()-&gt;url(), CFDataGetBytePtr(m_pdfData.get()), CFDataGetLength(m_pdfData.get()), m_temporaryPDFUUID);
-        return;
-    }
-
-    page()-&gt;openPDFFromTemporaryFolderWithNativeApplication(m_temporaryPDFUUID);
-}
-
-static void releaseCFData(unsigned char*, const void* data)
-{
-    ASSERT(CFGetTypeID(data) == CFDataGetTypeID());
-
-    // Balanced by CFRetain in savePDFToDownloadsFolder.
-    CFRelease(data);
-}
-
-void PDFViewController::savePDFToDownloadsFolder()
-{
-    // We don't want to write the file until we have a document to write. (see 5267607).
-    if (![m_pdfView document]) {
-        NSBeep();
-        return;
-    }
-
-    ASSERT(m_pdfData);
-
-    // Balanced by CFRelease in releaseCFData.
-    CFRetain(m_pdfData.get());
-
-    RefPtr&lt;WebData&gt; data = WebData::createWithoutCopying(CFDataGetBytePtr(m_pdfData.get()), CFDataGetLength(m_pdfData.get()), releaseCFData, m_pdfData.get());
-
-    page()-&gt;saveDataToFileInDownloadsFolder(m_suggestedFilename.get(), page()-&gt;mainFrame()-&gt;mimeType(), page()-&gt;mainFrame()-&gt;url(), data.get());
-}
-
-void PDFViewController::linkClicked(const String&amp; url)
-{
-    NSEvent* nsEvent = [NSApp currentEvent];
-    WebMouseEvent event;
-    switch ([nsEvent type]) {
-    case NSLeftMouseUp:
-    case NSRightMouseUp:
-    case NSOtherMouseUp:
-        event = WebEventFactory::createWebMouseEvent(nsEvent, m_pdfView);
-    default:
-        // For non mouse-clicks or for keyboard events, pass an empty WebMouseEvent
-        // through.  The event is only used by the WebFrameLoaderClient to determine
-        // the modifier keys and which mouse button is down.  These queries will be
-        // valid with an empty event.
-        break;
-    }
-    
-    page()-&gt;linkClicked(url, event);
-}
-
-void PDFViewController::print()
-{
-    page()-&gt;printMainFrame();
-}
-
-void PDFViewController::findString(const String&amp; string, FindOptions options, unsigned maxMatchCount)
-{
-    BOOL forward = !(options &amp; FindOptionsBackwards);
-    BOOL caseFlag = !(options &amp; FindOptionsCaseInsensitive);
-    BOOL wrapFlag = options &amp; FindOptionsWrapAround;
-
-    PDFSelection *selection = [m_wkPDFView.get() _nextMatchFor:string direction:forward caseSensitive:caseFlag wrap:wrapFlag fromSelection:[m_pdfView currentSelection] startInSelection:NO];
-    if (!selection) {
-        page()-&gt;didFailToFindString(string);
-        return;
-    }
-
-    NSUInteger matchCount;
-    if (!maxMatchCount) {
-        // If the max was zero, any result means we exceeded the max. We can skip computing the actual count.
-        matchCount = static_cast&lt;unsigned&gt;(kWKMoreThanMaximumMatchCount);
-    } else {
-        matchCount = [m_wkPDFView.get() _countMatches:string caseSensitive:caseFlag];
-        if (matchCount &gt; maxMatchCount)
-            matchCount = static_cast&lt;unsigned&gt;(kWKMoreThanMaximumMatchCount);
-    }
-
-    [m_pdfView setCurrentSelection:selection];
-    [m_pdfView scrollSelectionToVisible:nil];
-    page()-&gt;didFindString(string, matchCount);
-}
-
-void PDFViewController::countStringMatches(const String&amp; string, FindOptions options, unsigned maxMatchCount)
-{
-    BOOL caseFlag = !(options &amp; FindOptionsCaseInsensitive);
-
-    NSUInteger matchCount = [m_wkPDFView.get() _countMatches:string caseSensitive:caseFlag];
-    if (matchCount &gt; maxMatchCount)
-        matchCount = maxMatchCount;
-    page()-&gt;didCountStringMatches(string, matchCount);
-}
-
-} // namespace WebKit
</del></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPImacPageClientImplh"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebKit2/UIProcess/API/mac/PageClientImpl.h (164600 => 164601)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/mac/PageClientImpl.h        2014-02-24 20:51:05 UTC (rev 164600)
+++ trunk/Source/WebKit2/UIProcess/API/mac/PageClientImpl.h        2014-02-24 20:53:02 UTC (rev 164601)
</span><span class="lines">@@ -1,178 +0,0 @@
</span><del>-/*
- * Copyright (C) 2010, 2011 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef PageClientImpl_h
-#define PageClientImpl_h
-
-#include &quot;CorrectionPanel.h&quot;
-#include &quot;PageClient.h&quot;
-#include &quot;WebFullScreenManagerProxy.h&quot;
-#include &lt;wtf/RetainPtr.h&gt;
-
-@class WKEditorUndoTargetObjC;
-@class WKView;
-
-namespace WebCore {
-class AlternativeTextUIController;
-}
-
-namespace WebKit {
-class FindIndicatorWindow;
-
-class PageClientImpl final : public PageClient
-#if ENABLE(FULLSCREEN_API)
-    , public WebFullScreenManagerProxyClient
-#endif
-    {
-public:
-    explicit PageClientImpl(WKView *);
-    virtual ~PageClientImpl();
-    
-    void viewWillMoveToAnotherWindow();
-
-private:
-    // PageClient
-    virtual std::unique_ptr&lt;DrawingAreaProxy&gt; createDrawingAreaProxy();
-    virtual void setViewNeedsDisplay(const WebCore::IntRect&amp;);
-    virtual void displayView();
-    virtual bool canScrollView();
-    virtual void scrollView(const WebCore::IntRect&amp; scrollRect, const WebCore::IntSize&amp; scrollOffset);
-
-    virtual WebCore::IntSize viewSize();
-    virtual bool isViewWindowActive();
-    virtual bool isViewFocused();
-    virtual bool isViewVisible();
-    virtual bool isViewVisibleOrOccluded();
-    virtual bool isViewInWindow();
-    virtual bool isVisuallyIdle();
-    virtual LayerHostingMode viewLayerHostingMode() override;
-    virtual ColorSpaceData colorSpace() override;
-    virtual void setAcceleratedCompositingRootLayer(CALayer *) override;
-    virtual CALayer *acceleratedCompositingRootLayer() const override;
-
-    virtual void processDidExit();
-    virtual void pageClosed();
-    virtual void didRelaunchProcess();
-    virtual void preferencesDidChange() override;
-    virtual void toolTipChanged(const String&amp; oldToolTip, const String&amp; newToolTip);
-    virtual void didCommitLoadForMainFrame() override;
-    virtual void setCursor(const WebCore::Cursor&amp;);
-    virtual void setCursorHiddenUntilMouseMoves(bool);
-    virtual void didChangeViewportProperties(const WebCore::ViewportAttributes&amp;);
-
-    virtual void registerEditCommand(PassRefPtr&lt;WebEditCommandProxy&gt;, WebPageProxy::UndoOrRedo);
-    virtual void clearAllEditCommands();
-    virtual bool canUndoRedo(WebPageProxy::UndoOrRedo);
-    virtual void executeUndoRedo(WebPageProxy::UndoOrRedo);
-    virtual bool interpretKeyEvent(const NativeWebKeyboardEvent&amp;, Vector&lt;WebCore::KeypressCommand&gt;&amp;);
-    virtual bool executeSavedCommandBySelector(const String&amp; selector);
-    virtual void setDragImage(const WebCore::IntPoint&amp; clientPosition, PassRefPtr&lt;ShareableBitmap&gt; dragImage, bool isLinkDrag);
-    virtual void setPromisedData(const String&amp; pasteboardName, PassRefPtr&lt;WebCore::SharedBuffer&gt; imageBuffer, const String&amp; filename, const String&amp; extension, const String&amp; title,
-                                 const String&amp; url, const String&amp; visibleUrl, PassRefPtr&lt;WebCore::SharedBuffer&gt; archiveBuffer);
-    virtual void updateSecureInputState() override;
-    virtual void resetSecureInputState() override;
-    virtual void notifyInputContextAboutDiscardedComposition() override;
-
-    virtual WebCore::FloatRect convertToDeviceSpace(const WebCore::FloatRect&amp;);
-    virtual WebCore::FloatRect convertToUserSpace(const WebCore::FloatRect&amp;);
-    virtual WebCore::IntPoint screenToRootView(const WebCore::IntPoint&amp;);
-    virtual WebCore::IntRect rootViewToScreen(const WebCore::IntRect&amp;);
-
-    virtual void doneWithKeyEvent(const NativeWebKeyboardEvent&amp;, bool wasEventHandled);
-
-    virtual PassRefPtr&lt;WebPopupMenuProxy&gt; createPopupMenuProxy(WebPageProxy*);
-    virtual PassRefPtr&lt;WebContextMenuProxy&gt; createContextMenuProxy(WebPageProxy*);
-
-#if ENABLE(INPUT_TYPE_COLOR)
-    virtual PassRefPtr&lt;WebColorPicker&gt; createColorPicker(WebPageProxy*, const WebCore::Color&amp; initialColor, const WebCore::IntRect&amp;);
-#endif
-
-    void setFindIndicator(PassRefPtr&lt;FindIndicator&gt;, bool fadeOut, bool animate);
-
-    virtual void enterAcceleratedCompositingMode(const LayerTreeContext&amp;);
-    virtual void exitAcceleratedCompositingMode();
-    virtual void updateAcceleratedCompositingMode(const LayerTreeContext&amp;);
-
-    virtual RetainPtr&lt;CGImageRef&gt; takeViewSnapshot() override;
-    virtual void wheelEventWasNotHandledByWebCore(const NativeWebWheelEvent&amp;) override;
-    virtual void clearCustomSwipeViews() override;
-
-    virtual void accessibilityWebProcessTokenReceived(const IPC::DataReference&amp;);
-
-    virtual void pluginFocusOrWindowFocusChanged(uint64_t pluginComplexTextInputIdentifier, bool pluginHasFocusAndWindowHasFocus);
-    virtual void setPluginComplexTextInputState(uint64_t pluginComplexTextInputIdentifier, PluginComplexTextInputState);
-
-    virtual void makeFirstResponder();
-    
-    virtual void didPerformDictionaryLookup(const AttributedString&amp;, const DictionaryPopupInfo&amp;);
-    virtual void dismissDictionaryLookupPanel();
-
-    virtual void showCorrectionPanel(WebCore::AlternativeTextType, const WebCore::FloatRect&amp; boundingBoxOfReplacedString, const String&amp; replacedString, const String&amp; replacementString, const Vector&lt;String&gt;&amp; alternativeReplacementStrings);
-    virtual void dismissCorrectionPanel(WebCore::ReasonForDismissingAlternativeText);
-    virtual String dismissCorrectionPanelSoon(WebCore::ReasonForDismissingAlternativeText);
-    virtual void recordAutocorrectionResponse(WebCore::AutocorrectionResponseType, const String&amp; replacedString, const String&amp; replacementString);
-
-    virtual void recommendedScrollbarStyleDidChange(int32_t newStyle);
-
-    virtual WKView* wkView() const { return m_wkView; }
-    virtual void intrinsicContentSizeDidChange(const WebCore::IntSize&amp; intrinsicContentSize) override;
-
-#if USE(DICTATION_ALTERNATIVES)
-    virtual uint64_t addDictationAlternatives(const RetainPtr&lt;NSTextAlternatives&gt;&amp;);
-    virtual void removeDictationAlternatives(uint64_t dictationContext);
-    virtual void showDictationAlternativeUI(const WebCore::FloatRect&amp; boundingBoxOfDictatedText, uint64_t dictationContext);
-    virtual Vector&lt;String&gt; dictationAlternatives(uint64_t dictationContext);
-#endif
-
-    // Auxiliary Client Creation
-#if ENABLE(FULLSCREEN_API)
-    WebFullScreenManagerProxyClient&amp; fullScreenManagerProxyClient() override;
-#endif
-
-#if ENABLE(FULLSCREEN_API)
-    // WebFullScreenManagerProxyClient
-    virtual void closeFullScreenManager() override;
-    virtual bool isFullScreen() override;
-    virtual void enterFullScreen() override;
-    virtual void exitFullScreen() override;
-    virtual void beganEnterFullScreen(const WebCore::IntRect&amp; initialFrame, const WebCore::IntRect&amp; finalFrame) override;
-    virtual void beganExitFullScreen(const WebCore::IntRect&amp; initialFrame, const WebCore::IntRect&amp; finalFrame) override;
-#endif
-
-    NSView *activeView() const;
-
-    WKView *m_wkView;
-    RetainPtr&lt;WKEditorUndoTargetObjC&gt; m_undoTarget;
-#if USE(AUTOCORRECTION_PANEL)
-    CorrectionPanel m_correctionPanel;
-#endif
-#if USE(DICTATION_ALTERNATIVES)
-    OwnPtr&lt;WebCore::AlternativeTextUIController&gt; m_alternativeTextUIController;
-#endif
-};
-
-} // namespace WebKit
-
-#endif // PageClientImpl_h
</del></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPImacPageClientImplmm"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebKit2/UIProcess/API/mac/PageClientImpl.mm (164600 => 164601)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/mac/PageClientImpl.mm        2014-02-24 20:51:05 UTC (rev 164600)
+++ trunk/Source/WebKit2/UIProcess/API/mac/PageClientImpl.mm        2014-02-24 20:53:02 UTC (rev 164601)
</span><span class="lines">@@ -1,640 +0,0 @@
</span><del>-/*
- * Copyright (C) 2010, 2011 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#import &quot;config.h&quot;
-#import &quot;PageClientImpl.h&quot;
-
-#import &quot;AttributedString.h&quot;
-#import &quot;ColorSpaceData.h&quot;
-#import &quot;DataReference.h&quot;
-#import &quot;DictionaryPopupInfo.h&quot;
-#import &quot;FindIndicator.h&quot;
-#import &quot;NativeWebKeyboardEvent.h&quot;
-#import &quot;NativeWebWheelEvent.h&quot;
-#import &quot;StringUtilities.h&quot;
-#import &quot;WKAPICast.h&quot;
-#import &quot;WKFullScreenWindowController.h&quot;
-#import &quot;WKStringCF.h&quot;
-#import &quot;WKThumbnailView.h&quot;
-#import &quot;WKViewInternal.h&quot;
-#import &quot;WebColorPickerMac.h&quot;
-#import &quot;WebContextMenuProxyMac.h&quot;
-#import &quot;WebEditCommandProxy.h&quot;
-#import &quot;WebPopupMenuProxyMac.h&quot;
-#import &quot;WindowServerConnection.h&quot;
-#import &lt;WebCore/AlternativeTextUIController.h&gt;
-#import &lt;WebCore/BitmapImage.h&gt;
-#import &lt;WebCore/Cursor.h&gt;
-#import &lt;WebCore/FloatRect.h&gt;
-#import &lt;WebCore/GraphicsContext.h&gt;
-#import &lt;WebCore/Image.h&gt;
-#import &lt;WebCore/KeyboardEvent.h&gt;
-#import &lt;WebCore/NotImplemented.h&gt;
-#import &lt;WebCore/SharedBuffer.h&gt;
-#import &lt;WebKitSystemInterface.h&gt;
-#import &lt;wtf/text/CString.h&gt;
-#import &lt;wtf/text/WTFString.h&gt;
-
-#if USE(DICTATION_ALTERNATIVES)
-#import &lt;AppKit/NSTextAlternatives.h&gt;
-#endif
-
-@interface NSApplication (WebNSApplicationDetails)
-- (NSCursor *)_cursorRectCursor;
-@end
-
-#if HAVE(OUT_OF_PROCESS_LAYER_HOSTING)
-@interface NSWindow (WebNSWindowDetails)
-- (BOOL)_hostsLayersInWindowServer;
-@end
-#endif
-
-using namespace WebCore;
-using namespace WebKit;
-
-@interface WKEditCommandObjC : NSObject
-{
-    RefPtr&lt;WebEditCommandProxy&gt; m_command;
-}
-- (id)initWithWebEditCommandProxy:(PassRefPtr&lt;WebEditCommandProxy&gt;)command;
-- (WebEditCommandProxy*)command;
-@end
-
-@interface WKEditorUndoTargetObjC : NSObject
-- (void)undoEditing:(id)sender;
-- (void)redoEditing:(id)sender;
-@end
-
-@implementation WKEditCommandObjC
-
-- (id)initWithWebEditCommandProxy:(PassRefPtr&lt;WebEditCommandProxy&gt;)command
-{
-    self = [super init];
-    if (!self)
-        return nil;
-
-    m_command = command;
-    return self;
-}
-
-- (WebEditCommandProxy*)command
-{
-    return m_command.get();
-}
-
-@end
-
-@implementation WKEditorUndoTargetObjC
-
-- (void)undoEditing:(id)sender
-{
-    ASSERT([sender isKindOfClass:[WKEditCommandObjC class]]);
-    [sender command]-&gt;unapply();
-}
-
-- (void)redoEditing:(id)sender
-{
-    ASSERT([sender isKindOfClass:[WKEditCommandObjC class]]);
-    [sender command]-&gt;reapply();
-}
-
-@end
-
-namespace WebKit {
-
-PageClientImpl::PageClientImpl(WKView* wkView)
-    : m_wkView(wkView)
-    , m_undoTarget(adoptNS([[WKEditorUndoTargetObjC alloc] init]))
-#if USE(DICTATION_ALTERNATIVES)
-    , m_alternativeTextUIController(adoptPtr(new AlternativeTextUIController))
-#endif
-{
-}
-
-PageClientImpl::~PageClientImpl()
-{
-}
-
-std::unique_ptr&lt;DrawingAreaProxy&gt; PageClientImpl::createDrawingAreaProxy()
-{
-    return [m_wkView _createDrawingAreaProxy];
-}
-
-void PageClientImpl::setViewNeedsDisplay(const WebCore::IntRect&amp; rect)
-{
-    ASSERT_NOT_REACHED();
-}
-
-void PageClientImpl::displayView()
-{
-    ASSERT_NOT_REACHED();
-}
-
-bool PageClientImpl::canScrollView()
-{
-    return false;
-}
-
-void PageClientImpl::scrollView(const IntRect&amp; scrollRect, const IntSize&amp; scrollOffset)
-{
-    ASSERT_NOT_REACHED();
-}
-
-IntSize PageClientImpl::viewSize()
-{
-    return IntSize([m_wkView bounds].size);
-}
-
-NSView *PageClientImpl::activeView() const
-{
-#if WK_API_ENABLED
-    return m_wkView._thumbnailView ? (NSView *)m_wkView._thumbnailView : (NSView *)m_wkView;
-#else
-    return m_wkView;
-#endif
-}
-
-bool PageClientImpl::isViewWindowActive()
-{
-    NSWindow *activeViewWindow = activeView().window;
-    return activeViewWindow.isKeyWindow || [NSApp keyWindow] == activeViewWindow;
-}
-
-bool PageClientImpl::isViewFocused()
-{
-    return [m_wkView _isFocused];
-}
-
-void PageClientImpl::makeFirstResponder()
-{
-     [[m_wkView window] makeFirstResponder:m_wkView];
-}
-    
-bool PageClientImpl::isViewVisible()
-{
-    NSView *activeView = this-&gt;activeView();
-    NSWindow *activeViewWindow = activeView.window;
-
-    if (!activeViewWindow)
-        return false;
-
-    if (!activeViewWindow.isVisible)
-        return false;
-
-#if __MAC_OS_X_VERSION_MIN_REQUIRED &lt;= 1080
-    // Mountain Lion and previous do not support occlusion notifications, and as such will
-    // continue to report as &quot;visible&quot; when not on the active space.
-    if (!activeViewWindow.isOnActiveSpace)
-        return false;
-#endif
-
-    if (activeView.isHiddenOrHasHiddenAncestor)
-        return false;
-
-#if __MAC_OS_X_VERSION_MIN_REQUIRED &gt;= 1090
-    if ([m_wkView windowOcclusionDetectionEnabled] &amp;&amp; (activeViewWindow.occlusionState &amp; NSWindowOcclusionStateVisible) != NSWindowOcclusionStateVisible)
-        return false;
-#endif
-
-    return true;
-}
-
-bool PageClientImpl::isViewVisibleOrOccluded()
-{
-    return activeView().window.isVisible;
-}
-
-bool PageClientImpl::isViewInWindow()
-{
-    return activeView().window;
-}
-
-bool PageClientImpl::isVisuallyIdle()
-{
-    return WindowServerConnection::shared().applicationWindowModificationsHaveStopped() || !isViewVisible();
-}
-
-LayerHostingMode PageClientImpl::viewLayerHostingMode()
-{
-#if HAVE(OUT_OF_PROCESS_LAYER_HOSTING)
-    if ([activeView().window _hostsLayersInWindowServer])
-        return LayerHostingMode::OutOfProcess;
-#endif
-    return LayerHostingMode::InProcess;
-}
-
-void PageClientImpl::viewWillMoveToAnotherWindow()
-{
-    clearAllEditCommands();
-}
-
-ColorSpaceData PageClientImpl::colorSpace()
-{
-    return [m_wkView _colorSpace];
-}
-
-void PageClientImpl::processDidExit()
-{
-    [m_wkView _processDidExit];
-}
-
-void PageClientImpl::pageClosed()
-{
-    [m_wkView _pageClosed];
-#if USE(DICTATION_ALTERNATIVES)
-    m_alternativeTextUIController-&gt;clear();
-#endif
-}
-
-void PageClientImpl::didRelaunchProcess()
-{
-    [m_wkView _didRelaunchProcess];
-}
-
-void PageClientImpl::preferencesDidChange()
-{
-    [m_wkView _preferencesDidChange];
-}
-
-void PageClientImpl::toolTipChanged(const String&amp; oldToolTip, const String&amp; newToolTip)
-{
-    [m_wkView _toolTipChangedFrom:nsStringFromWebCoreString(oldToolTip) to:nsStringFromWebCoreString(newToolTip)];
-}
-
-void PageClientImpl::didCommitLoadForMainFrame()
-{
-}
-
-void PageClientImpl::setCursor(const WebCore::Cursor&amp; cursor)
-{
-    if (![NSApp _cursorRectCursor])
-        [m_wkView _setCursor:cursor.platformCursor()];
-}
-
-void PageClientImpl::setCursorHiddenUntilMouseMoves(bool hiddenUntilMouseMoves)
-{
-    [NSCursor setHiddenUntilMouseMoves:hiddenUntilMouseMoves];
-}
-
-void PageClientImpl::didChangeViewportProperties(const WebCore::ViewportAttributes&amp;)
-{
-}
-
-void PageClientImpl::registerEditCommand(PassRefPtr&lt;WebEditCommandProxy&gt; prpCommand, WebPageProxy::UndoOrRedo undoOrRedo)
-{
-    RefPtr&lt;WebEditCommandProxy&gt; command = prpCommand;
-
-    RetainPtr&lt;WKEditCommandObjC&gt; commandObjC = adoptNS([[WKEditCommandObjC alloc] initWithWebEditCommandProxy:command]);
-    String actionName = WebEditCommandProxy::nameForEditAction(command-&gt;editAction());
-
-    NSUndoManager *undoManager = [m_wkView undoManager];
-    [undoManager registerUndoWithTarget:m_undoTarget.get() selector:((undoOrRedo == WebPageProxy::Undo) ? @selector(undoEditing:) : @selector(redoEditing:)) object:commandObjC.get()];
-    if (!actionName.isEmpty())
-        [undoManager setActionName:(NSString *)actionName];
-}
-
-void PageClientImpl::clearAllEditCommands()
-{
-    [[m_wkView undoManager] removeAllActionsWithTarget:m_undoTarget.get()];
-}
-
-bool PageClientImpl::canUndoRedo(WebPageProxy::UndoOrRedo undoOrRedo)
-{
-    return (undoOrRedo == WebPageProxy::Undo) ? [[m_wkView undoManager] canUndo] : [[m_wkView undoManager] canRedo];
-}
-
-void PageClientImpl::executeUndoRedo(WebPageProxy::UndoOrRedo undoOrRedo)
-{
-    return (undoOrRedo == WebPageProxy::Undo) ? [[m_wkView undoManager] undo] : [[m_wkView undoManager] redo];
-}
-
-bool PageClientImpl::interpretKeyEvent(const NativeWebKeyboardEvent&amp; event, Vector&lt;WebCore::KeypressCommand&gt;&amp; commands)
-{
-    return [m_wkView _interpretKeyEvent:event.nativeEvent() savingCommandsTo:commands];
-}
-
-void PageClientImpl::setDragImage(const IntPoint&amp; clientPosition, PassRefPtr&lt;ShareableBitmap&gt; dragImage, bool isLinkDrag)
-{
-    RetainPtr&lt;CGImageRef&gt; dragCGImage = dragImage-&gt;makeCGImage();
-    RetainPtr&lt;NSImage&gt; dragNSImage = adoptNS([[NSImage alloc] initWithCGImage:dragCGImage.get() size:dragImage-&gt;size()]);
-
-    [m_wkView _setDragImage:dragNSImage.get() at:clientPosition linkDrag:isLinkDrag];
-}
-
-void PageClientImpl::setPromisedData(const String&amp; pasteboardName, PassRefPtr&lt;SharedBuffer&gt; imageBuffer, const String&amp; filename, const String&amp; extension, const String&amp; title, const String&amp; url, const String&amp; visibleUrl, PassRefPtr&lt;SharedBuffer&gt; archiveBuffer)
-{
-    RefPtr&lt;Image&gt; image = BitmapImage::create();
-    image-&gt;setData(imageBuffer.get(), true);
-    [m_wkView _setPromisedData:image.get() withFileName:filename withExtension:extension withTitle:title withURL:url withVisibleURL:visibleUrl withArchive:archiveBuffer.get() forPasteboard:pasteboardName];
-}
-
-void PageClientImpl::updateSecureInputState()
-{
-    [m_wkView _updateSecureInputState];
-}
-
-void PageClientImpl::resetSecureInputState()
-{
-    [m_wkView _resetSecureInputState];
-}
-
-void PageClientImpl::notifyInputContextAboutDiscardedComposition()
-{
-    [m_wkView _notifyInputContextAboutDiscardedComposition];
-}
-
-FloatRect PageClientImpl::convertToDeviceSpace(const FloatRect&amp; rect)
-{
-    return [m_wkView _convertToDeviceSpace:rect];
-}
-
-FloatRect PageClientImpl::convertToUserSpace(const FloatRect&amp; rect)
-{
-    return [m_wkView _convertToUserSpace:rect];
-}
-   
-IntPoint PageClientImpl::screenToRootView(const IntPoint&amp; point)
-{
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored &quot;-Wdeprecated-declarations&quot;
-    NSPoint windowCoord = [[m_wkView window] convertScreenToBase:point];
-#pragma clang diagnostic pop
-    return IntPoint([m_wkView convertPoint:windowCoord fromView:nil]);
-}
-    
-IntRect PageClientImpl::rootViewToScreen(const IntRect&amp; rect)
-{
-    NSRect tempRect = rect;
-    tempRect = [m_wkView convertRect:tempRect toView:nil];
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored &quot;-Wdeprecated-declarations&quot;
-    tempRect.origin = [[m_wkView window] convertBaseToScreen:tempRect.origin];
-#pragma clang diagnostic pop
-    return enclosingIntRect(tempRect);
-}
-
-void PageClientImpl::doneWithKeyEvent(const NativeWebKeyboardEvent&amp; event, bool eventWasHandled)
-{
-    [m_wkView _doneWithKeyEvent:event.nativeEvent() eventWasHandled:eventWasHandled];
-}
-
-PassRefPtr&lt;WebPopupMenuProxy&gt; PageClientImpl::createPopupMenuProxy(WebPageProxy* page)
-{
-    return WebPopupMenuProxyMac::create(m_wkView, page);
-}
-
-PassRefPtr&lt;WebContextMenuProxy&gt; PageClientImpl::createContextMenuProxy(WebPageProxy* page)
-{
-    return WebContextMenuProxyMac::create(m_wkView, page);
-}
-
-#if ENABLE(INPUT_TYPE_COLOR)
-PassRefPtr&lt;WebColorPicker&gt; PageClientImpl::createColorPicker(WebPageProxy* page, const WebCore::Color&amp; initialColor,  const WebCore::IntRect&amp; rect)
-{
-    return WebColorPickerMac::create(page, initialColor, rect, wkView());
-}
-#endif
-
-void PageClientImpl::setFindIndicator(PassRefPtr&lt;FindIndicator&gt; findIndicator, bool fadeOut, bool animate)
-{
-    [m_wkView _setFindIndicator:findIndicator fadeOut:fadeOut animate:animate];
-}
-
-void PageClientImpl::accessibilityWebProcessTokenReceived(const IPC::DataReference&amp; data)
-{
-    NSData* remoteToken = [NSData dataWithBytes:data.data() length:data.size()];
-    [m_wkView _setAccessibilityWebProcessToken:remoteToken];
-}
-    
-void PageClientImpl::enterAcceleratedCompositingMode(const LayerTreeContext&amp; layerTreeContext)
-{
-    ASSERT(!layerTreeContext.isEmpty());
-
-    CALayer *renderLayer = WKMakeRenderLayer(layerTreeContext.contextID);
-    [m_wkView _setAcceleratedCompositingModeRootLayer:renderLayer];
-}
-
-void PageClientImpl::exitAcceleratedCompositingMode()
-{
-    [m_wkView _setAcceleratedCompositingModeRootLayer:nil];
-}
-
-void PageClientImpl::updateAcceleratedCompositingMode(const LayerTreeContext&amp; layerTreeContext)
-{
-    ASSERT(!layerTreeContext.isEmpty());
-
-    CALayer *renderLayer = WKMakeRenderLayer(layerTreeContext.contextID);
-    [m_wkView _setAcceleratedCompositingModeRootLayer:renderLayer];
-}
-
-void PageClientImpl::setAcceleratedCompositingRootLayer(CALayer *rootLayer)
-{
-    [m_wkView _setAcceleratedCompositingModeRootLayer:rootLayer];
-}
-
-CALayer *PageClientImpl::acceleratedCompositingRootLayer() const
-{
-    return m_wkView._acceleratedCompositingModeRootLayer;
-}
-
-RetainPtr&lt;CGImageRef&gt; PageClientImpl::takeViewSnapshot()
-{
-    return [m_wkView _takeViewSnapshot];
-}
-
-void PageClientImpl::wheelEventWasNotHandledByWebCore(const NativeWebWheelEvent&amp; event)
-{
-    [m_wkView _wheelEventWasNotHandledByWebCore:event.nativeEvent()];
-}
-
-void PageClientImpl::pluginFocusOrWindowFocusChanged(uint64_t pluginComplexTextInputIdentifier, bool pluginHasFocusAndWindowHasFocus)
-{
-    [m_wkView _pluginFocusOrWindowFocusChanged:pluginHasFocusAndWindowHasFocus pluginComplexTextInputIdentifier:pluginComplexTextInputIdentifier];
-}
-
-void PageClientImpl::setPluginComplexTextInputState(uint64_t pluginComplexTextInputIdentifier, PluginComplexTextInputState pluginComplexTextInputState)
-{
-    [m_wkView _setPluginComplexTextInputState:pluginComplexTextInputState pluginComplexTextInputIdentifier:pluginComplexTextInputIdentifier];
-}
-
-void PageClientImpl::didPerformDictionaryLookup(const AttributedString&amp; text, const DictionaryPopupInfo&amp; dictionaryPopupInfo)
-{
-    RetainPtr&lt;NSAttributedString&gt; attributedString = text.string;
-    NSPoint textBaselineOrigin = dictionaryPopupInfo.origin;
-
-    // Convert to screen coordinates.
-    textBaselineOrigin = [m_wkView convertPoint:textBaselineOrigin toView:nil];
-    textBaselineOrigin = [m_wkView.window convertRectToScreen:NSMakeRect(textBaselineOrigin.x, textBaselineOrigin.y, 0, 0)].origin;
-
-    WKShowWordDefinitionWindow(attributedString.get(), textBaselineOrigin, (NSDictionary *)dictionaryPopupInfo.options.get());
-}
-
-void PageClientImpl::dismissDictionaryLookupPanel()
-{
-    // FIXME: We don't know which panel we are dismissing, it may not even be in the current page (see &lt;rdar://problem/13875766&gt;).
-    WKHideWordDefinitionWindow();
-}
-
-void PageClientImpl::showCorrectionPanel(AlternativeTextType type, const FloatRect&amp; boundingBoxOfReplacedString, const String&amp; replacedString, const String&amp; replacementString, const Vector&lt;String&gt;&amp; alternativeReplacementStrings)
-{
-#if USE(AUTOCORRECTION_PANEL)
-    if (!isViewVisible() || !isViewInWindow())
-        return;
-    m_correctionPanel.show(m_wkView, type, boundingBoxOfReplacedString, replacedString, replacementString, alternativeReplacementStrings);
-#endif
-}
-
-void PageClientImpl::dismissCorrectionPanel(ReasonForDismissingAlternativeText reason)
-{
-#if USE(AUTOCORRECTION_PANEL)
-    m_correctionPanel.dismiss(reason);
-#endif
-}
-
-String PageClientImpl::dismissCorrectionPanelSoon(WebCore::ReasonForDismissingAlternativeText reason)
-{
-#if USE(AUTOCORRECTION_PANEL)
-    return m_correctionPanel.dismiss(reason);
-#else
-    return String();
-#endif
-}
-
-void PageClientImpl::recordAutocorrectionResponse(AutocorrectionResponseType responseType, const String&amp; replacedString, const String&amp; replacementString)
-{
-    NSCorrectionResponse response = responseType == AutocorrectionReverted ? NSCorrectionResponseReverted : NSCorrectionResponseEdited;
-    CorrectionPanel::recordAutocorrectionResponse(m_wkView, response, replacedString, replacementString);
-}
-
-void PageClientImpl::recommendedScrollbarStyleDidChange(int32_t newStyle)
-{
-    NSArray *trackingAreas = [m_wkView trackingAreas];
-    NSUInteger count = [trackingAreas count];
-    ASSERT(count == 1);
-    
-    for (NSUInteger i = 0; i &lt; count; ++i)
-        [m_wkView removeTrackingArea:[trackingAreas objectAtIndex:i]];
-
-    // Now re-create a tracking area with the appropriate options given the new scrollbar style
-    NSTrackingAreaOptions options = NSTrackingMouseMoved | NSTrackingMouseEnteredAndExited | NSTrackingInVisibleRect;
-    if (newStyle == NSScrollerStyleLegacy)
-        options |= NSTrackingActiveAlways;
-    else
-        options |= NSTrackingActiveInKeyWindow;
-
-    NSTrackingArea *trackingArea = [[NSTrackingArea alloc] initWithRect:[m_wkView frame]
-                                                                options:options
-                                                                  owner:m_wkView
-                                                               userInfo:nil];
-    [m_wkView addTrackingArea:trackingArea];
-    [trackingArea release];
-}
-
-void PageClientImpl::intrinsicContentSizeDidChange(const IntSize&amp; intrinsicContentSize)
-{
-    [m_wkView _setIntrinsicContentSize:intrinsicContentSize];
-}
-
-bool PageClientImpl::executeSavedCommandBySelector(const String&amp; selectorString)
-{
-    return [m_wkView _executeSavedCommandBySelector:NSSelectorFromString(selectorString)];
-}
-
-void PageClientImpl::clearCustomSwipeViews()
-{
-    return [m_wkView _setCustomSwipeViews:@[]];
-}
-
-#if USE(DICTATION_ALTERNATIVES)
-uint64_t PageClientImpl::addDictationAlternatives(const RetainPtr&lt;NSTextAlternatives&gt;&amp; alternatives)
-{
-    return m_alternativeTextUIController-&gt;addAlternatives(alternatives);
-}
-
-void PageClientImpl::removeDictationAlternatives(uint64_t dictationContext)
-{
-    m_alternativeTextUIController-&gt;removeAlternatives(dictationContext);
-}
-
-void PageClientImpl::showDictationAlternativeUI(const WebCore::FloatRect&amp; boundingBoxOfDictatedText, uint64_t dictationContext)
-{
-    if (!isViewVisible() || !isViewInWindow())
-        return;
-    m_alternativeTextUIController-&gt;showAlternatives(m_wkView, boundingBoxOfDictatedText, dictationContext, ^(NSString* acceptedAlternative){
-        [m_wkView handleAcceptedAlternativeText:acceptedAlternative];
-    });
-}
-
-Vector&lt;String&gt; PageClientImpl::dictationAlternatives(uint64_t dictationContext)
-{
-    return m_alternativeTextUIController-&gt;alternativesForContext(dictationContext);
-}
-#endif
-
-#if ENABLE(FULLSCREEN_API)
-
-WebFullScreenManagerProxyClient&amp; PageClientImpl::fullScreenManagerProxyClient()
-{
-    return *this;
-}
-
-// WebFullScreenManagerProxyClient
-
-void PageClientImpl::closeFullScreenManager()
-{
-    [m_wkView _closeFullScreenWindowController];
-}
-
-bool PageClientImpl::isFullScreen()
-{
-    if (!m_wkView._hasFullScreenWindowController)
-        return false;
-
-    return m_wkView._fullScreenWindowController.isFullScreen;
-}
-
-void PageClientImpl::enterFullScreen()
-{
-    [m_wkView._fullScreenWindowController enterFullScreen:nil];
-}
-
-void PageClientImpl::exitFullScreen()
-{
-    [m_wkView._fullScreenWindowController exitFullScreen];
-}
-
-void PageClientImpl::beganEnterFullScreen(const IntRect&amp; initialFrame, const IntRect&amp; finalFrame)
-{
-    [m_wkView._fullScreenWindowController beganEnterFullScreenWithInitialFrame:initialFrame finalFrame:finalFrame];
-}
-
-void PageClientImpl::beganExitFullScreen(const IntRect&amp; initialFrame, const IntRect&amp; finalFrame)
-{
-    [m_wkView._fullScreenWindowController beganExitFullScreenWithInitialFrame:initialFrame finalFrame:finalFrame];
-}
-
-#endif // ENABLE(FULLSCREEN_API)
-
-} // namespace WebKit
</del></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPImacWKPrintingViewh"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebKit2/UIProcess/API/mac/WKPrintingView.h (164600 => 164601)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/mac/WKPrintingView.h        2014-02-24 20:51:05 UTC (rev 164600)
+++ trunk/Source/WebKit2/UIProcess/API/mac/WKPrintingView.h        2014-02-24 20:53:02 UTC (rev 164601)
</span><span class="lines">@@ -1,65 +0,0 @@
</span><del>-/*
- * Copyright (C) 2011 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#import &lt;WebCore/IntRectHash.h&gt;
-#import &lt;condition_variable&gt;
-#import &lt;wtf/RetainPtr.h&gt;
-
-@class WKPrintingViewData;
-@class PDFDocument;
-
-namespace WebKit {
-    class ShareableBitmap;
-    class WebFrameProxy;
-}
-
-@interface WKPrintingView : NSView {
-@public
-    NSPrintOperation *_printOperation; // WKPrintingView is owned by the operation.
-    RetainPtr&lt;NSView&gt; _wkView;
-
-    RefPtr&lt;WebKit::WebFrameProxy&gt; _webFrame;
-    Vector&lt;WebCore::IntRect&gt; _printingPageRects;
-    double _totalScaleFactorForPrinting;
-    HashMap&lt;WebCore::IntRect, RefPtr&lt;WebKit::ShareableBitmap&gt;&gt; _pagePreviews;
-
-    Vector&lt;uint8_t&gt; _printedPagesData;
-    RetainPtr&lt;PDFDocument&gt; _printedPagesPDFDocument;
-
-    uint64_t _expectedComputedPagesCallback;
-    HashMap&lt;uint64_t, WebCore::IntRect&gt; _expectedPreviewCallbacks;
-    uint64_t _latestExpectedPreviewCallback;
-    uint64_t _expectedPrintCallback;
-
-    BOOL _isPrintingFromSecondaryThread;
-    std::mutex _printingCallbackMutex;
-    std::condition_variable _printingCallbackCondition;
-
-    NSTimer *_autodisplayResumeTimer;
-}
-
-- (id)initWithFrameProxy:(WebKit::WebFrameProxy*)frame view:(NSView *)wkView;
-
-@end
</del></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPImacWKPrintingViewmm"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebKit2/UIProcess/API/mac/WKPrintingView.mm (164600 => 164601)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/mac/WKPrintingView.mm        2014-02-24 20:51:05 UTC (rev 164600)
+++ trunk/Source/WebKit2/UIProcess/API/mac/WKPrintingView.mm        2014-02-24 20:53:02 UTC (rev 164601)
</span><span class="lines">@@ -1,677 +0,0 @@
</span><del>-/*
- * Copyright (C) 2011 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#import &quot;config.h&quot;
-#import &quot;WKPrintingView.h&quot;
-
-#import &quot;APIData.h&quot;
-#import &quot;Logging.h&quot;
-#import &quot;PDFKitImports.h&quot;
-#import &quot;PrintInfo.h&quot;
-#import &quot;ShareableBitmap.h&quot;
-#import &quot;WebPageProxy.h&quot;
-#import &lt;PDFKit/PDFKit.h&gt;
-#import &lt;WebCore/GraphicsContext.h&gt;
-#import &lt;WebCore/WebCoreObjCExtras.h&gt;
-#import &lt;wtf/RunLoop.h&gt;
-
-using namespace WebKit;
-using namespace WebCore;
-
-NSString * const WebKitOriginalTopPrintingMarginKey = @&quot;WebKitOriginalTopMargin&quot;;
-NSString * const WebKitOriginalBottomPrintingMarginKey = @&quot;WebKitOriginalBottomMargin&quot;;
-
-NSString * const NSPrintInfoDidChangeNotification = @&quot;NSPrintInfoDidChange&quot;;
-
-static BOOL isForcingPreviewUpdate;
-
-@implementation WKPrintingView
-
-- (id)initWithFrameProxy:(WebKit::WebFrameProxy*)frame view:(NSView *)wkView
-{
-    self = [super init]; // No frame rect to pass to NSView.
-    if (!self)
-        return nil;
-
-    _webFrame = frame;
-    _wkView = wkView;
-
-    return self;
-}
-
-- (void)dealloc
-{
-    if (WebCoreObjCScheduleDeallocateOnMainThread([WKPrintingView class], self))
-        return;
-
-    [super dealloc];
-}
-
-- (BOOL)isFlipped
-{
-    return YES;
-}
-
-- (void)_setAutodisplay:(BOOL)newState
-{
-    if (!newState &amp;&amp; [[_wkView window] isAutodisplay])
-        [_wkView displayIfNeeded];
-    
-    [[_wkView window] setAutodisplay:newState];
-
-    // For some reason, painting doesn't happen for a long time without this call, &lt;rdar://problem/8975229&gt;.
-    if (newState)
-        [_wkView displayIfNeeded];
-}
-
-
-- (void)_suspendAutodisplay
-{
-    // A drawRect: call on WKView causes a switch to screen mode, which is slow due to relayout, and we want to avoid that.
-    // Disabling autodisplay will prevent random updates from causing this, but resizing the window will still work.
-    if (_autodisplayResumeTimer) {
-        [_autodisplayResumeTimer invalidate];
-        _autodisplayResumeTimer = nil;
-    } else
-        [self _setAutodisplay:NO];
-}
-
-- (void)_delayedResumeAutodisplayTimerFired
-{
-    ASSERT(RunLoop::isMain());
-    
-    _autodisplayResumeTimer = nil;
-    [self _setAutodisplay:YES];
-
-    // Enabling autodisplay normally implicitly calls endPrinting() via -[WKView drawRect:], but not when content is in accelerated compositing mode.
-    if (_webFrame-&gt;page())
-        _webFrame-&gt;page()-&gt;endPrinting();
-}
-
-- (void)_delayedResumeAutodisplay
-{
-    // AppKit calls endDocument/beginDocument when print option change. We don't want to switch between print and screen mode just for that,
-    // and enabling autodisplay may result in switching into screen mode. So, autodisplay is only resumed on next run loop iteration.
-    if (!_autodisplayResumeTimer) {
-        _autodisplayResumeTimer = [NSTimer timerWithTimeInterval:0 target:self selector:@selector(_delayedResumeAutodisplayTimerFired) userInfo:nil repeats:NO];
-        // The timer must be scheduled on main thread, because printing thread may finish before it fires.
-        [[NSRunLoop mainRunLoop] addTimer:_autodisplayResumeTimer forMode:NSDefaultRunLoopMode];
-    }
-}
-
-- (void)_adjustPrintingMarginsForHeaderAndFooter
-{
-    ASSERT(RunLoop::isMain()); // This function calls the client, which should only be done on main thread.
-
-    NSPrintInfo *info = [_printOperation printInfo];
-    NSMutableDictionary *infoDictionary = [info dictionary];
-
-    // We need to modify the top and bottom margins in the NSPrintInfo to account for the space needed by the
-    // header and footer. Because this method can be called more than once on the same NSPrintInfo (see 5038087),
-    // we stash away the unmodified top and bottom margins the first time this method is called, and we read from
-    // those stashed-away values on subsequent calls.
-    double originalTopMargin;
-    double originalBottomMargin;
-    NSNumber *originalTopMarginNumber = [infoDictionary objectForKey:WebKitOriginalTopPrintingMarginKey];
-    if (!originalTopMarginNumber) {
-        ASSERT(![infoDictionary objectForKey:WebKitOriginalBottomPrintingMarginKey]);
-        originalTopMargin = [info topMargin];
-        originalBottomMargin = [info bottomMargin];
-        [infoDictionary setObject:[NSNumber numberWithDouble:originalTopMargin] forKey:WebKitOriginalTopPrintingMarginKey];
-        [infoDictionary setObject:[NSNumber numberWithDouble:originalBottomMargin] forKey:WebKitOriginalBottomPrintingMarginKey];
-    } else {
-        ASSERT([originalTopMarginNumber isKindOfClass:[NSNumber class]]);
-        ASSERT([[infoDictionary objectForKey:WebKitOriginalBottomPrintingMarginKey] isKindOfClass:[NSNumber class]]);
-        originalTopMargin = [originalTopMarginNumber doubleValue];
-        originalBottomMargin = [[infoDictionary objectForKey:WebKitOriginalBottomPrintingMarginKey] doubleValue];
-    }
-    
-    CGFloat scale = [info scalingFactor];
-    [info setTopMargin:originalTopMargin + _webFrame-&gt;page()-&gt;headerHeight(_webFrame.get()) * scale];
-    [info setBottomMargin:originalBottomMargin + _webFrame-&gt;page()-&gt;footerHeight(_webFrame.get()) * scale];
-}
-
-- (BOOL)_isPrintingPreview
-{
-    // &lt;rdar://problem/8901041&gt; Please add an API returning whether the current print operation is for preview.
-    // Assuming that if NSPrintOperation is allowed to spawn a thread for printing, it will. Print preview doesn't spawn a thread.
-    return !_isPrintingFromSecondaryThread;
-}
-
-- (void)_updatePreview
-{
-    // &lt;rdar://problem/8900923&gt; Please add an API to force print preview update.
-    ASSERT(!isForcingPreviewUpdate);
-    isForcingPreviewUpdate = YES;
-    [[NSNotificationCenter defaultCenter] postNotificationName:NSPrintInfoDidChangeNotification object:nil];
-    isForcingPreviewUpdate = NO;
-}
-
-- (BOOL)_hasPageRects
-{
-    // WebCore always prints at least one page.
-    return !_printingPageRects.isEmpty();
-}
-
-- (NSUInteger)_firstPrintedPageNumber
-{
-    // Need to directly access the dictionary because -[NSPrintOperation pageRange] verifies pagination, potentially causing recursion.
-    return [[[[_printOperation printInfo] dictionary] objectForKey:NSPrintFirstPage] unsignedIntegerValue];
-}
-
-- (NSUInteger)_lastPrintedPageNumber
-{
-    ASSERT([self _hasPageRects]);
-
-    // Need to directly access the dictionary because -[NSPrintOperation pageRange] verifies pagination, potentially causing recursion.
-    NSUInteger firstPage = [[[[_printOperation printInfo] dictionary] objectForKey:NSPrintFirstPage] unsignedIntegerValue];
-    NSUInteger lastPage = [[[[_printOperation printInfo] dictionary] objectForKey:NSPrintLastPage] unsignedIntegerValue];
-    if (lastPage - firstPage &gt;= _printingPageRects.size())
-        return _printingPageRects.size();
-    return lastPage;
-}
-
-- (uint64_t)_expectedPreviewCallbackForRect:(const IntRect&amp;)rect
-{
-    for (HashMap&lt;uint64_t, WebCore::IntRect&gt;::iterator iter = _expectedPreviewCallbacks.begin(); iter != _expectedPreviewCallbacks.end(); ++iter) {
-        if (iter-&gt;value  == rect)
-            return iter-&gt;key;
-    }
-    return 0;
-}
-
-struct IPCCallbackContext {
-    RetainPtr&lt;WKPrintingView&gt; view;
-    uint64_t callbackID;
-};
-
-static void pageDidDrawToImage(const ShareableBitmap::Handle&amp; imageHandle, IPCCallbackContext* context)
-{
-    ASSERT(RunLoop::isMain());
-
-    WKPrintingView *view = context-&gt;view.get();
-
-    // If the user has already changed print setup, then this response is obsolete. And if this callback is not in response to the latest request,
-    // then the user has already moved to another page - we'll cache the response, but won't draw it.
-    HashMap&lt;uint64_t, WebCore::IntRect&gt;::iterator iter = view-&gt;_expectedPreviewCallbacks.find(context-&gt;callbackID);
-    if (iter != view-&gt;_expectedPreviewCallbacks.end()) {
-        ASSERT([view _isPrintingPreview]);
-
-        if (!imageHandle.isNull()) {
-            RefPtr&lt;ShareableBitmap&gt; image = ShareableBitmap::create(imageHandle, SharedMemory::ReadOnly);
-
-            if (image)
-                view-&gt;_pagePreviews.add(iter-&gt;value, image);
-        }
-
-        view-&gt;_expectedPreviewCallbacks.remove(context-&gt;callbackID);
-        bool receivedResponseToLatestRequest = view-&gt;_latestExpectedPreviewCallback == context-&gt;callbackID;
-        if (receivedResponseToLatestRequest) {
-            view-&gt;_latestExpectedPreviewCallback = 0;
-            [view _updatePreview];
-        }
-    }
-}
-
-- (void)_preparePDFDataForPrintingOnSecondaryThread
-{
-    ASSERT(RunLoop::isMain());
-
-    if (!_webFrame-&gt;page()) {
-        _printingCallbackCondition.notify_one();
-        return;
-    }
-
-    std::lock_guard&lt;std::mutex&gt; lock(_printingCallbackMutex);
-
-    ASSERT([self _hasPageRects]);
-    ASSERT(_printedPagesData.isEmpty());
-    ASSERT(!_printedPagesPDFDocument);
-    ASSERT(!_expectedPrintCallback);
-
-    NSUInteger firstPage = [self _firstPrintedPageNumber];
-    NSUInteger lastPage = [self _lastPrintedPageNumber];
-
-    ASSERT(firstPage &gt; 0);
-    ASSERT(firstPage &lt;= lastPage);
-    LOG(View, &quot;WKPrintingView requesting PDF data for pages %u...%u&quot;, firstPage, lastPage);
-
-    PrintInfo printInfo([_printOperation printInfo]);
-    // Return to printing mode if we're already back to screen (e.g. due to window resizing).
-    _webFrame-&gt;page()-&gt;beginPrinting(_webFrame.get(), printInfo);
-
-    IPCCallbackContext* context = new IPCCallbackContext;
-    RefPtr&lt;DataCallback&gt; callback = DataCallback::create([context](bool, API::Data* data) {
-        ASSERT(RunLoop::isMain());
-
-        OwnPtr&lt;IPCCallbackContext&gt; contextDeleter = adoptPtr(context);
-        WKPrintingView *view = context-&gt;view.get();
-
-        if (context-&gt;callbackID == view-&gt;_expectedPrintCallback) {
-            ASSERT(![view _isPrintingPreview]);
-            ASSERT(view-&gt;_printedPagesData.isEmpty());
-            ASSERT(!view-&gt;_printedPagesPDFDocument);
-            if (data)
-                view-&gt;_printedPagesData.append(data-&gt;bytes(), data-&gt;size());
-            view-&gt;_expectedPrintCallback = 0;
-            view-&gt;_printingCallbackCondition.notify_one();
-        }
-    });
-    _expectedPrintCallback = callback-&gt;callbackID();
-
-    context-&gt;view = self;
-    context-&gt;callbackID = callback-&gt;callbackID();
-
-    _webFrame-&gt;page()-&gt;drawPagesToPDF(_webFrame.get(), printInfo, firstPage - 1, lastPage - firstPage + 1, callback.get());
-}
-
-static void pageDidComputePageRects(const Vector&lt;WebCore::IntRect&gt;&amp; pageRects, double totalScaleFactorForPrinting, IPCCallbackContext* context)
-{
-    ASSERT(RunLoop::isMain());
-
-    WKPrintingView *view = context-&gt;view.get();
-
-    // If the user has already changed print setup, then this response is obsolete.
-    if (context-&gt;callbackID == view-&gt;_expectedComputedPagesCallback) {
-        ASSERT(RunLoop::isMain());
-        ASSERT(view-&gt;_expectedPreviewCallbacks.isEmpty());
-        ASSERT(!view-&gt;_latestExpectedPreviewCallback);
-        ASSERT(!view-&gt;_expectedPrintCallback);
-        ASSERT(view-&gt;_pagePreviews.isEmpty());
-        view-&gt;_expectedComputedPagesCallback = 0;
-
-        view-&gt;_printingPageRects = pageRects;
-        view-&gt;_totalScaleFactorForPrinting = totalScaleFactorForPrinting;
-
-        // Sanitize a response coming from the Web process.
-        if (view-&gt;_printingPageRects.isEmpty())
-            view-&gt;_printingPageRects.append(IntRect(0, 0, 1, 1));
-        if (view-&gt;_totalScaleFactorForPrinting &lt;= 0)
-            view-&gt;_totalScaleFactorForPrinting = 1;
-
-        const IntRect&amp; lastPrintingPageRect = view-&gt;_printingPageRects[view-&gt;_printingPageRects.size() - 1];
-        NSRect newFrameSize = NSMakeRect(0, 0, 
-            ceil(lastPrintingPageRect.maxX() * view-&gt;_totalScaleFactorForPrinting), 
-            ceil(lastPrintingPageRect.maxY() * view-&gt;_totalScaleFactorForPrinting));
-        LOG(View, &quot;WKPrintingView setting frame size to x:%g y:%g width:%g height:%g&quot;, newFrameSize.origin.x, newFrameSize.origin.y, newFrameSize.size.width, newFrameSize.size.height);
-        [view setFrame:newFrameSize];
-
-        if ([view _isPrintingPreview]) {
-            // Show page count, and ask for an actual image to replace placeholder.
-            [view _updatePreview];
-        } else {
-            // When printing, request everything we'll need beforehand.
-            [view _preparePDFDataForPrintingOnSecondaryThread];
-        }
-    }
-}
-
-- (BOOL)_askPageToComputePageRects
-{
-    ASSERT(RunLoop::isMain());
-
-    if (!_webFrame-&gt;page())
-        return NO;
-
-    ASSERT(!_expectedComputedPagesCallback);
-
-    IPCCallbackContext* context = new IPCCallbackContext;
-    RefPtr&lt;ComputedPagesCallback&gt; callback = ComputedPagesCallback::create([context](bool, const Vector&lt;WebCore::IntRect&gt;&amp; pageRects, double totalScaleFactorForPrinting) {
-        OwnPtr&lt;IPCCallbackContext&gt; contextDeleter = adoptPtr(context);
-        pageDidComputePageRects(pageRects, totalScaleFactorForPrinting, context);
-    });
-    _expectedComputedPagesCallback = callback-&gt;callbackID();
-    context-&gt;view = self;
-    context-&gt;callbackID = _expectedComputedPagesCallback;
-
-    _webFrame-&gt;page()-&gt;computePagesForPrinting(_webFrame.get(), PrintInfo([_printOperation printInfo]), callback.release());
-    return YES;
-}
-
-static void prepareDataForPrintingOnSecondaryThread(void* untypedContext)
-{
-    ASSERT(RunLoop::isMain());
-
-    WKPrintingView *view = static_cast&lt;WKPrintingView *&gt;(untypedContext);
-    std::lock_guard&lt;std::mutex&gt; lock(view-&gt;_printingCallbackMutex);
-
-    // We may have received page rects while a message to call this function traveled from secondary thread to main one.
-    if ([view _hasPageRects]) {
-        [view _preparePDFDataForPrintingOnSecondaryThread];
-        return;
-    }
-
-    // A request for pages has already been made, just wait for it to finish.
-    if (view-&gt;_expectedComputedPagesCallback)
-        return;
-
-    [view _askPageToComputePageRects];
-}
-
-- (BOOL)knowsPageRange:(NSRangePointer)range
-{
-    LOG(View, &quot;-[WKPrintingView %p knowsPageRange:], %s, %s&quot;, self, [self _hasPageRects] ? &quot;print data is available&quot; : &quot;print data is not available yet&quot;, RunLoop::isMain() ? &quot;on main thread&quot; : &quot;on secondary thread&quot;);
-    ASSERT(_printOperation == [NSPrintOperation currentOperation]);
-
-    // Assuming that once we switch to printing from a secondary thread, we don't go back.
-    ASSERT(!_isPrintingFromSecondaryThread || !RunLoop::isMain());
-    if (!RunLoop::isMain())
-        _isPrintingFromSecondaryThread = YES;
-
-    if (!_webFrame-&gt;page()) {
-        *range = NSMakeRange(1, NSIntegerMax);
-        return YES;
-    }
-
-    [self _suspendAutodisplay];
-    
-    [self performSelectorOnMainThread:@selector(_adjustPrintingMarginsForHeaderAndFooter) withObject:nil waitUntilDone:YES];
-
-    if ([self _hasPageRects])
-        *range = NSMakeRange(1, _printingPageRects.size());
-    else if (!RunLoop::isMain()) {
-        ASSERT(![self _isPrintingPreview]);
-        std::unique_lock&lt;std::mutex&gt; lock(_printingCallbackMutex);
-        callOnMainThread(prepareDataForPrintingOnSecondaryThread, self);
-        _printingCallbackCondition.wait(lock);
-        *range = NSMakeRange(1, _printingPageRects.size());
-    } else {
-        ASSERT([self _isPrintingPreview]);
-
-        // If a request for pages hasn't already been made, make it now.
-        if (!_expectedComputedPagesCallback)
-            [self _askPageToComputePageRects];
-
-        *range = NSMakeRange(1, NSIntegerMax);
-    }
-    return YES;
-}
-
-- (unsigned)_pageForRect:(NSRect)rect
-{
-    // Assuming that rect exactly matches one of the pages.
-    for (size_t i = 0; i &lt; _printingPageRects.size(); ++i) {
-        IntRect currentRect(_printingPageRects[i]);
-        currentRect.scale(_totalScaleFactorForPrinting);
-        if (rect.origin.y == currentRect.y() &amp;&amp; rect.origin.x == currentRect.x())
-            return i + 1;
-    }
-    ASSERT_NOT_REACHED();
-    return 0; // Invalid page number.
-}
-
-- (void)_drawPDFDocument:(PDFDocument *)pdfDocument page:(unsigned)page atPoint:(NSPoint)point
-{
-    if (!pdfDocument) {
-        LOG_ERROR(&quot;Couldn't create a PDF document with data passed for preview&quot;);
-        return;
-    }
-
-    PDFPage *pdfPage;
-    @try {
-        pdfPage = [pdfDocument pageAtIndex:page];
-    } @catch (id exception) {
-        LOG_ERROR(&quot;Preview data doesn't have page %d: %@&quot;, page, exception);
-        return;
-    }
-
-    NSGraphicsContext *nsGraphicsContext = [NSGraphicsContext currentContext];
-    CGContextRef context = static_cast&lt;CGContextRef&gt;([nsGraphicsContext graphicsPort]);
-
-    CGContextSaveGState(context);
-    CGContextTranslateCTM(context, point.x, point.y);
-    CGContextScaleCTM(context, _totalScaleFactorForPrinting, -_totalScaleFactorForPrinting);
-    CGContextTranslateCTM(context, 0, -[pdfPage boundsForBox:kPDFDisplayBoxMediaBox].size.height);
-    [pdfPage drawWithBox:kPDFDisplayBoxMediaBox];
-
-    CGAffineTransform transform = CGContextGetCTM(context);
-
-    for (PDFAnnotation *annotation in [pdfPage annotations]) {
-        if (![annotation isKindOfClass:pdfAnnotationLinkClass()])
-            continue;
-
-        PDFAnnotationLink *linkAnnotation = (PDFAnnotationLink *)annotation;
-        NSURL *url = [linkAnnotation URL];
-        if (!url)
-            continue;
-
-        CGRect urlRect = NSRectToCGRect([linkAnnotation bounds]);
-        CGRect transformedRect = CGRectApplyAffineTransform(urlRect, transform);
-        CGPDFContextSetURLForRect(context, (CFURLRef)url, transformedRect);
-    }
-
-    CGContextRestoreGState(context);
-}
-
-- (void)_drawPreview:(NSRect)nsRect
-{
-    ASSERT(RunLoop::isMain());
-
-    IntRect scaledPrintingRect(nsRect);
-    scaledPrintingRect.scale(1 / _totalScaleFactorForPrinting);
-    IntSize imageSize(nsRect.size);
-    imageSize.scale(_webFrame-&gt;page()-&gt;deviceScaleFactor());
-    HashMap&lt;WebCore::IntRect, RefPtr&lt;ShareableBitmap&gt;&gt;::iterator pagePreviewIterator = _pagePreviews.find(scaledPrintingRect);
-    if (pagePreviewIterator == _pagePreviews.end())  {
-        // It's too early to ask for page preview if we don't even know page size and scale.
-        if ([self _hasPageRects]) {
-            if (uint64_t existingCallback = [self _expectedPreviewCallbackForRect:scaledPrintingRect]) {
-                // We've already asked for a preview of this page, and are waiting for response.
-                // There is no need to ask again.
-                _latestExpectedPreviewCallback = existingCallback;
-            } else {
-                // Preview isn't available yet, request it asynchronously.
-                if (!_webFrame-&gt;page())
-                    return;
-
-                // Return to printing mode if we're already back to screen (e.g. due to window resizing).
-                _webFrame-&gt;page()-&gt;beginPrinting(_webFrame.get(), PrintInfo([_printOperation printInfo]));
-
-                IPCCallbackContext* context = new IPCCallbackContext;
-                RefPtr&lt;ImageCallback&gt; callback = ImageCallback::create([context](bool, const ShareableBitmap::Handle&amp; imageHandle) {
-                    OwnPtr&lt;IPCCallbackContext&gt; contextDeleter = adoptPtr(context);
-                    pageDidDrawToImage(imageHandle, context);
-                });
-                _latestExpectedPreviewCallback = callback-&gt;callbackID();
-                _expectedPreviewCallbacks.add(_latestExpectedPreviewCallback, scaledPrintingRect);
-
-                context-&gt;view = self;
-                context-&gt;callbackID = callback-&gt;callbackID();
-
-                _webFrame-&gt;page()-&gt;drawRectToImage(_webFrame.get(), PrintInfo([_printOperation printInfo]), scaledPrintingRect, imageSize, callback.get());
-                return;
-            }
-        }
-
-        // FIXME: Draw a placeholder
-        return;
-    }
-
-    RefPtr&lt;ShareableBitmap&gt; bitmap = pagePreviewIterator-&gt;value;
-    CGContextRef cgContext = static_cast&lt;CGContextRef&gt;([[NSGraphicsContext currentContext] graphicsPort]);
-
-    GraphicsContext context(cgContext);
-    GraphicsContextStateSaver stateSaver(context);
-
-    bitmap-&gt;paint(context, _webFrame-&gt;page()-&gt;deviceScaleFactor(), IntPoint(nsRect.origin), bitmap-&gt;bounds());
-}
-
-- (void)drawRect:(NSRect)nsRect
-{
-    LOG(View, &quot;WKPrintingView %p printing rect x:%g, y:%g, width:%g, height:%g%s&quot;, self, nsRect.origin.x, nsRect.origin.y, nsRect.size.width, nsRect.size.height, [self _isPrintingPreview] ? &quot; for preview&quot; : &quot;&quot;);
-
-    ASSERT(_printOperation == [NSPrintOperation currentOperation]);
-
-    if (!_webFrame-&gt;page())
-        return;
-
-    if ([self _isPrintingPreview]) {
-        [self _drawPreview:nsRect];
-        return;
-    }
-
-    ASSERT(!RunLoop::isMain());
-    ASSERT(!_printedPagesData.isEmpty()); // Prepared by knowsPageRange:
-
-    if (!_printedPagesPDFDocument) {
-        RetainPtr&lt;NSData&gt; pdfData = adoptNS([[NSData alloc] initWithBytes:_printedPagesData.data() length:_printedPagesData.size()]);
-        _printedPagesPDFDocument = adoptNS([[pdfDocumentClass() alloc] initWithData:pdfData.get()]);
-    }
-
-    unsigned printedPageNumber = [self _pageForRect:nsRect] - [self _firstPrintedPageNumber];
-    [self _drawPDFDocument:_printedPagesPDFDocument.get() page:printedPageNumber atPoint:NSMakePoint(nsRect.origin.x, nsRect.origin.y)];
-}
-
-- (void)_drawPageBorderWithSizeOnMainThread:(NSSize)borderSize
-{
-    ASSERT(RunLoop::isMain());
-
-    // When printing from a secondary thread, the main thread doesn't have graphics context and printing operation set up.
-    NSGraphicsContext *currentContext = [NSGraphicsContext currentContext];
-    [NSGraphicsContext setCurrentContext:[_printOperation context]];
-
-    ASSERT(![NSPrintOperation currentOperation]);
-    [NSPrintOperation setCurrentOperation:_printOperation];
-
-    [self drawPageBorderWithSize:borderSize];
-
-    [NSPrintOperation setCurrentOperation:nil];
-    [NSGraphicsContext setCurrentContext:currentContext];
-}
-
-- (void)drawPageBorderWithSize:(NSSize)borderSize
-{
-    ASSERT(NSEqualSizes(borderSize, [[_printOperation printInfo] paperSize]));    
-    ASSERT(_printOperation == [NSPrintOperation currentOperation]);
-
-    if (!RunLoop::isMain()) {
-        // Don't call the client from a secondary thread.
-        NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:[WKPrintingView instanceMethodSignatureForSelector:@selector(_drawPageBorderWithSizeOnMainThread:)]];
-        [invocation setSelector:@selector(_drawPageBorderWithSizeOnMainThread:)];
-        [invocation setArgument:&amp;borderSize atIndex:2];
-        [invocation performSelectorOnMainThread:@selector(invokeWithTarget:) withObject:self waitUntilDone:YES];
-        return;
-    }
-
-    if (!_webFrame-&gt;page())
-        return;
-
-    // The header and footer rect height scales with the page, but the width is always
-    // all the way across the printed page (inset by printing margins).
-    NSPrintInfo *printInfo = [_printOperation printInfo];
-    CGFloat scale = [printInfo scalingFactor];
-    NSSize paperSize = [printInfo paperSize];
-    CGFloat headerFooterLeft = [printInfo leftMargin] / scale;
-    CGFloat headerFooterWidth = (paperSize.width - ([printInfo leftMargin] + [printInfo rightMargin])) / scale;
-    NSRect footerRect = NSMakeRect(headerFooterLeft, [printInfo bottomMargin] / scale - _webFrame-&gt;page()-&gt;footerHeight(_webFrame.get()), headerFooterWidth, _webFrame-&gt;page()-&gt;footerHeight(_webFrame.get()));
-    NSRect headerRect = NSMakeRect(headerFooterLeft, (paperSize.height - [printInfo topMargin]) / scale, headerFooterWidth, _webFrame-&gt;page()-&gt;headerHeight(_webFrame.get()));
-
-    NSGraphicsContext *currentContext = [NSGraphicsContext currentContext];
-    [currentContext saveGraphicsState];
-    NSRectClip(headerRect);
-    _webFrame-&gt;page()-&gt;drawHeader(_webFrame.get(), headerRect);
-    [currentContext restoreGraphicsState];
-
-    [currentContext saveGraphicsState];
-    NSRectClip(footerRect);
-    _webFrame-&gt;page()-&gt;drawFooter(_webFrame.get(), footerRect);
-    [currentContext restoreGraphicsState];
-}
-
-- (NSRect)rectForPage:(NSInteger)page
-{
-    ASSERT(_printOperation == [NSPrintOperation currentOperation]);
-    if (![self _hasPageRects]) {
-        LOG(View, &quot;-[WKPrintingView %p rectForPage:%d] - data is not yet available&quot;, self, (int)page);
-        if (!_webFrame-&gt;page()) {
-            // We may have not told AppKit how many pages there are, so it will try to print until a null rect is returned.
-            return NSMakeRect(0, 0, 0, 0);
-        }
-        // We must be still calculating the page range.
-        ASSERT(_expectedComputedPagesCallback);
-        return NSMakeRect(0, 0, 1, 1);
-    }
-
-    // If Web process crashes while computing page rects, we never tell AppKit how many pages there are.
-    // Returning a null rect prevents selecting non-existent pages in preview dialog.
-    if (static_cast&lt;unsigned&gt;(page) &gt; _printingPageRects.size()) {
-        ASSERT(!_webFrame-&gt;page());
-        return NSMakeRect(0, 0, 0, 0);
-    }
-
-    IntRect rect = _printingPageRects[page - 1];
-    rect.scale(_totalScaleFactorForPrinting);
-    LOG(View, &quot;-[WKPrintingView %p rectForPage:%d] -&gt; x %d, y %d, width %d, height %d&quot;, self, (int)page, rect.x(), rect.y(), rect.width(), rect.height());
-    return rect;
-}
-
-// Temporary workaround for &lt;rdar://problem/8944535&gt;. Force correct printout positioning.
-- (NSPoint)locationOfPrintRect:(NSRect)aRect
-{
-    ASSERT(_printOperation == [NSPrintOperation currentOperation]);
-    return NSMakePoint([[_printOperation printInfo] leftMargin], [[_printOperation printInfo] bottomMargin]);
-}
-
-- (void)beginDocument
-{
-    ASSERT(_printOperation == [NSPrintOperation currentOperation]);
-
-    // Forcing preview update gets us here, but page setup hasn't actually changed.
-    if (isForcingPreviewUpdate)
-        return;
-
-    LOG(View, &quot;-[WKPrintingView %p beginDocument]&quot;, self);
-
-    [super beginDocument];
-
-    [self _suspendAutodisplay];
-}
-
-- (void)endDocument
-{
-    ASSERT(_printOperation == [NSPrintOperation currentOperation]);
-
-    // Forcing preview update gets us here, but page setup hasn't actually changed.
-    if (isForcingPreviewUpdate)
-        return;
-
-    LOG(View, &quot;-[WKPrintingView %p endDocument] - clearing cached data&quot;, self);
-
-    // Both existing data and pending responses are now obsolete.
-    _printingPageRects.clear();
-    _totalScaleFactorForPrinting = 1;
-    _pagePreviews.clear();
-    _printedPagesData.clear();
-    _printedPagesPDFDocument = nullptr;
-    _expectedComputedPagesCallback = 0;
-    _expectedPreviewCallbacks.clear();
-    _latestExpectedPreviewCallback = 0;
-    _expectedPrintCallback = 0;
-
-    [self _delayedResumeAutodisplay];
-    
-    [super endDocument];
-}
-@end
</del></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPImacWKTextInputWindowControllerh"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebKit2/UIProcess/API/mac/WKTextInputWindowController.h (164600 => 164601)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/mac/WKTextInputWindowController.h        2014-02-24 20:51:05 UTC (rev 164600)
+++ trunk/Source/WebKit2/UIProcess/API/mac/WKTextInputWindowController.h        2014-02-24 20:53:02 UTC (rev 164601)
</span><span class="lines">@@ -1,49 +0,0 @@
</span><del>-/*
- * Copyright (C) 2009, 2010 Apple Inc. All Rights Reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
- */
-
-#ifndef WKTextInputWindowController_h
-#define WKTextInputWindowController_h
-
-#if USE(APPKIT)
-
-@class WKTextInputPanel;
-
-@interface WKTextInputWindowController : NSObject {
-    WKTextInputPanel *_panel;
-}
-
-+ (WKTextInputWindowController *)sharedTextInputWindowController;
-
-- (NSTextInputContext *)inputContext;
-- (BOOL)interpretKeyEvent:(NSEvent *)event usingLegacyCocoaTextInput:(BOOL)usingLegacyCocoaTextInput string:(NSString **)string;
-
-- (BOOL)hasMarkedText;
-- (void)unmarkText;
-
-@end
-
-#endif // USE(APPKIT)
-
-#endif // WKTextInputWindowController_h
</del></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPImacWKTextInputWindowControllermm"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebKit2/UIProcess/API/mac/WKTextInputWindowController.mm (164600 => 164601)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/mac/WKTextInputWindowController.mm        2014-02-24 20:51:05 UTC (rev 164600)
+++ trunk/Source/WebKit2/UIProcess/API/mac/WKTextInputWindowController.mm        2014-02-24 20:53:02 UTC (rev 164601)
</span><span class="lines">@@ -1,214 +0,0 @@
</span><del>-/*
- * Copyright (C) 2010 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#import &quot;config.h&quot;
-#import &quot;WKTextInputWindowController.h&quot;
-
-#if USE(APPKIT)
-
-#import &lt;WebKitSystemInterface.h&gt;
-
-@interface WKTextInputView : NSTextView {
-}
-@end
-
-@implementation WKTextInputView
-
-- (NSArray *)validAttributesForMarkedText
-{
-    // Let TSM know that a bottom input window would be created for marked text.
-    NSArray *regularAttributes = [super validAttributesForMarkedText];
-    NSMutableArray *floatingWindowAttributes = [NSMutableArray arrayWithArray:regularAttributes];
-    [floatingWindowAttributes addObject:@&quot;__NSUsesFloatingInputWindow&quot;];
-    return floatingWindowAttributes;
-}
-
-@end
-
-@interface WKTextInputPanel : NSPanel {
-    NSTextView *_inputTextView;
-}
-
-- (NSTextInputContext *)_inputContext;
-- (BOOL)_interpretKeyEvent:(NSEvent *)event usingLegacyCocoaTextInput:(BOOL)usingLegacyCocoaTextInput string:(NSString **)string;
-
-- (BOOL)_hasMarkedText;
-- (void)_unmarkText;
-
-@end
-
-#define inputWindowHeight 20
-
-@implementation WKTextInputPanel
-
-- (void)dealloc
-{
-    [[NSNotificationCenter defaultCenter] removeObserver:self];
-    
-    [_inputTextView release];
-    
-    [super dealloc];
-}
-
-- (id)init
-{
-    self = [super initWithContentRect:NSZeroRect styleMask:WKGetInputPanelWindowStyle() backing:NSBackingStoreBuffered defer:YES];
-    if (!self)
-        return nil;
-    
-    // Set the frame size.
-    NSRect visibleFrame = [[NSScreen mainScreen] visibleFrame];
-    NSRect frame = NSMakeRect(visibleFrame.origin.x, visibleFrame.origin.y, visibleFrame.size.width, inputWindowHeight);
-     
-    [self setFrame:frame display:NO];
-        
-    _inputTextView = [[WKTextInputView alloc] initWithFrame:[(NSView *)self.contentView frame]];
-    _inputTextView.autoresizingMask = NSViewWidthSizable | NSViewHeightSizable | NSViewMaxXMargin | NSViewMinXMargin | NSViewMaxYMargin | NSViewMinYMargin;
-        
-    NSScrollView* scrollView = [[NSScrollView alloc] initWithFrame:[(NSView *)self.contentView frame]];
-    scrollView.documentView = _inputTextView;
-    self.contentView = scrollView;
-    [scrollView release];
-        
-    [self setFloatingPanel:YES];
-
-    return self;
-}
-
-- (void)_unmarkText
-{
-    [_inputTextView setString:@&quot;&quot;];
-    [self orderOut:nil];
-}
-
-- (BOOL)_interpretKeyEvent:(NSEvent *)event usingLegacyCocoaTextInput:(BOOL)usingLegacyCocoaTextInput string:(NSString **)string
-{
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored &quot;-Wdeprecated-declarations&quot;
-    BOOL hadMarkedText = [_inputTextView hasMarkedText];
-#pragma clang diagnostic pop

-    *string = nil;
-
-    // Let TSM know that a bottom input window would be created for marked text.
-    // FIXME: Can be removed once we can rely on __NSUsesFloatingInputWindow (or a better API) being available everywhere.
-    EventRef carbonEvent = static_cast&lt;EventRef&gt;(const_cast&lt;void*&gt;([event eventRef]));
-    if (carbonEvent) {
-        Boolean ignorePAH = true;
-        SetEventParameter(carbonEvent, 'iPAH', typeBoolean, sizeof(ignorePAH), &amp;ignorePAH);
-    }
-
-    if (![[_inputTextView inputContext] handleEvent:event])
-        return NO;
-    
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored &quot;-Wdeprecated-declarations&quot;
-    if ([_inputTextView hasMarkedText]) {
-#pragma clang diagnostic pop
-        // Don't show the input method window for dead keys
-        if ([[event characters] length] &gt; 0)
-            [self orderFront:nil];
-
-        return YES;
-    }
-
-    bool shouldReturnTextString = hadMarkedText;
-
-    // In the updated Cocoa text input model spec, we always want to return the text even if the text view didn't have marked text.
-    if (!usingLegacyCocoaTextInput)
-        shouldReturnTextString = true;
-
-    if (shouldReturnTextString) {
-        [self orderOut:nil];
-
-        NSString *text = [[_inputTextView textStorage] string];
-        if ([text length] &gt; 0)
-            *string = [[text copy] autorelease];
-    }
-            
-    [_inputTextView setString:@&quot;&quot;];
-    return hadMarkedText;
-}
-
-- (NSTextInputContext *)_inputContext
-{
-    return [_inputTextView inputContext];
-}
-
-- (BOOL)_hasMarkedText
-{
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored &quot;-Wdeprecated-declarations&quot;
-    return [_inputTextView hasMarkedText];
-#pragma clang diagnostic pop
-}
-
-@end
-
-@implementation WKTextInputWindowController
-
-+ (WKTextInputWindowController *)sharedTextInputWindowController
-{
-    static WKTextInputWindowController *textInputWindowController;
-    if (!textInputWindowController)
-        textInputWindowController = [[WKTextInputWindowController alloc] init];
-    
-    return textInputWindowController;
-}
-
-- (id)init
-{
-    self = [super init];
-    if (!self)
-        return nil;
-    
-    _panel = [[WKTextInputPanel alloc] init];
-    
-    return self;
-}
-
-- (NSTextInputContext *)inputContext
-{
-    return [_panel _inputContext];
-}
-
-- (BOOL)hasMarkedText
-{
-    return [_panel _hasMarkedText];
-}
-
-- (BOOL)interpretKeyEvent:(NSEvent *)event usingLegacyCocoaTextInput:(BOOL)usingLegacyCocoaTextInput string:(NSString **)string
-{
-    return [_panel _interpretKeyEvent:event usingLegacyCocoaTextInput:usingLegacyCocoaTextInput string:string];
-}
-
-- (void)unmarkText
-{
-    [_panel _unmarkText];
-}
-
-@end
-
-#endif // USE(APPKIT)
</del></span></pre></div>
<a id="trunkSourceWebKit2UIProcessmacFindIndicatorWindowhfromrev164600trunkSourceWebKit2UIProcessAPImacFindIndicatorWindowh"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebKit2/UIProcess/mac/FindIndicatorWindow.h (from rev 164600, trunk/Source/WebKit2/UIProcess/API/mac/FindIndicatorWindow.h) (0 => 164601)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/mac/FindIndicatorWindow.h                                (rev 0)
+++ trunk/Source/WebKit2/UIProcess/mac/FindIndicatorWindow.h        2014-02-24 20:53:02 UTC (rev 164601)
</span><span class="lines">@@ -0,0 +1,75 @@
</span><ins>+/*
+ * Copyright (C) 2010 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef FindIndicatorWindow_h
+#define FindIndicatorWindow_h
+
+#import &quot;WebKitSystemInterface.h&quot;
+#import &lt;wtf/Noncopyable.h&gt;
+#import &lt;wtf/RefPtr.h&gt;
+#import &lt;wtf/RetainPtr.h&gt;
+#import &lt;wtf/RunLoop.h&gt;
+
+@class WKFindIndicatorWindowAnimation;
+@class WKView;
+
+namespace WebKit {
+
+class FindIndicator;
+
+class FindIndicatorWindow {
+    WTF_MAKE_NONCOPYABLE(FindIndicatorWindow);
+
+public:
+    explicit FindIndicatorWindow(WKView *);
+    ~FindIndicatorWindow();
+
+    void setFindIndicator(PassRefPtr&lt;FindIndicator&gt;, bool fadeOut, bool animate);
+
+private:
+    void closeWindow();
+
+    void startFadeOutTimerFired();
+
+    void fadeOutAnimationCallback(double);
+    void fadeOutAnimationDidEnd();
+
+    void bounceAnimationCallback(double);
+    void bounceAnimationDidEnd();
+
+    WKView* m_wkView;
+    RefPtr&lt;FindIndicator&gt; m_findIndicator;
+    RetainPtr&lt;NSWindow&gt; m_findIndicatorWindow;
+
+    WKWindowBounceAnimationContextRef m_bounceAnimationContext;
+    RetainPtr&lt;WKFindIndicatorWindowAnimation&gt; m_bounceAnimation;
+
+    RunLoop::Timer&lt;FindIndicatorWindow&gt; m_startFadeOutTimer;
+    RetainPtr&lt;WKFindIndicatorWindowAnimation&gt; m_fadeOutAnimation;
+};
+
+} // namespace WebKit
+
+#endif // FindIndicatorWindow_h
</ins></span></pre></div>
<a id="trunkSourceWebKit2UIProcessmacFindIndicatorWindowh"></a>
<div class="propset"><h4>Property changes: trunk/Source/WebKit2/UIProcess/mac/FindIndicatorWindow.h</h4>
<pre class="diff"><span>
</span></pre></div>
<a id="svnkeywords"></a>
<div class="addfile"><h4>Added: svn:keywords</h4></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4>Added: svn:eol-style</h4></div>
<a id="trunkSourceWebKit2UIProcessmacFindIndicatorWindowmmfromrev164600trunkSourceWebKit2UIProcessAPImacFindIndicatorWindowmm"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebKit2/UIProcess/mac/FindIndicatorWindow.mm (from rev 164600, trunk/Source/WebKit2/UIProcess/API/mac/FindIndicatorWindow.mm) (0 => 164601)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/mac/FindIndicatorWindow.mm                                (rev 0)
+++ trunk/Source/WebKit2/UIProcess/mac/FindIndicatorWindow.mm        2014-02-24 20:53:02 UTC (rev 164601)
</span><span class="lines">@@ -0,0 +1,246 @@
</span><ins>+/*
+ * Copyright (C) 2010 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#import &quot;config.h&quot;
+#import &quot;FindIndicatorWindow.h&quot;
+
+#import &quot;FindIndicator.h&quot;
+#import &quot;WKView.h&quot;
+#import &lt;WebCore/GraphicsContext.h&gt;
+
+static const double bounceAnimationDuration = 0.12;
+static const double timeBeforeFadeStarts = bounceAnimationDuration + 0.2;
+static const double fadeOutAnimationDuration = 0.3;
+
+using namespace WebCore;
+
+@interface WKFindIndicatorView : NSView {
+    RefPtr&lt;WebKit::FindIndicator&gt; _findIndicator;
+}
+
+- (id)_initWithFindIndicator:(PassRefPtr&lt;WebKit::FindIndicator&gt;)findIndicator;
+@end
+
+@implementation WKFindIndicatorView
+
+- (id)_initWithFindIndicator:(PassRefPtr&lt;WebKit::FindIndicator&gt;)findIndicator
+{
+    if ((self = [super initWithFrame:NSZeroRect]))
+        _findIndicator = findIndicator;
+
+    return self;
+}
+
+- (void)drawRect:(NSRect)rect
+{
+    GraphicsContext graphicsContext(static_cast&lt;CGContextRef&gt;([[NSGraphicsContext currentContext] graphicsPort]));
+
+    _findIndicator-&gt;draw(graphicsContext, enclosingIntRect(rect));
+}
+
+- (BOOL)isFlipped
+{
+    return YES;
+}
+
+@end
+
+@interface WKFindIndicatorWindowAnimation : NSAnimation&lt;NSAnimationDelegate&gt; {
+    WebKit::FindIndicatorWindow* _findIndicatorWindow;
+    void (WebKit::FindIndicatorWindow::*_animationProgressCallback)(double progress);
+    void (WebKit::FindIndicatorWindow::*_animationDidEndCallback)();
+}
+
+- (id)_initWithFindIndicatorWindow:(WebKit::FindIndicatorWindow *)findIndicatorWindow 
+                 animationDuration:(CFTimeInterval)duration
+         animationProgressCallback:(void (WebKit::FindIndicatorWindow::*)(double progress))animationProgressCallback
+           animationDidEndCallback:(void (WebKit::FindIndicatorWindow::*)())animationDidEndCallback;
+@end
+
+@implementation WKFindIndicatorWindowAnimation
+
+- (id)_initWithFindIndicatorWindow:(WebKit::FindIndicatorWindow *)findIndicatorWindow 
+                 animationDuration:(CFTimeInterval)animationDuration
+         animationProgressCallback:(void (WebKit::FindIndicatorWindow::*)(double progress))animationProgressCallback
+           animationDidEndCallback:(void (WebKit::FindIndicatorWindow::*)())animationDidEndCallback
+{
+    if ((self = [super initWithDuration:animationDuration animationCurve:NSAnimationEaseInOut])) {
+        _findIndicatorWindow = findIndicatorWindow;
+        _animationProgressCallback = animationProgressCallback;
+        _animationDidEndCallback = animationDidEndCallback;
+        [self setDelegate:self];
+        [self setAnimationBlockingMode:NSAnimationNonblocking];
+    }
+    return self;
+}
+
+- (void)setCurrentProgress:(NSAnimationProgress)progress
+{
+    (_findIndicatorWindow-&gt;*_animationProgressCallback)(progress);
+}
+
+- (void)animationDidEnd:(NSAnimation *)animation
+{
+    ASSERT(animation == self);
+
+    (_findIndicatorWindow-&gt;*_animationDidEndCallback)();
+}
+
+@end
+
+namespace WebKit {
+
+FindIndicatorWindow::FindIndicatorWindow(WKView *wkView)
+    : m_wkView(wkView)
+    , m_bounceAnimationContext(0)
+    , m_startFadeOutTimer(RunLoop::main(), this, &amp;FindIndicatorWindow::startFadeOutTimerFired)
+{
+}
+
+FindIndicatorWindow::~FindIndicatorWindow()
+{
+    closeWindow();
+}
+
+void FindIndicatorWindow::setFindIndicator(PassRefPtr&lt;FindIndicator&gt; findIndicator, bool fadeOut, bool animate)
+{
+    if (m_findIndicator == findIndicator)
+        return;
+
+    m_findIndicator = findIndicator;
+
+    // Get rid of the old window.
+    closeWindow();
+
+    if (!m_findIndicator)
+        return;
+
+    NSRect contentRect = m_findIndicator-&gt;frameRect();
+    NSRect windowFrameRect = NSIntegralRect([m_wkView convertRect:contentRect toView:nil]);
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored &quot;-Wdeprecated-declarations&quot;
+    windowFrameRect.origin = [[m_wkView window] convertBaseToScreen:windowFrameRect.origin];
+#pragma clang diagnostic pop
+    NSRect windowContentRect = [NSWindow contentRectForFrameRect:windowFrameRect styleMask:NSBorderlessWindowMask];
+    
+    m_findIndicatorWindow = adoptNS([[NSWindow alloc] initWithContentRect:windowContentRect 
+                                                              styleMask:NSBorderlessWindowMask 
+                                                                backing:NSBackingStoreBuffered
+                                                                  defer:NO]);
+
+    [m_findIndicatorWindow setBackgroundColor:[NSColor clearColor]];
+    [m_findIndicatorWindow setOpaque:NO];
+    [m_findIndicatorWindow setIgnoresMouseEvents:YES];
+
+    RetainPtr&lt;WKFindIndicatorView&gt; findIndicatorView = adoptNS([[WKFindIndicatorView alloc] _initWithFindIndicator:m_findIndicator]);
+    [m_findIndicatorWindow setContentView:findIndicatorView.get()];
+
+    [[m_wkView window] addChildWindow:m_findIndicatorWindow.get() ordered:NSWindowAbove];
+    [m_findIndicatorWindow setReleasedWhenClosed:NO];
+
+    if (animate) {
+        // Start the bounce animation.
+        m_bounceAnimationContext = WKWindowBounceAnimationContextCreate(m_findIndicatorWindow.get());
+        m_bounceAnimation = adoptNS([[WKFindIndicatorWindowAnimation alloc] _initWithFindIndicatorWindow:this
+                                                                                    animationDuration:bounceAnimationDuration
+                                                                            animationProgressCallback:&amp;FindIndicatorWindow::bounceAnimationCallback
+                                                                              animationDidEndCallback:&amp;FindIndicatorWindow::bounceAnimationDidEnd]);
+        [m_bounceAnimation startAnimation];
+    }
+
+    if (fadeOut)
+        m_startFadeOutTimer.startOneShot(timeBeforeFadeStarts);
+}
+
+void FindIndicatorWindow::closeWindow()
+{
+    if (!m_findIndicatorWindow)
+        return;
+
+    m_startFadeOutTimer.stop();
+
+    if (m_fadeOutAnimation) {
+        [m_fadeOutAnimation stopAnimation];
+        m_fadeOutAnimation = nullptr;
+    }
+
+    if (m_bounceAnimation) {
+        [m_bounceAnimation stopAnimation];
+        m_bounceAnimation = nullptr;
+    }
+
+    if (m_bounceAnimationContext)
+        WKWindowBounceAnimationContextDestroy(m_bounceAnimationContext);
+    
+    [[m_findIndicatorWindow parentWindow] removeChildWindow:m_findIndicatorWindow.get()];
+    [m_findIndicatorWindow close];
+    m_findIndicatorWindow = nullptr;
+}
+
+void FindIndicatorWindow::startFadeOutTimerFired()
+{
+    ASSERT(!m_fadeOutAnimation);
+    
+    m_fadeOutAnimation = adoptNS([[WKFindIndicatorWindowAnimation alloc] _initWithFindIndicatorWindow:this
+                                                                                   animationDuration:fadeOutAnimationDuration
+                                                                           animationProgressCallback:&amp;FindIndicatorWindow::fadeOutAnimationCallback
+                                                                             animationDidEndCallback:&amp;FindIndicatorWindow::fadeOutAnimationDidEnd]);
+    [m_fadeOutAnimation startAnimation];
+}
+                        
+void FindIndicatorWindow::fadeOutAnimationCallback(double progress)
+{
+    ASSERT(m_fadeOutAnimation);
+
+    [m_findIndicatorWindow setAlphaValue:1.0 - progress];
+}
+
+void FindIndicatorWindow::fadeOutAnimationDidEnd()
+{
+    ASSERT(m_fadeOutAnimation);
+    ASSERT(m_findIndicatorWindow);
+
+    closeWindow();
+}
+
+void FindIndicatorWindow::bounceAnimationCallback(double progress)
+{
+    ASSERT(m_bounceAnimation);
+    ASSERT(m_bounceAnimationContext);
+
+    WKWindowBounceAnimationSetAnimationProgress(m_bounceAnimationContext, progress);
+}
+
+void FindIndicatorWindow::bounceAnimationDidEnd()
+{
+    ASSERT(m_bounceAnimation);
+    ASSERT(m_bounceAnimationContext);
+    ASSERT(m_findIndicatorWindow);
+
+    WKWindowBounceAnimationContextDestroy(m_bounceAnimationContext);
+    m_bounceAnimationContext = 0;
+}
+
+} // namespace WebKit
</ins></span></pre></div>
<a id="trunkSourceWebKit2UIProcessmacPDFViewControllerhfromrev164600trunkSourceWebKit2UIProcessAPImacPDFViewControllerh"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebKit2/UIProcess/mac/PDFViewController.h (from rev 164600, trunk/Source/WebKit2/UIProcess/API/mac/PDFViewController.h) (0 => 164601)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/mac/PDFViewController.h                                (rev 0)
+++ trunk/Source/WebKit2/UIProcess/mac/PDFViewController.h        2014-02-24 20:53:02 UTC (rev 164601)
</span><span class="lines">@@ -0,0 +1,96 @@
</span><ins>+/*
+ * Copyright (C) 2010, 2011 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef PDFViewController_h
+#define PDFViewController_h
+
+#include &quot;WebFindOptions.h&quot;
+#include &lt;wtf/Forward.h&gt;
+#include &lt;wtf/Noncopyable.h&gt;
+#include &lt;wtf/PassOwnPtr.h&gt;
+#include &lt;wtf/RetainPtr.h&gt;
+#include &lt;wtf/text/WTFString.h&gt;
+
+@class PDFView;
+@class WKView;
+@class WKPDFView;
+
+namespace IPC {
+class DataReference;
+}
+
+namespace WebKit {
+
+class WebPageProxy;
+
+class PDFViewController {
+    WTF_MAKE_NONCOPYABLE(PDFViewController);
+
+public:
+    static PassOwnPtr&lt;PDFViewController&gt; create(WKView *);
+    ~PDFViewController();
+
+    WKView* wkView() const { return m_wkView; }
+    WebPageProxy* page() const;
+    NSView* pdfView() const;
+    
+    void setPDFDocumentData(const String&amp; mimeType, const String&amp; suggestedFilename, const IPC::DataReference&amp;);
+
+    double zoomFactor() const;
+    void setZoomFactor(double);
+
+    static Class pdfPreviewViewClass();
+
+    bool forwardScrollWheelEvent(NSEvent *);
+
+    NSPrintOperation *makePrintOperation(NSPrintInfo *);
+    void openPDFInFinder();
+    void savePDFToDownloadsFolder();
+    void linkClicked(const String&amp; url);
+    void print();
+
+    void findString(const String&amp;, FindOptions, unsigned maxMatchCount);
+    void countStringMatches(const String&amp;, FindOptions, unsigned maxMatchCount);
+
+private:
+    explicit PDFViewController(WKView *);
+
+    static Class pdfDocumentClass();
+    static NSBundle* pdfKitBundle();
+
+    WKView* m_wkView;
+
+    RetainPtr&lt;WKPDFView&gt; m_wkPDFView;
+    PDFView* m_pdfView;
+
+    RetainPtr&lt;NSString&gt; m_suggestedFilename;
+    RetainPtr&lt;CFDataRef&gt; m_pdfData;
+
+    String m_temporaryPDFUUID;
+};
+
+} // namespace WebKit
+
+#endif // PDFViewController_h
</ins></span></pre></div>
<a id="trunkSourceWebKit2UIProcessmacPDFViewControllerh"></a>
<div class="propset"><h4>Property changes: trunk/Source/WebKit2/UIProcess/mac/PDFViewController.h</h4>
<pre class="diff"><span>
</span></pre></div>
<a id="svnkeywords"></a>
<div class="addfile"><h4>Added: svn:keywords</h4></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4>Added: svn:eol-style</h4></div>
<a id="trunkSourceWebKit2UIProcessmacPDFViewControllermmfromrev164600trunkSourceWebKit2UIProcessAPImacPDFViewControllermm"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebKit2/UIProcess/mac/PDFViewController.mm (from rev 164600, trunk/Source/WebKit2/UIProcess/API/mac/PDFViewController.mm) (0 => 164601)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/mac/PDFViewController.mm                                (rev 0)
+++ trunk/Source/WebKit2/UIProcess/mac/PDFViewController.mm        2014-02-24 20:53:02 UTC (rev 164601)
</span><span class="lines">@@ -0,0 +1,678 @@
</span><ins>+/*
+ * Copyright (C) 2010, 2011 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#import &quot;config.h&quot;
+#import &quot;PDFViewController.h&quot;
+
+#import &quot;DataReference.h&quot;
+#import &quot;WKAPICast.h&quot;
+#import &quot;WKViewPrivate.h&quot;
+#import &quot;WebData.h&quot;
+#import &quot;WebEventFactory.h&quot;
+#import &quot;WebPageGroup.h&quot;
+#import &quot;WebPageProxy.h&quot;
+#import &quot;WebPreferences.h&quot;
+#import &lt;PDFKit/PDFKit.h&gt;
+#import &lt;WebCore/LocalizedStrings.h&gt;
+#import &lt;WebCore/UUID.h&gt;
+#import &lt;wtf/ObjcRuntimeExtras.h&gt;
+#import &lt;wtf/text/CString.h&gt;
+#import &lt;wtf/text/WTFString.h&gt;
+
+// Redeclarations of PDFKit notifications. We can't use the API since we use a weak link to the framework.
+#define _webkit_PDFViewDisplayModeChangedNotification @&quot;PDFViewDisplayModeChanged&quot;
+#define _webkit_PDFViewScaleChangedNotification @&quot;PDFViewScaleChanged&quot;
+#define _webkit_PDFViewPageChangedNotification @&quot;PDFViewChangedPage&quot;
+
+using namespace WebCore;
+using namespace WebKit;
+
+@class PDFDocument;
+@class PDFView;
+
+@interface PDFDocument (PDFDocumentDetails)
+- (NSPrintOperation *)getPrintOperationForPrintInfo:(NSPrintInfo *)printInfo autoRotate:(BOOL)doRotate;
+@end
+
+extern &quot;C&quot; NSString *_NSPathForSystemFramework(NSString *framework);
+
+// MARK: C UTILITY FUNCTIONS
+
+static void _applicationInfoForMIMEType(NSString *type, NSString **name, NSImage **image)
+{
+    ASSERT(name);
+    ASSERT(image);
+    
+    CFURLRef appURL = 0;
+
+    OSStatus error = LSCopyApplicationForMIMEType((CFStringRef)type, kLSRolesAll, &amp;appURL);
+    if (error != noErr)
+        return;
+
+    NSString *appPath = [(NSURL *)appURL path];
+    if (appURL)
+        CFRelease(appURL);
+
+    *image = [[NSWorkspace sharedWorkspace] iconForFile:appPath];
+    [*image setSize:NSMakeSize(16, 16)];
+
+    *name = [[NSFileManager defaultManager] displayNameAtPath:appPath];
+}
+
+// FIXME 4182876: We can eliminate this function in favor if -isEqual: if [PDFSelection isEqual:] is overridden
+// to compare contents.
+static BOOL _PDFSelectionsAreEqual(PDFSelection *selectionA, PDFSelection *selectionB)
+{
+    NSArray *aPages = [selectionA pages];
+    NSArray *bPages = [selectionB pages];
+
+    if (![aPages isEqual:bPages])
+        return NO;
+
+    NSUInteger count = [aPages count];
+    for (NSUInteger i = 0; i &lt; count; ++i) {
+        NSRect aBounds = [selectionA boundsForPage:[aPages objectAtIndex:i]];
+        NSRect bBounds = [selectionB boundsForPage:[bPages objectAtIndex:i]];
+        if (!NSEqualRects(aBounds, bBounds))
+            return NO;
+    }
+
+    return YES;
+}
+
+@interface WKPDFView : NSView
+{
+    PDFViewController* _pdfViewController;
+
+    RetainPtr&lt;NSView&gt; _pdfPreviewView;
+    PDFView *_pdfView;
+    BOOL _ignoreScaleAndDisplayModeAndPageNotifications;
+    BOOL _willUpdatePreferencesSoon;
+}
+
+- (id)initWithFrame:(NSRect)frame PDFViewController:(PDFViewController*)pdfViewController;
+- (void)invalidate;
+- (PDFView *)pdfView;
+- (void)setDocument:(PDFDocument *)pdfDocument;
+
+- (BOOL)forwardScrollWheelEvent:(NSEvent *)wheelEvent;
+- (void)_applyPDFPreferences;
+- (PDFSelection *)_nextMatchFor:(NSString *)string direction:(BOOL)forward caseSensitive:(BOOL)caseFlag wrap:(BOOL)wrapFlag fromSelection:(PDFSelection *)initialSelection startInSelection:(BOOL)startInSelection;
+@end
+
+@implementation WKPDFView
+
+- (id)initWithFrame:(NSRect)frame PDFViewController:(PDFViewController*)pdfViewController
+{
+    if ((self = [super initWithFrame:frame])) {
+        _pdfViewController = pdfViewController;
+
+        [self setAutoresizingMask:NSViewWidthSizable | NSViewHeightSizable];
+
+        Class previewViewClass = PDFViewController::pdfPreviewViewClass();
+        ASSERT(previewViewClass);
+
+        _pdfPreviewView = adoptNS([[previewViewClass alloc] initWithFrame:frame]);
+        [_pdfPreviewView.get() setAutoresizingMask:NSViewWidthSizable | NSViewHeightSizable];
+        [self addSubview:_pdfPreviewView.get()];
+
+        _pdfView = [_pdfPreviewView.get() performSelector:@selector(pdfView)];
+        [_pdfView setDelegate:self];
+    }
+
+    return self;
+}
+
+- (void)invalidate
+{
+    _pdfViewController = 0;
+}
+
+- (PDFView *)pdfView
+{
+    return _pdfView;
+}
+
+- (void)setDocument:(PDFDocument *)pdfDocument
+{
+    _ignoreScaleAndDisplayModeAndPageNotifications = YES;
+    [_pdfView setDocument:pdfDocument];
+    [self _applyPDFPreferences];
+    _ignoreScaleAndDisplayModeAndPageNotifications = NO;
+}
+
+- (void)_applyPDFPreferences
+{
+    if (!_pdfViewController)
+        return;
+
+    WebPreferences *preferences = _pdfViewController-&gt;page()-&gt;pageGroup()-&gt;preferences();
+
+    CGFloat scaleFactor = preferences-&gt;pdfScaleFactor();
+    if (!scaleFactor)
+        [_pdfView setAutoScales:YES];
+    else {
+        [_pdfView setAutoScales:NO];
+        [_pdfView setScaleFactor:scaleFactor];
+    }
+    [_pdfView setDisplayMode:preferences-&gt;pdfDisplayMode()];
+}
+
+- (void)_updatePreferences:(id)ignored
+{
+    _willUpdatePreferencesSoon = NO;
+
+    if (!_pdfViewController)
+        return;
+
+    WebPreferences* preferences = _pdfViewController-&gt;page()-&gt;pageGroup()-&gt;preferences();
+
+    CGFloat scaleFactor = [_pdfView autoScales] ? 0 : [_pdfView scaleFactor];
+    preferences-&gt;setPDFScaleFactor(scaleFactor);
+    preferences-&gt;setPDFDisplayMode([_pdfView displayMode]);
+}
+
+- (void)_updatePreferencesSoon
+{   
+    if (_willUpdatePreferencesSoon)
+        return;
+
+    [self performSelector:@selector(_updatePreferences:) withObject:nil afterDelay:0];
+    _willUpdatePreferencesSoon = YES;
+}
+
+- (void)_scaleOrDisplayModeOrPageChanged:(NSNotification *)notification
+{
+    ASSERT_ARG(notification, [notification object] == _pdfView);
+    if (!_ignoreScaleAndDisplayModeAndPageNotifications)
+        [self _updatePreferencesSoon];
+}
+
+- (void)_openWithFinder:(id)sender
+{
+    _pdfViewController-&gt;openPDFInFinder();
+}
+
+- (PDFSelection *)_nextMatchFor:(NSString *)string direction:(BOOL)forward caseSensitive:(BOOL)caseFlag wrap:(BOOL)wrapFlag fromSelection:(PDFSelection *)initialSelection startInSelection:(BOOL)startInSelection
+{
+    if (![string length])
+        return nil;
+
+    int options = 0;
+    if (!forward)
+        options |= NSBackwardsSearch;
+
+    if (!caseFlag)
+        options |= NSCaseInsensitiveSearch;
+
+    PDFDocument *document = [_pdfView document];
+
+    PDFSelection *selectionForInitialSearch = [initialSelection copy];
+    if (startInSelection) {
+        // Initially we want to include the selected text in the search.  So we must modify the starting search 
+        // selection to fit PDFDocument's search requirements: selection must have a length &gt;= 1, begin before 
+        // the current selection (if searching forwards) or after (if searching backwards).
+        int initialSelectionLength = [[initialSelection string] length];
+        if (forward) {
+            [selectionForInitialSearch extendSelectionAtStart:1];
+            [selectionForInitialSearch extendSelectionAtEnd:-initialSelectionLength];
+        } else {
+            [selectionForInitialSearch extendSelectionAtEnd:1];
+            [selectionForInitialSearch extendSelectionAtStart:-initialSelectionLength];
+        }
+    }
+    PDFSelection *foundSelection = [document findString:string fromSelection:selectionForInitialSearch withOptions:options];
+    [selectionForInitialSearch release];
+
+    // If we first searched in the selection, and we found the selection, search again from just past the selection
+    if (startInSelection &amp;&amp; _PDFSelectionsAreEqual(foundSelection, initialSelection))
+        foundSelection = [document findString:string fromSelection:initialSelection withOptions:options];
+
+    if (!foundSelection &amp;&amp; wrapFlag)
+        foundSelection = [document findString:string fromSelection:nil withOptions:options];
+
+    return foundSelection;
+}
+
+- (NSUInteger)_countMatches:(NSString *)string caseSensitive:(BOOL)caseFlag
+{
+    if (![string length])
+        return 0;
+
+    int options = caseFlag ? 0 : NSCaseInsensitiveSearch;
+
+    return [[[_pdfView document] findString:string withOptions:options] count];
+}
+
+// MARK: NSView overrides
+
+- (void)viewDidMoveToWindow
+{
+    if (![self window])
+        return;
+
+    NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter];
+    [notificationCenter addObserver:self selector:@selector(_scaleOrDisplayModeOrPageChanged:) name:_webkit_PDFViewScaleChangedNotification object:_pdfView];
+    [notificationCenter addObserver:self selector:@selector(_scaleOrDisplayModeOrPageChanged:) name:_webkit_PDFViewDisplayModeChangedNotification object:_pdfView];
+    [notificationCenter addObserver:self selector:@selector(_scaleOrDisplayModeOrPageChanged:) name:_webkit_PDFViewPageChangedNotification object:_pdfView];
+}
+
+- (void)viewWillMoveToWindow:(NSWindow *)newWindow
+{
+    if (![self window])
+        return;
+
+    NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter];
+    [notificationCenter removeObserver:self name:_webkit_PDFViewScaleChangedNotification object:_pdfView];
+    [notificationCenter removeObserver:self name:_webkit_PDFViewDisplayModeChangedNotification object:_pdfView];
+    [notificationCenter removeObserver:self name:_webkit_PDFViewPageChangedNotification object:_pdfView];
+}
+
+- (NSView *)hitTest:(NSPoint)point
+{
+    // Override hitTest so we can override menuForEvent.
+    NSEvent *event = [NSApp currentEvent];
+    NSEventType type = [event type];
+    if (type == NSRightMouseDown || (type == NSLeftMouseDown &amp;&amp; ([event modifierFlags] &amp; NSControlKeyMask)))
+        return self;
+
+    return [super hitTest:point];
+}
+
+static void insertOpenWithDefaultPDFMenuItem(NSMenu *menu, NSUInteger index)
+{
+    // Add in an &quot;Open with &lt;default PDF viewer&gt;&quot; item
+    NSString *appName = nil;
+    NSImage *appIcon = nil;
+    
+    _applicationInfoForMIMEType(@&quot;application/pdf&quot;, &amp;appName, &amp;appIcon);
+    if (!appName)
+        appName = WEB_UI_STRING(&quot;Finder&quot;, &quot;Default application name for Open With context menu&quot;);
+    
+    // To match the PDFKit style, we'll add Open with Preview even when there's no document yet to view, and
+    // disable it using validateUserInterfaceItem.
+    NSString *title = [NSString stringWithFormat:WEB_UI_STRING(&quot;Open with %@&quot;, &quot;context menu item for PDF&quot;), appName];
+    
+    NSMenuItem *item = [[NSMenuItem alloc] initWithTitle:title action:@selector(_openWithFinder:) keyEquivalent:@&quot;&quot;];
+    if (appIcon)
+        [item setImage:appIcon];
+    [menu insertItem:item atIndex:index];
+    [item release];
+}
+
+- (NSMenu *)menuForEvent:(NSEvent *)theEvent
+{
+    NSMenu *menu = [[NSMenu alloc] initWithTitle:@&quot;&quot;];
+
+    bool insertedOpenWithItem = false;
+    
+    NSEnumerator *menuItemEnumerator = [[[_pdfView menuForEvent:theEvent] itemArray] objectEnumerator];
+    while (NSMenuItem *item = [menuItemEnumerator nextObject]) {
+        NSMenuItem *itemCopy = [item copy];
+        [menu addItem:itemCopy];
+        [itemCopy release];
+
+        if (insertedOpenWithItem)
+            continue;
+        
+        // If a &quot;Copy&quot; item is present, place the &quot;Open With&quot; item just after it, with an intervening separator.
+        if ([item action] != @selector(copy:))
+            continue;
+        
+        [menu addItem:[NSMenuItem separatorItem]];
+        insertOpenWithDefaultPDFMenuItem(menu, [menu numberOfItems]);
+        insertedOpenWithItem = true;
+    }
+    
+    if (!insertedOpenWithItem) {
+        // No &quot;Copy&quot; item was found; place the &quot;Open With&quot; item at the top of the menu, with a trailing separator.
+        insertOpenWithDefaultPDFMenuItem(menu, 0);
+        [menu insertItem:[NSMenuItem separatorItem] atIndex:1];
+    }
+
+    return [menu autorelease];
+}
+
+// MARK: NSUserInterfaceValidations PROTOCOL IMPLEMENTATION
+
+- (BOOL)validateUserInterfaceItem:(id &lt;NSValidatedUserInterfaceItem&gt;)item
+{
+    SEL action = [item action];
+    if (action == @selector(_openWithFinder:))
+        return [_pdfView document] != nil;
+    return YES;
+}
+
+// MARK: PDFView delegate methods
+
+- (void)PDFViewWillClickOnLink:(PDFView *)sender withURL:(NSURL *)URL
+{
+    _pdfViewController-&gt;linkClicked([URL absoluteString]);
+}
+
+- (void)PDFViewOpenPDFInNativeApplication:(PDFView *)sender
+{
+    _pdfViewController-&gt;openPDFInFinder();
+}
+
+- (void)PDFViewSavePDFToDownloadFolder:(PDFView *)sender
+{
+    _pdfViewController-&gt;savePDFToDownloadsFolder();
+}
+
+- (void)PDFViewPerformPrint:(PDFView *)sender
+{
+    _pdfViewController-&gt;print();
+}
+
+- (BOOL)forwardScrollWheelEvent:(NSEvent *)wheelEvent
+{
+    return _pdfViewController-&gt;forwardScrollWheelEvent(wheelEvent);
+}
+
+@end
+
+namespace WebKit {
+
+PassOwnPtr&lt;PDFViewController&gt; PDFViewController::create(WKView *wkView)
+{
+    return adoptPtr(new PDFViewController(wkView));
+}
+
+PDFViewController::PDFViewController(WKView *wkView)
+    : m_wkView(wkView)
+    , m_wkPDFView(adoptNS([[WKPDFView alloc] initWithFrame:[m_wkView bounds] PDFViewController:this]))
+    , m_pdfView([m_wkPDFView.get() pdfView])
+{
+    [m_wkView addSubview:m_wkPDFView.get()];
+}
+
+PDFViewController::~PDFViewController()
+{
+    [m_wkPDFView.get() removeFromSuperview];
+    [m_wkPDFView.get() invalidate];
+    m_wkPDFView = nullptr;
+}
+
+WebPageProxy* PDFViewController::page() const
+{
+    return toImpl([m_wkView pageRef]);
+}
+
+NSView* PDFViewController::pdfView() const
+{ 
+    return m_wkPDFView.get(); 
+}
+    
+static RetainPtr&lt;CFDataRef&gt; convertPostScriptDataSourceToPDF(const IPC::DataReference&amp; dataReference)
+{
+    // Convert PostScript to PDF using Quartz 2D API
+    // http://developer.apple.com/documentation/GraphicsImaging/Conceptual/drawingwithquartz2d/dq_ps_convert/chapter_16_section_1.html
+    
+    CGPSConverterCallbacks callbacks = { 0, 0, 0, 0, 0, 0, 0, 0 };    
+    RetainPtr&lt;CGPSConverterRef&gt; converter = adoptCF(CGPSConverterCreate(0, &amp;callbacks, 0));
+    ASSERT(converter);
+
+    RetainPtr&lt;NSData&gt; nsData = adoptNS([[NSData alloc] initWithBytesNoCopy:const_cast&lt;uint8_t*&gt;(dataReference.data()) length:dataReference.size() freeWhenDone:NO]);   
+
+    RetainPtr&lt;CGDataProviderRef&gt; provider = adoptCF(CGDataProviderCreateWithCFData((CFDataRef)nsData.get()));
+    ASSERT(provider);
+
+    RetainPtr&lt;CFMutableDataRef&gt; result = adoptCF(CFDataCreateMutable(kCFAllocatorDefault, 0));
+    ASSERT(result);
+    
+    RetainPtr&lt;CGDataConsumerRef&gt; consumer = adoptCF(CGDataConsumerCreateWithCFData(result.get()));
+    ASSERT(consumer);
+    
+    CGPSConverterConvert(converter.get(), provider.get(), consumer.get(), 0);
+
+    if (!result)
+        return 0;
+
+    return result;
+}
+
+void PDFViewController::setPDFDocumentData(const String&amp; mimeType, const String&amp; suggestedFilename, const IPC::DataReference&amp; dataReference)
+{
+    if (equalIgnoringCase(mimeType, &quot;application/postscript&quot;)) {
+        m_pdfData = convertPostScriptDataSourceToPDF(dataReference);
+        if (!m_pdfData)
+            return;
+        m_suggestedFilename = String(suggestedFilename + &quot;.pdf&quot;);
+    } else {
+        // Make sure to copy the data.
+        m_pdfData = adoptCF(CFDataCreate(0, dataReference.data(), dataReference.size()));
+        m_suggestedFilename = suggestedFilename;
+    }
+
+    RetainPtr&lt;PDFDocument&gt; pdfDocument = adoptNS([[pdfDocumentClass() alloc] initWithData:(NSData *)m_pdfData.get()]);
+    [m_wkPDFView.get() setDocument:pdfDocument.get()];
+}
+
+double PDFViewController::zoomFactor() const
+{
+    return [m_pdfView scaleFactor];
+}
+
+void PDFViewController::setZoomFactor(double zoomFactor)
+{
+    [m_pdfView setScaleFactor:zoomFactor];
+}
+
+Class PDFViewController::pdfDocumentClass()
+{
+    static Class pdfDocumentClass = [pdfKitBundle() classNamed:@&quot;PDFDocument&quot;];
+    
+    return pdfDocumentClass;
+}
+
+Class PDFViewController::pdfPreviewViewClass()
+{
+    static Class pdfPreviewViewClass = [pdfKitBundle() classNamed:@&quot;PDFPreviewView&quot;];
+    
+    return pdfPreviewViewClass;
+}
+
+bool PDFViewController::forwardScrollWheelEvent(NSEvent *wheelEvent)
+{
+    CGFloat deltaX = [wheelEvent deltaX];
+    if ((deltaX &gt; 0 &amp;&amp; !page()-&gt;canGoBack()) || (deltaX &lt; 0 &amp;&amp; !page()-&gt;canGoForward()))
+        return false;
+
+    [m_wkView scrollWheel:wheelEvent];
+    return true;
+}
+
+static IMP oldPDFViewScrollView_scrollWheel;
+
+static WKPDFView *findEnclosingWKPDFView(NSView *view)
+{
+    for (NSView *superview = [view superview]; superview; superview = [superview superview]) {
+        if ([superview isKindOfClass:[WKPDFView class]])
+            return static_cast&lt;WKPDFView *&gt;(superview);
+    }
+
+    return nil;
+}
+
+static void PDFViewScrollView_scrollWheel(NSScrollView* self, SEL _cmd, NSEvent *wheelEvent)
+{
+    CGFloat deltaX = [wheelEvent deltaX];
+    CGFloat deltaY = [wheelEvent deltaY];
+
+    NSSize contentsSize = [[self documentView] bounds].size;
+    NSRect visibleRect = [self documentVisibleRect];
+
+    // We only want to forward the wheel events if the horizontal delta is non-zero,
+    // and only if we're pinned to either the left or right side.
+    // We also never want to forward momentum scroll events.
+    if ([wheelEvent momentumPhase] == NSEventPhaseNone &amp;&amp; deltaX &amp;&amp; fabsf(deltaY) &lt; fabsf(deltaX)
+        &amp;&amp; ((deltaX &gt; 0 &amp;&amp; visibleRect.origin.x &lt;= 0) || (deltaX &lt; 0 &amp;&amp; contentsSize.width &lt;= NSMaxX(visibleRect)))) {
+    
+        if (WKPDFView *pdfView = findEnclosingWKPDFView(self)) {
+            if ([pdfView forwardScrollWheelEvent:wheelEvent])
+                return;
+        }
+    }
+
+    wtfCallIMP&lt;void&gt;(oldPDFViewScrollView_scrollWheel, self, _cmd, wheelEvent);
+}
+
+NSBundle* PDFViewController::pdfKitBundle()
+{
+    static NSBundle *pdfKitBundle;
+    if (pdfKitBundle)
+        return pdfKitBundle;
+
+    NSString *pdfKitPath = [_NSPathForSystemFramework(@&quot;Quartz.framework&quot;) stringByAppendingString:@&quot;/Frameworks/PDFKit.framework&quot;];
+    if (!pdfKitPath) {
+        LOG_ERROR(&quot;Couldn't find PDFKit.framework&quot;);
+        return nil;
+    }
+
+    pdfKitBundle = [NSBundle bundleWithPath:pdfKitPath];
+    if (![pdfKitBundle load])
+        LOG_ERROR(&quot;Couldn't load PDFKit.framework&quot;);
+
+    if (Class pdfViewScrollViewClass = [pdfKitBundle classNamed:@&quot;PDFViewScrollView&quot;]) {
+        if (Method scrollWheel = class_getInstanceMethod(pdfViewScrollViewClass, @selector(scrollWheel:)))
+            oldPDFViewScrollView_scrollWheel = method_setImplementation(scrollWheel, reinterpret_cast&lt;IMP&gt;(PDFViewScrollView_scrollWheel));
+    }
+
+    return pdfKitBundle;
+}
+
+NSPrintOperation *PDFViewController::makePrintOperation(NSPrintInfo *printInfo)
+{
+    return [[m_pdfView document] getPrintOperationForPrintInfo:printInfo autoRotate:YES];
+}
+
+void PDFViewController::openPDFInFinder()
+{
+    // We don't want to open the PDF until we have a document to write. (see 4892525).
+    if (![m_pdfView document]) {
+        NSBeep();
+        return;
+    }
+
+    if (!m_temporaryPDFUUID) {
+        ASSERT(m_pdfData);
+        m_temporaryPDFUUID = createCanonicalUUIDString();
+        page()-&gt;savePDFToTemporaryFolderAndOpenWithNativeApplicationRaw(m_suggestedFilename.get(), page()-&gt;mainFrame()-&gt;url(), CFDataGetBytePtr(m_pdfData.get()), CFDataGetLength(m_pdfData.get()), m_temporaryPDFUUID);
+        return;
+    }
+
+    page()-&gt;openPDFFromTemporaryFolderWithNativeApplication(m_temporaryPDFUUID);
+}
+
+static void releaseCFData(unsigned char*, const void* data)
+{
+    ASSERT(CFGetTypeID(data) == CFDataGetTypeID());
+
+    // Balanced by CFRetain in savePDFToDownloadsFolder.
+    CFRelease(data);
+}
+
+void PDFViewController::savePDFToDownloadsFolder()
+{
+    // We don't want to write the file until we have a document to write. (see 5267607).
+    if (![m_pdfView document]) {
+        NSBeep();
+        return;
+    }
+
+    ASSERT(m_pdfData);
+
+    // Balanced by CFRelease in releaseCFData.
+    CFRetain(m_pdfData.get());
+
+    RefPtr&lt;WebData&gt; data = WebData::createWithoutCopying(CFDataGetBytePtr(m_pdfData.get()), CFDataGetLength(m_pdfData.get()), releaseCFData, m_pdfData.get());
+
+    page()-&gt;saveDataToFileInDownloadsFolder(m_suggestedFilename.get(), page()-&gt;mainFrame()-&gt;mimeType(), page()-&gt;mainFrame()-&gt;url(), data.get());
+}
+
+void PDFViewController::linkClicked(const String&amp; url)
+{
+    NSEvent* nsEvent = [NSApp currentEvent];
+    WebMouseEvent event;
+    switch ([nsEvent type]) {
+    case NSLeftMouseUp:
+    case NSRightMouseUp:
+    case NSOtherMouseUp:
+        event = WebEventFactory::createWebMouseEvent(nsEvent, m_pdfView);
+    default:
+        // For non mouse-clicks or for keyboard events, pass an empty WebMouseEvent
+        // through.  The event is only used by the WebFrameLoaderClient to determine
+        // the modifier keys and which mouse button is down.  These queries will be
+        // valid with an empty event.
+        break;
+    }
+    
+    page()-&gt;linkClicked(url, event);
+}
+
+void PDFViewController::print()
+{
+    page()-&gt;printMainFrame();
+}
+
+void PDFViewController::findString(const String&amp; string, FindOptions options, unsigned maxMatchCount)
+{
+    BOOL forward = !(options &amp; FindOptionsBackwards);
+    BOOL caseFlag = !(options &amp; FindOptionsCaseInsensitive);
+    BOOL wrapFlag = options &amp; FindOptionsWrapAround;
+
+    PDFSelection *selection = [m_wkPDFView.get() _nextMatchFor:string direction:forward caseSensitive:caseFlag wrap:wrapFlag fromSelection:[m_pdfView currentSelection] startInSelection:NO];
+    if (!selection) {
+        page()-&gt;didFailToFindString(string);
+        return;
+    }
+
+    NSUInteger matchCount;
+    if (!maxMatchCount) {
+        // If the max was zero, any result means we exceeded the max. We can skip computing the actual count.
+        matchCount = static_cast&lt;unsigned&gt;(kWKMoreThanMaximumMatchCount);
+    } else {
+        matchCount = [m_wkPDFView.get() _countMatches:string caseSensitive:caseFlag];
+        if (matchCount &gt; maxMatchCount)
+            matchCount = static_cast&lt;unsigned&gt;(kWKMoreThanMaximumMatchCount);
+    }
+
+    [m_pdfView setCurrentSelection:selection];
+    [m_pdfView scrollSelectionToVisible:nil];
+    page()-&gt;didFindString(string, matchCount);
+}
+
+void PDFViewController::countStringMatches(const String&amp; string, FindOptions options, unsigned maxMatchCount)
+{
+    BOOL caseFlag = !(options &amp; FindOptionsCaseInsensitive);
+
+    NSUInteger matchCount = [m_wkPDFView.get() _countMatches:string caseSensitive:caseFlag];
+    if (matchCount &gt; maxMatchCount)
+        matchCount = maxMatchCount;
+    page()-&gt;didCountStringMatches(string, matchCount);
+}
+
+} // namespace WebKit
</ins></span></pre></div>
<a id="trunkSourceWebKit2UIProcessmacPageClientImplhfromrev164600trunkSourceWebKit2UIProcessAPImacPageClientImplh"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebKit2/UIProcess/mac/PageClientImpl.h (from rev 164600, trunk/Source/WebKit2/UIProcess/API/mac/PageClientImpl.h) (0 => 164601)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/mac/PageClientImpl.h                                (rev 0)
+++ trunk/Source/WebKit2/UIProcess/mac/PageClientImpl.h        2014-02-24 20:53:02 UTC (rev 164601)
</span><span class="lines">@@ -0,0 +1,178 @@
</span><ins>+/*
+ * Copyright (C) 2010, 2011 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef PageClientImpl_h
+#define PageClientImpl_h
+
+#include &quot;CorrectionPanel.h&quot;
+#include &quot;PageClient.h&quot;
+#include &quot;WebFullScreenManagerProxy.h&quot;
+#include &lt;wtf/RetainPtr.h&gt;
+
+@class WKEditorUndoTargetObjC;
+@class WKView;
+
+namespace WebCore {
+class AlternativeTextUIController;
+}
+
+namespace WebKit {
+class FindIndicatorWindow;
+
+class PageClientImpl final : public PageClient
+#if ENABLE(FULLSCREEN_API)
+    , public WebFullScreenManagerProxyClient
+#endif
+    {
+public:
+    explicit PageClientImpl(WKView *);
+    virtual ~PageClientImpl();
+    
+    void viewWillMoveToAnotherWindow();
+
+private:
+    // PageClient
+    virtual std::unique_ptr&lt;DrawingAreaProxy&gt; createDrawingAreaProxy();
+    virtual void setViewNeedsDisplay(const WebCore::IntRect&amp;);
+    virtual void displayView();
+    virtual bool canScrollView();
+    virtual void scrollView(const WebCore::IntRect&amp; scrollRect, const WebCore::IntSize&amp; scrollOffset);
+
+    virtual WebCore::IntSize viewSize();
+    virtual bool isViewWindowActive();
+    virtual bool isViewFocused();
+    virtual bool isViewVisible();
+    virtual bool isViewVisibleOrOccluded();
+    virtual bool isViewInWindow();
+    virtual bool isVisuallyIdle();
+    virtual LayerHostingMode viewLayerHostingMode() override;
+    virtual ColorSpaceData colorSpace() override;
+    virtual void setAcceleratedCompositingRootLayer(CALayer *) override;
+    virtual CALayer *acceleratedCompositingRootLayer() const override;
+
+    virtual void processDidExit();
+    virtual void pageClosed();
+    virtual void didRelaunchProcess();
+    virtual void preferencesDidChange() override;
+    virtual void toolTipChanged(const String&amp; oldToolTip, const String&amp; newToolTip);
+    virtual void didCommitLoadForMainFrame() override;
+    virtual void setCursor(const WebCore::Cursor&amp;);
+    virtual void setCursorHiddenUntilMouseMoves(bool);
+    virtual void didChangeViewportProperties(const WebCore::ViewportAttributes&amp;);
+
+    virtual void registerEditCommand(PassRefPtr&lt;WebEditCommandProxy&gt;, WebPageProxy::UndoOrRedo);
+    virtual void clearAllEditCommands();
+    virtual bool canUndoRedo(WebPageProxy::UndoOrRedo);
+    virtual void executeUndoRedo(WebPageProxy::UndoOrRedo);
+    virtual bool interpretKeyEvent(const NativeWebKeyboardEvent&amp;, Vector&lt;WebCore::KeypressCommand&gt;&amp;);
+    virtual bool executeSavedCommandBySelector(const String&amp; selector);
+    virtual void setDragImage(const WebCore::IntPoint&amp; clientPosition, PassRefPtr&lt;ShareableBitmap&gt; dragImage, bool isLinkDrag);
+    virtual void setPromisedData(const String&amp; pasteboardName, PassRefPtr&lt;WebCore::SharedBuffer&gt; imageBuffer, const String&amp; filename, const String&amp; extension, const String&amp; title,
+        const String&amp; url, const String&amp; visibleUrl, PassRefPtr&lt;WebCore::SharedBuffer&gt; archiveBuffer);
+    virtual void updateSecureInputState() override;
+    virtual void resetSecureInputState() override;
+    virtual void notifyInputContextAboutDiscardedComposition() override;
+
+    virtual WebCore::FloatRect convertToDeviceSpace(const WebCore::FloatRect&amp;);
+    virtual WebCore::FloatRect convertToUserSpace(const WebCore::FloatRect&amp;);
+    virtual WebCore::IntPoint screenToRootView(const WebCore::IntPoint&amp;);
+    virtual WebCore::IntRect rootViewToScreen(const WebCore::IntRect&amp;);
+
+    virtual void doneWithKeyEvent(const NativeWebKeyboardEvent&amp;, bool wasEventHandled);
+
+    virtual PassRefPtr&lt;WebPopupMenuProxy&gt; createPopupMenuProxy(WebPageProxy*);
+    virtual PassRefPtr&lt;WebContextMenuProxy&gt; createContextMenuProxy(WebPageProxy*);
+
+#if ENABLE(INPUT_TYPE_COLOR)
+    virtual PassRefPtr&lt;WebColorPicker&gt; createColorPicker(WebPageProxy*, const WebCore::Color&amp; initialColor, const WebCore::IntRect&amp;);
+#endif
+
+    void setFindIndicator(PassRefPtr&lt;FindIndicator&gt;, bool fadeOut, bool animate);
+
+    virtual void enterAcceleratedCompositingMode(const LayerTreeContext&amp;);
+    virtual void exitAcceleratedCompositingMode();
+    virtual void updateAcceleratedCompositingMode(const LayerTreeContext&amp;);
+
+    virtual RetainPtr&lt;CGImageRef&gt; takeViewSnapshot() override;
+    virtual void wheelEventWasNotHandledByWebCore(const NativeWebWheelEvent&amp;) override;
+    virtual void clearCustomSwipeViews() override;
+
+    virtual void accessibilityWebProcessTokenReceived(const IPC::DataReference&amp;);
+
+    virtual void pluginFocusOrWindowFocusChanged(uint64_t pluginComplexTextInputIdentifier, bool pluginHasFocusAndWindowHasFocus);
+    virtual void setPluginComplexTextInputState(uint64_t pluginComplexTextInputIdentifier, PluginComplexTextInputState);
+
+    virtual void makeFirstResponder();
+    
+    virtual void didPerformDictionaryLookup(const AttributedString&amp;, const DictionaryPopupInfo&amp;);
+    virtual void dismissDictionaryLookupPanel();
+
+    virtual void showCorrectionPanel(WebCore::AlternativeTextType, const WebCore::FloatRect&amp; boundingBoxOfReplacedString, const String&amp; replacedString, const String&amp; replacementString, const Vector&lt;String&gt;&amp; alternativeReplacementStrings);
+    virtual void dismissCorrectionPanel(WebCore::ReasonForDismissingAlternativeText);
+    virtual String dismissCorrectionPanelSoon(WebCore::ReasonForDismissingAlternativeText);
+    virtual void recordAutocorrectionResponse(WebCore::AutocorrectionResponseType, const String&amp; replacedString, const String&amp; replacementString);
+
+    virtual void recommendedScrollbarStyleDidChange(int32_t newStyle);
+
+    virtual WKView* wkView() const { return m_wkView; }
+    virtual void intrinsicContentSizeDidChange(const WebCore::IntSize&amp; intrinsicContentSize) override;
+
+#if USE(DICTATION_ALTERNATIVES)
+    virtual uint64_t addDictationAlternatives(const RetainPtr&lt;NSTextAlternatives&gt;&amp;);
+    virtual void removeDictationAlternatives(uint64_t dictationContext);
+    virtual void showDictationAlternativeUI(const WebCore::FloatRect&amp; boundingBoxOfDictatedText, uint64_t dictationContext);
+    virtual Vector&lt;String&gt; dictationAlternatives(uint64_t dictationContext);
+#endif
+
+    // Auxiliary Client Creation
+#if ENABLE(FULLSCREEN_API)
+    WebFullScreenManagerProxyClient&amp; fullScreenManagerProxyClient() override;
+#endif
+
+#if ENABLE(FULLSCREEN_API)
+    // WebFullScreenManagerProxyClient
+    virtual void closeFullScreenManager() override;
+    virtual bool isFullScreen() override;
+    virtual void enterFullScreen() override;
+    virtual void exitFullScreen() override;
+    virtual void beganEnterFullScreen(const WebCore::IntRect&amp; initialFrame, const WebCore::IntRect&amp; finalFrame) override;
+    virtual void beganExitFullScreen(const WebCore::IntRect&amp; initialFrame, const WebCore::IntRect&amp; finalFrame) override;
+#endif
+
+    NSView *activeView() const;
+
+    WKView *m_wkView;
+    RetainPtr&lt;WKEditorUndoTargetObjC&gt; m_undoTarget;
+#if USE(AUTOCORRECTION_PANEL)
+    CorrectionPanel m_correctionPanel;
+#endif
+#if USE(DICTATION_ALTERNATIVES)
+    OwnPtr&lt;WebCore::AlternativeTextUIController&gt; m_alternativeTextUIController;
+#endif
+};
+
+} // namespace WebKit
+
+#endif // PageClientImpl_h
</ins></span></pre></div>
<a id="trunkSourceWebKit2UIProcessmacPageClientImplh"></a>
<div class="propset"><h4>Property changes: trunk/Source/WebKit2/UIProcess/mac/PageClientImpl.h</h4>
<pre class="diff"><span>
</span></pre></div>
<a id="svnkeywords"></a>
<div class="addfile"><h4>Added: svn:keywords</h4></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4>Added: svn:eol-style</h4></div>
<a id="trunkSourceWebKit2UIProcessmacPageClientImplmmfromrev164600trunkSourceWebKit2UIProcessAPImacPageClientImplmm"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebKit2/UIProcess/mac/PageClientImpl.mm (from rev 164600, trunk/Source/WebKit2/UIProcess/API/mac/PageClientImpl.mm) (0 => 164601)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/mac/PageClientImpl.mm                                (rev 0)
+++ trunk/Source/WebKit2/UIProcess/mac/PageClientImpl.mm        2014-02-24 20:53:02 UTC (rev 164601)
</span><span class="lines">@@ -0,0 +1,640 @@
</span><ins>+/*
+ * Copyright (C) 2010, 2011 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#import &quot;config.h&quot;
+#import &quot;PageClientImpl.h&quot;
+
+#import &quot;AttributedString.h&quot;
+#import &quot;ColorSpaceData.h&quot;
+#import &quot;DataReference.h&quot;
+#import &quot;DictionaryPopupInfo.h&quot;
+#import &quot;FindIndicator.h&quot;
+#import &quot;NativeWebKeyboardEvent.h&quot;
+#import &quot;NativeWebWheelEvent.h&quot;
+#import &quot;StringUtilities.h&quot;
+#import &quot;WKAPICast.h&quot;
+#import &quot;WKFullScreenWindowController.h&quot;
+#import &quot;WKStringCF.h&quot;
+#import &quot;WKThumbnailView.h&quot;
+#import &quot;WKViewInternal.h&quot;
+#import &quot;WebColorPickerMac.h&quot;
+#import &quot;WebContextMenuProxyMac.h&quot;
+#import &quot;WebEditCommandProxy.h&quot;
+#import &quot;WebPopupMenuProxyMac.h&quot;
+#import &quot;WindowServerConnection.h&quot;
+#import &lt;WebCore/AlternativeTextUIController.h&gt;
+#import &lt;WebCore/BitmapImage.h&gt;
+#import &lt;WebCore/Cursor.h&gt;
+#import &lt;WebCore/FloatRect.h&gt;
+#import &lt;WebCore/GraphicsContext.h&gt;
+#import &lt;WebCore/Image.h&gt;
+#import &lt;WebCore/KeyboardEvent.h&gt;
+#import &lt;WebCore/NotImplemented.h&gt;
+#import &lt;WebCore/SharedBuffer.h&gt;
+#import &lt;WebKitSystemInterface.h&gt;
+#import &lt;wtf/text/CString.h&gt;
+#import &lt;wtf/text/WTFString.h&gt;
+
+#if USE(DICTATION_ALTERNATIVES)
+#import &lt;AppKit/NSTextAlternatives.h&gt;
+#endif
+
+@interface NSApplication (WebNSApplicationDetails)
+- (NSCursor *)_cursorRectCursor;
+@end
+
+#if HAVE(OUT_OF_PROCESS_LAYER_HOSTING)
+@interface NSWindow (WebNSWindowDetails)
+- (BOOL)_hostsLayersInWindowServer;
+@end
+#endif
+
+using namespace WebCore;
+using namespace WebKit;
+
+@interface WKEditCommandObjC : NSObject
+{
+    RefPtr&lt;WebEditCommandProxy&gt; m_command;
+}
+- (id)initWithWebEditCommandProxy:(PassRefPtr&lt;WebEditCommandProxy&gt;)command;
+- (WebEditCommandProxy*)command;
+@end
+
+@interface WKEditorUndoTargetObjC : NSObject
+- (void)undoEditing:(id)sender;
+- (void)redoEditing:(id)sender;
+@end
+
+@implementation WKEditCommandObjC
+
+- (id)initWithWebEditCommandProxy:(PassRefPtr&lt;WebEditCommandProxy&gt;)command
+{
+    self = [super init];
+    if (!self)
+        return nil;
+
+    m_command = command;
+    return self;
+}
+
+- (WebEditCommandProxy*)command
+{
+    return m_command.get();
+}
+
+@end
+
+@implementation WKEditorUndoTargetObjC
+
+- (void)undoEditing:(id)sender
+{
+    ASSERT([sender isKindOfClass:[WKEditCommandObjC class]]);
+    [sender command]-&gt;unapply();
+}
+
+- (void)redoEditing:(id)sender
+{
+    ASSERT([sender isKindOfClass:[WKEditCommandObjC class]]);
+    [sender command]-&gt;reapply();
+}
+
+@end
+
+namespace WebKit {
+
+PageClientImpl::PageClientImpl(WKView* wkView)
+    : m_wkView(wkView)
+    , m_undoTarget(adoptNS([[WKEditorUndoTargetObjC alloc] init]))
+#if USE(DICTATION_ALTERNATIVES)
+    , m_alternativeTextUIController(adoptPtr(new AlternativeTextUIController))
+#endif
+{
+}
+
+PageClientImpl::~PageClientImpl()
+{
+}
+
+std::unique_ptr&lt;DrawingAreaProxy&gt; PageClientImpl::createDrawingAreaProxy()
+{
+    return [m_wkView _createDrawingAreaProxy];
+}
+
+void PageClientImpl::setViewNeedsDisplay(const WebCore::IntRect&amp; rect)
+{
+    ASSERT_NOT_REACHED();
+}
+
+void PageClientImpl::displayView()
+{
+    ASSERT_NOT_REACHED();
+}
+
+bool PageClientImpl::canScrollView()
+{
+    return false;
+}
+
+void PageClientImpl::scrollView(const IntRect&amp; scrollRect, const IntSize&amp; scrollOffset)
+{
+    ASSERT_NOT_REACHED();
+}
+
+IntSize PageClientImpl::viewSize()
+{
+    return IntSize([m_wkView bounds].size);
+}
+
+NSView *PageClientImpl::activeView() const
+{
+#if WK_API_ENABLED
+    return m_wkView._thumbnailView ? (NSView *)m_wkView._thumbnailView : (NSView *)m_wkView;
+#else
+    return m_wkView;
+#endif
+}
+
+bool PageClientImpl::isViewWindowActive()
+{
+    NSWindow *activeViewWindow = activeView().window;
+    return activeViewWindow.isKeyWindow || [NSApp keyWindow] == activeViewWindow;
+}
+
+bool PageClientImpl::isViewFocused()
+{
+    return [m_wkView _isFocused];
+}
+
+void PageClientImpl::makeFirstResponder()
+{
+     [[m_wkView window] makeFirstResponder:m_wkView];
+}
+    
+bool PageClientImpl::isViewVisible()
+{
+    NSView *activeView = this-&gt;activeView();
+    NSWindow *activeViewWindow = activeView.window;
+
+    if (!activeViewWindow)
+        return false;
+
+    if (!activeViewWindow.isVisible)
+        return false;
+
+#if __MAC_OS_X_VERSION_MIN_REQUIRED &lt;= 1080
+    // Mountain Lion and previous do not support occlusion notifications, and as such will
+    // continue to report as &quot;visible&quot; when not on the active space.
+    if (!activeViewWindow.isOnActiveSpace)
+        return false;
+#endif
+
+    if (activeView.isHiddenOrHasHiddenAncestor)
+        return false;
+
+#if __MAC_OS_X_VERSION_MIN_REQUIRED &gt;= 1090
+    if ([m_wkView windowOcclusionDetectionEnabled] &amp;&amp; (activeViewWindow.occlusionState &amp; NSWindowOcclusionStateVisible) != NSWindowOcclusionStateVisible)
+        return false;
+#endif
+
+    return true;
+}
+
+bool PageClientImpl::isViewVisibleOrOccluded()
+{
+    return activeView().window.isVisible;
+}
+
+bool PageClientImpl::isViewInWindow()
+{
+    return activeView().window;
+}
+
+bool PageClientImpl::isVisuallyIdle()
+{
+    return WindowServerConnection::shared().applicationWindowModificationsHaveStopped() || !isViewVisible();
+}
+
+LayerHostingMode PageClientImpl::viewLayerHostingMode()
+{
+#if HAVE(OUT_OF_PROCESS_LAYER_HOSTING)
+    if ([activeView().window _hostsLayersInWindowServer])
+        return LayerHostingMode::OutOfProcess;
+#endif
+    return LayerHostingMode::InProcess;
+}
+
+void PageClientImpl::viewWillMoveToAnotherWindow()
+{
+    clearAllEditCommands();
+}
+
+ColorSpaceData PageClientImpl::colorSpace()
+{
+    return [m_wkView _colorSpace];
+}
+
+void PageClientImpl::processDidExit()
+{
+    [m_wkView _processDidExit];
+}
+
+void PageClientImpl::pageClosed()
+{
+    [m_wkView _pageClosed];
+#if USE(DICTATION_ALTERNATIVES)
+    m_alternativeTextUIController-&gt;clear();
+#endif
+}
+
+void PageClientImpl::didRelaunchProcess()
+{
+    [m_wkView _didRelaunchProcess];
+}
+
+void PageClientImpl::preferencesDidChange()
+{
+    [m_wkView _preferencesDidChange];
+}
+
+void PageClientImpl::toolTipChanged(const String&amp; oldToolTip, const String&amp; newToolTip)
+{
+    [m_wkView _toolTipChangedFrom:nsStringFromWebCoreString(oldToolTip) to:nsStringFromWebCoreString(newToolTip)];
+}
+
+void PageClientImpl::didCommitLoadForMainFrame()
+{
+}
+
+void PageClientImpl::setCursor(const WebCore::Cursor&amp; cursor)
+{
+    if (![NSApp _cursorRectCursor])
+        [m_wkView _setCursor:cursor.platformCursor()];
+}
+
+void PageClientImpl::setCursorHiddenUntilMouseMoves(bool hiddenUntilMouseMoves)
+{
+    [NSCursor setHiddenUntilMouseMoves:hiddenUntilMouseMoves];
+}
+
+void PageClientImpl::didChangeViewportProperties(const WebCore::ViewportAttributes&amp;)
+{
+}
+
+void PageClientImpl::registerEditCommand(PassRefPtr&lt;WebEditCommandProxy&gt; prpCommand, WebPageProxy::UndoOrRedo undoOrRedo)
+{
+    RefPtr&lt;WebEditCommandProxy&gt; command = prpCommand;
+
+    RetainPtr&lt;WKEditCommandObjC&gt; commandObjC = adoptNS([[WKEditCommandObjC alloc] initWithWebEditCommandProxy:command]);
+    String actionName = WebEditCommandProxy::nameForEditAction(command-&gt;editAction());
+
+    NSUndoManager *undoManager = [m_wkView undoManager];
+    [undoManager registerUndoWithTarget:m_undoTarget.get() selector:((undoOrRedo == WebPageProxy::Undo) ? @selector(undoEditing:) : @selector(redoEditing:)) object:commandObjC.get()];
+    if (!actionName.isEmpty())
+        [undoManager setActionName:(NSString *)actionName];
+}
+
+void PageClientImpl::clearAllEditCommands()
+{
+    [[m_wkView undoManager] removeAllActionsWithTarget:m_undoTarget.get()];
+}
+
+bool PageClientImpl::canUndoRedo(WebPageProxy::UndoOrRedo undoOrRedo)
+{
+    return (undoOrRedo == WebPageProxy::Undo) ? [[m_wkView undoManager] canUndo] : [[m_wkView undoManager] canRedo];
+}
+
+void PageClientImpl::executeUndoRedo(WebPageProxy::UndoOrRedo undoOrRedo)
+{
+    return (undoOrRedo == WebPageProxy::Undo) ? [[m_wkView undoManager] undo] : [[m_wkView undoManager] redo];
+}
+
+bool PageClientImpl::interpretKeyEvent(const NativeWebKeyboardEvent&amp; event, Vector&lt;WebCore::KeypressCommand&gt;&amp; commands)
+{
+    return [m_wkView _interpretKeyEvent:event.nativeEvent() savingCommandsTo:commands];
+}
+
+void PageClientImpl::setDragImage(const IntPoint&amp; clientPosition, PassRefPtr&lt;ShareableBitmap&gt; dragImage, bool isLinkDrag)
+{
+    RetainPtr&lt;CGImageRef&gt; dragCGImage = dragImage-&gt;makeCGImage();
+    RetainPtr&lt;NSImage&gt; dragNSImage = adoptNS([[NSImage alloc] initWithCGImage:dragCGImage.get() size:dragImage-&gt;size()]);
+
+    [m_wkView _setDragImage:dragNSImage.get() at:clientPosition linkDrag:isLinkDrag];
+}
+
+void PageClientImpl::setPromisedData(const String&amp; pasteboardName, PassRefPtr&lt;SharedBuffer&gt; imageBuffer, const String&amp; filename, const String&amp; extension, const String&amp; title, const String&amp; url, const String&amp; visibleUrl, PassRefPtr&lt;SharedBuffer&gt; archiveBuffer)
+{
+    RefPtr&lt;Image&gt; image = BitmapImage::create();
+    image-&gt;setData(imageBuffer.get(), true);
+    [m_wkView _setPromisedData:image.get() withFileName:filename withExtension:extension withTitle:title withURL:url withVisibleURL:visibleUrl withArchive:archiveBuffer.get() forPasteboard:pasteboardName];
+}
+
+void PageClientImpl::updateSecureInputState()
+{
+    [m_wkView _updateSecureInputState];
+}
+
+void PageClientImpl::resetSecureInputState()
+{
+    [m_wkView _resetSecureInputState];
+}
+
+void PageClientImpl::notifyInputContextAboutDiscardedComposition()
+{
+    [m_wkView _notifyInputContextAboutDiscardedComposition];
+}
+
+FloatRect PageClientImpl::convertToDeviceSpace(const FloatRect&amp; rect)
+{
+    return [m_wkView _convertToDeviceSpace:rect];
+}
+
+FloatRect PageClientImpl::convertToUserSpace(const FloatRect&amp; rect)
+{
+    return [m_wkView _convertToUserSpace:rect];
+}
+   
+IntPoint PageClientImpl::screenToRootView(const IntPoint&amp; point)
+{
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored &quot;-Wdeprecated-declarations&quot;
+    NSPoint windowCoord = [[m_wkView window] convertScreenToBase:point];
+#pragma clang diagnostic pop
+    return IntPoint([m_wkView convertPoint:windowCoord fromView:nil]);
+}
+    
+IntRect PageClientImpl::rootViewToScreen(const IntRect&amp; rect)
+{
+    NSRect tempRect = rect;
+    tempRect = [m_wkView convertRect:tempRect toView:nil];
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored &quot;-Wdeprecated-declarations&quot;
+    tempRect.origin = [[m_wkView window] convertBaseToScreen:tempRect.origin];
+#pragma clang diagnostic pop
+    return enclosingIntRect(tempRect);
+}
+
+void PageClientImpl::doneWithKeyEvent(const NativeWebKeyboardEvent&amp; event, bool eventWasHandled)
+{
+    [m_wkView _doneWithKeyEvent:event.nativeEvent() eventWasHandled:eventWasHandled];
+}
+
+PassRefPtr&lt;WebPopupMenuProxy&gt; PageClientImpl::createPopupMenuProxy(WebPageProxy* page)
+{
+    return WebPopupMenuProxyMac::create(m_wkView, page);
+}
+
+PassRefPtr&lt;WebContextMenuProxy&gt; PageClientImpl::createContextMenuProxy(WebPageProxy* page)
+{
+    return WebContextMenuProxyMac::create(m_wkView, page);
+}
+
+#if ENABLE(INPUT_TYPE_COLOR)
+PassRefPtr&lt;WebColorPicker&gt; PageClientImpl::createColorPicker(WebPageProxy* page, const WebCore::Color&amp; initialColor,  const WebCore::IntRect&amp; rect)
+{
+    return WebColorPickerMac::create(page, initialColor, rect, wkView());
+}
+#endif
+
+void PageClientImpl::setFindIndicator(PassRefPtr&lt;FindIndicator&gt; findIndicator, bool fadeOut, bool animate)
+{
+    [m_wkView _setFindIndicator:findIndicator fadeOut:fadeOut animate:animate];
+}
+
+void PageClientImpl::accessibilityWebProcessTokenReceived(const IPC::DataReference&amp; data)
+{
+    NSData* remoteToken = [NSData dataWithBytes:data.data() length:data.size()];
+    [m_wkView _setAccessibilityWebProcessToken:remoteToken];
+}
+    
+void PageClientImpl::enterAcceleratedCompositingMode(const LayerTreeContext&amp; layerTreeContext)
+{
+    ASSERT(!layerTreeContext.isEmpty());
+
+    CALayer *renderLayer = WKMakeRenderLayer(layerTreeContext.contextID);
+    [m_wkView _setAcceleratedCompositingModeRootLayer:renderLayer];
+}
+
+void PageClientImpl::exitAcceleratedCompositingMode()
+{
+    [m_wkView _setAcceleratedCompositingModeRootLayer:nil];
+}
+
+void PageClientImpl::updateAcceleratedCompositingMode(const LayerTreeContext&amp; layerTreeContext)
+{
+    ASSERT(!layerTreeContext.isEmpty());
+
+    CALayer *renderLayer = WKMakeRenderLayer(layerTreeContext.contextID);
+    [m_wkView _setAcceleratedCompositingModeRootLayer:renderLayer];
+}
+
+void PageClientImpl::setAcceleratedCompositingRootLayer(CALayer *rootLayer)
+{
+    [m_wkView _setAcceleratedCompositingModeRootLayer:rootLayer];
+}
+
+CALayer *PageClientImpl::acceleratedCompositingRootLayer() const
+{
+    return m_wkView._acceleratedCompositingModeRootLayer;
+}
+
+RetainPtr&lt;CGImageRef&gt; PageClientImpl::takeViewSnapshot()
+{
+    return [m_wkView _takeViewSnapshot];
+}
+
+void PageClientImpl::wheelEventWasNotHandledByWebCore(const NativeWebWheelEvent&amp; event)
+{
+    [m_wkView _wheelEventWasNotHandledByWebCore:event.nativeEvent()];
+}
+
+void PageClientImpl::pluginFocusOrWindowFocusChanged(uint64_t pluginComplexTextInputIdentifier, bool pluginHasFocusAndWindowHasFocus)
+{
+    [m_wkView _pluginFocusOrWindowFocusChanged:pluginHasFocusAndWindowHasFocus pluginComplexTextInputIdentifier:pluginComplexTextInputIdentifier];
+}
+
+void PageClientImpl::setPluginComplexTextInputState(uint64_t pluginComplexTextInputIdentifier, PluginComplexTextInputState pluginComplexTextInputState)
+{
+    [m_wkView _setPluginComplexTextInputState:pluginComplexTextInputState pluginComplexTextInputIdentifier:pluginComplexTextInputIdentifier];
+}
+
+void PageClientImpl::didPerformDictionaryLookup(const AttributedString&amp; text, const DictionaryPopupInfo&amp; dictionaryPopupInfo)
+{
+    RetainPtr&lt;NSAttributedString&gt; attributedString = text.string;
+    NSPoint textBaselineOrigin = dictionaryPopupInfo.origin;
+
+    // Convert to screen coordinates.
+    textBaselineOrigin = [m_wkView convertPoint:textBaselineOrigin toView:nil];
+    textBaselineOrigin = [m_wkView.window convertRectToScreen:NSMakeRect(textBaselineOrigin.x, textBaselineOrigin.y, 0, 0)].origin;
+
+    WKShowWordDefinitionWindow(attributedString.get(), textBaselineOrigin, (NSDictionary *)dictionaryPopupInfo.options.get());
+}
+
+void PageClientImpl::dismissDictionaryLookupPanel()
+{
+    // FIXME: We don't know which panel we are dismissing, it may not even be in the current page (see &lt;rdar://problem/13875766&gt;).
+    WKHideWordDefinitionWindow();
+}
+
+void PageClientImpl::showCorrectionPanel(AlternativeTextType type, const FloatRect&amp; boundingBoxOfReplacedString, const String&amp; replacedString, const String&amp; replacementString, const Vector&lt;String&gt;&amp; alternativeReplacementStrings)
+{
+#if USE(AUTOCORRECTION_PANEL)
+    if (!isViewVisible() || !isViewInWindow())
+        return;
+    m_correctionPanel.show(m_wkView, type, boundingBoxOfReplacedString, replacedString, replacementString, alternativeReplacementStrings);
+#endif
+}
+
+void PageClientImpl::dismissCorrectionPanel(ReasonForDismissingAlternativeText reason)
+{
+#if USE(AUTOCORRECTION_PANEL)
+    m_correctionPanel.dismiss(reason);
+#endif
+}
+
+String PageClientImpl::dismissCorrectionPanelSoon(WebCore::ReasonForDismissingAlternativeText reason)
+{
+#if USE(AUTOCORRECTION_PANEL)
+    return m_correctionPanel.dismiss(reason);
+#else
+    return String();
+#endif
+}
+
+void PageClientImpl::recordAutocorrectionResponse(AutocorrectionResponseType responseType, const String&amp; replacedString, const String&amp; replacementString)
+{
+    NSCorrectionResponse response = responseType == AutocorrectionReverted ? NSCorrectionResponseReverted : NSCorrectionResponseEdited;
+    CorrectionPanel::recordAutocorrectionResponse(m_wkView, response, replacedString, replacementString);
+}
+
+void PageClientImpl::recommendedScrollbarStyleDidChange(int32_t newStyle)
+{
+    NSArray *trackingAreas = [m_wkView trackingAreas];
+    NSUInteger count = [trackingAreas count];
+    ASSERT(count == 1);
+    
+    for (NSUInteger i = 0; i &lt; count; ++i)
+        [m_wkView removeTrackingArea:[trackingAreas objectAtIndex:i]];
+
+    // Now re-create a tracking area with the appropriate options given the new scrollbar style
+    NSTrackingAreaOptions options = NSTrackingMouseMoved | NSTrackingMouseEnteredAndExited | NSTrackingInVisibleRect;
+    if (newStyle == NSScrollerStyleLegacy)
+        options |= NSTrackingActiveAlways;
+    else
+        options |= NSTrackingActiveInKeyWindow;
+
+    NSTrackingArea *trackingArea = [[NSTrackingArea alloc] initWithRect:[m_wkView frame]
+                                                                options:options
+                                                                  owner:m_wkView
+                                                               userInfo:nil];
+    [m_wkView addTrackingArea:trackingArea];
+    [trackingArea release];
+}
+
+void PageClientImpl::intrinsicContentSizeDidChange(const IntSize&amp; intrinsicContentSize)
+{
+    [m_wkView _setIntrinsicContentSize:intrinsicContentSize];
+}
+
+bool PageClientImpl::executeSavedCommandBySelector(const String&amp; selectorString)
+{
+    return [m_wkView _executeSavedCommandBySelector:NSSelectorFromString(selectorString)];
+}
+
+void PageClientImpl::clearCustomSwipeViews()
+{
+    return [m_wkView _setCustomSwipeViews:@[]];
+}
+
+#if USE(DICTATION_ALTERNATIVES)
+uint64_t PageClientImpl::addDictationAlternatives(const RetainPtr&lt;NSTextAlternatives&gt;&amp; alternatives)
+{
+    return m_alternativeTextUIController-&gt;addAlternatives(alternatives);
+}
+
+void PageClientImpl::removeDictationAlternatives(uint64_t dictationContext)
+{
+    m_alternativeTextUIController-&gt;removeAlternatives(dictationContext);
+}
+
+void PageClientImpl::showDictationAlternativeUI(const WebCore::FloatRect&amp; boundingBoxOfDictatedText, uint64_t dictationContext)
+{
+    if (!isViewVisible() || !isViewInWindow())
+        return;
+    m_alternativeTextUIController-&gt;showAlternatives(m_wkView, boundingBoxOfDictatedText, dictationContext, ^(NSString* acceptedAlternative){
+        [m_wkView handleAcceptedAlternativeText:acceptedAlternative];
+    });
+}
+
+Vector&lt;String&gt; PageClientImpl::dictationAlternatives(uint64_t dictationContext)
+{
+    return m_alternativeTextUIController-&gt;alternativesForContext(dictationContext);
+}
+#endif
+
+#if ENABLE(FULLSCREEN_API)
+
+WebFullScreenManagerProxyClient&amp; PageClientImpl::fullScreenManagerProxyClient()
+{
+    return *this;
+}
+
+// WebFullScreenManagerProxyClient
+
+void PageClientImpl::closeFullScreenManager()
+{
+    [m_wkView _closeFullScreenWindowController];
+}
+
+bool PageClientImpl::isFullScreen()
+{
+    if (!m_wkView._hasFullScreenWindowController)
+        return false;
+
+    return m_wkView._fullScreenWindowController.isFullScreen;
+}
+
+void PageClientImpl::enterFullScreen()
+{
+    [m_wkView._fullScreenWindowController enterFullScreen:nil];
+}
+
+void PageClientImpl::exitFullScreen()
+{
+    [m_wkView._fullScreenWindowController exitFullScreen];
+}
+
+void PageClientImpl::beganEnterFullScreen(const IntRect&amp; initialFrame, const IntRect&amp; finalFrame)
+{
+    [m_wkView._fullScreenWindowController beganEnterFullScreenWithInitialFrame:initialFrame finalFrame:finalFrame];
+}
+
+void PageClientImpl::beganExitFullScreen(const IntRect&amp; initialFrame, const IntRect&amp; finalFrame)
+{
+    [m_wkView._fullScreenWindowController beganExitFullScreenWithInitialFrame:initialFrame finalFrame:finalFrame];
+}
+
+#endif // ENABLE(FULLSCREEN_API)
+
+} // namespace WebKit
</ins></span></pre></div>
<a id="trunkSourceWebKit2UIProcessmacWKPrintingViewhfromrev164600trunkSourceWebKit2UIProcessAPImacWKPrintingViewh"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebKit2/UIProcess/mac/WKPrintingView.h (from rev 164600, trunk/Source/WebKit2/UIProcess/API/mac/WKPrintingView.h) (0 => 164601)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/mac/WKPrintingView.h                                (rev 0)
+++ trunk/Source/WebKit2/UIProcess/mac/WKPrintingView.h        2014-02-24 20:53:02 UTC (rev 164601)
</span><span class="lines">@@ -0,0 +1,65 @@
</span><ins>+/*
+ * Copyright (C) 2011 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#import &lt;WebCore/IntRectHash.h&gt;
+#import &lt;condition_variable&gt;
+#import &lt;wtf/RetainPtr.h&gt;
+
+@class WKPrintingViewData;
+@class PDFDocument;
+
+namespace WebKit {
+class ShareableBitmap;
+class WebFrameProxy;
+}
+
+@interface WKPrintingView : NSView {
+@public
+    NSPrintOperation *_printOperation; // WKPrintingView is owned by the operation.
+    RetainPtr&lt;NSView&gt; _wkView;
+
+    RefPtr&lt;WebKit::WebFrameProxy&gt; _webFrame;
+    Vector&lt;WebCore::IntRect&gt; _printingPageRects;
+    double _totalScaleFactorForPrinting;
+    HashMap&lt;WebCore::IntRect, RefPtr&lt;WebKit::ShareableBitmap&gt;&gt; _pagePreviews;
+
+    Vector&lt;uint8_t&gt; _printedPagesData;
+    RetainPtr&lt;PDFDocument&gt; _printedPagesPDFDocument;
+
+    uint64_t _expectedComputedPagesCallback;
+    HashMap&lt;uint64_t, WebCore::IntRect&gt; _expectedPreviewCallbacks;
+    uint64_t _latestExpectedPreviewCallback;
+    uint64_t _expectedPrintCallback;
+
+    BOOL _isPrintingFromSecondaryThread;
+    std::mutex _printingCallbackMutex;
+    std::condition_variable _printingCallbackCondition;
+
+    NSTimer *_autodisplayResumeTimer;
+}
+
+- (id)initWithFrameProxy:(WebKit::WebFrameProxy*)frame view:(NSView *)wkView;
+
+@end
</ins></span></pre></div>
<a id="trunkSourceWebKit2UIProcessmacWKPrintingViewh"></a>
<div class="propset"><h4>Property changes: trunk/Source/WebKit2/UIProcess/mac/WKPrintingView.h</h4>
<pre class="diff"><span>
</span></pre></div>
<a id="svnkeywords"></a>
<div class="addfile"><h4>Added: svn:keywords</h4></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4>Added: svn:eol-style</h4></div>
<a id="trunkSourceWebKit2UIProcessmacWKPrintingViewmmfromrev164600trunkSourceWebKit2UIProcessAPImacWKPrintingViewmm"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebKit2/UIProcess/mac/WKPrintingView.mm (from rev 164600, trunk/Source/WebKit2/UIProcess/API/mac/WKPrintingView.mm) (0 => 164601)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/mac/WKPrintingView.mm                                (rev 0)
+++ trunk/Source/WebKit2/UIProcess/mac/WKPrintingView.mm        2014-02-24 20:53:02 UTC (rev 164601)
</span><span class="lines">@@ -0,0 +1,677 @@
</span><ins>+/*
+ * Copyright (C) 2011 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#import &quot;config.h&quot;
+#import &quot;WKPrintingView.h&quot;
+
+#import &quot;APIData.h&quot;
+#import &quot;Logging.h&quot;
+#import &quot;PDFKitImports.h&quot;
+#import &quot;PrintInfo.h&quot;
+#import &quot;ShareableBitmap.h&quot;
+#import &quot;WebPageProxy.h&quot;
+#import &lt;PDFKit/PDFKit.h&gt;
+#import &lt;WebCore/GraphicsContext.h&gt;
+#import &lt;WebCore/WebCoreObjCExtras.h&gt;
+#import &lt;wtf/RunLoop.h&gt;
+
+using namespace WebKit;
+using namespace WebCore;
+
+NSString * const WebKitOriginalTopPrintingMarginKey = @&quot;WebKitOriginalTopMargin&quot;;
+NSString * const WebKitOriginalBottomPrintingMarginKey = @&quot;WebKitOriginalBottomMargin&quot;;
+
+NSString * const NSPrintInfoDidChangeNotification = @&quot;NSPrintInfoDidChange&quot;;
+
+static BOOL isForcingPreviewUpdate;
+
+@implementation WKPrintingView
+
+- (id)initWithFrameProxy:(WebKit::WebFrameProxy*)frame view:(NSView *)wkView
+{
+    self = [super init]; // No frame rect to pass to NSView.
+    if (!self)
+        return nil;
+
+    _webFrame = frame;
+    _wkView = wkView;
+
+    return self;
+}
+
+- (void)dealloc
+{
+    if (WebCoreObjCScheduleDeallocateOnMainThread([WKPrintingView class], self))
+        return;
+
+    [super dealloc];
+}
+
+- (BOOL)isFlipped
+{
+    return YES;
+}
+
+- (void)_setAutodisplay:(BOOL)newState
+{
+    if (!newState &amp;&amp; [[_wkView window] isAutodisplay])
+        [_wkView displayIfNeeded];
+    
+    [[_wkView window] setAutodisplay:newState];
+
+    // For some reason, painting doesn't happen for a long time without this call, &lt;rdar://problem/8975229&gt;.
+    if (newState)
+        [_wkView displayIfNeeded];
+}
+
+
+- (void)_suspendAutodisplay
+{
+    // A drawRect: call on WKView causes a switch to screen mode, which is slow due to relayout, and we want to avoid that.
+    // Disabling autodisplay will prevent random updates from causing this, but resizing the window will still work.
+    if (_autodisplayResumeTimer) {
+        [_autodisplayResumeTimer invalidate];
+        _autodisplayResumeTimer = nil;
+    } else
+        [self _setAutodisplay:NO];
+}
+
+- (void)_delayedResumeAutodisplayTimerFired
+{
+    ASSERT(RunLoop::isMain());
+    
+    _autodisplayResumeTimer = nil;
+    [self _setAutodisplay:YES];
+
+    // Enabling autodisplay normally implicitly calls endPrinting() via -[WKView drawRect:], but not when content is in accelerated compositing mode.
+    if (_webFrame-&gt;page())
+        _webFrame-&gt;page()-&gt;endPrinting();
+}
+
+- (void)_delayedResumeAutodisplay
+{
+    // AppKit calls endDocument/beginDocument when print option change. We don't want to switch between print and screen mode just for that,
+    // and enabling autodisplay may result in switching into screen mode. So, autodisplay is only resumed on next run loop iteration.
+    if (!_autodisplayResumeTimer) {
+        _autodisplayResumeTimer = [NSTimer timerWithTimeInterval:0 target:self selector:@selector(_delayedResumeAutodisplayTimerFired) userInfo:nil repeats:NO];
+        // The timer must be scheduled on main thread, because printing thread may finish before it fires.
+        [[NSRunLoop mainRunLoop] addTimer:_autodisplayResumeTimer forMode:NSDefaultRunLoopMode];
+    }
+}
+
+- (void)_adjustPrintingMarginsForHeaderAndFooter
+{
+    ASSERT(RunLoop::isMain()); // This function calls the client, which should only be done on main thread.
+
+    NSPrintInfo *info = [_printOperation printInfo];
+    NSMutableDictionary *infoDictionary = [info dictionary];
+
+    // We need to modify the top and bottom margins in the NSPrintInfo to account for the space needed by the
+    // header and footer. Because this method can be called more than once on the same NSPrintInfo (see 5038087),
+    // we stash away the unmodified top and bottom margins the first time this method is called, and we read from
+    // those stashed-away values on subsequent calls.
+    double originalTopMargin;
+    double originalBottomMargin;
+    NSNumber *originalTopMarginNumber = [infoDictionary objectForKey:WebKitOriginalTopPrintingMarginKey];
+    if (!originalTopMarginNumber) {
+        ASSERT(![infoDictionary objectForKey:WebKitOriginalBottomPrintingMarginKey]);
+        originalTopMargin = [info topMargin];
+        originalBottomMargin = [info bottomMargin];
+        [infoDictionary setObject:[NSNumber numberWithDouble:originalTopMargin] forKey:WebKitOriginalTopPrintingMarginKey];
+        [infoDictionary setObject:[NSNumber numberWithDouble:originalBottomMargin] forKey:WebKitOriginalBottomPrintingMarginKey];
+    } else {
+        ASSERT([originalTopMarginNumber isKindOfClass:[NSNumber class]]);
+        ASSERT([[infoDictionary objectForKey:WebKitOriginalBottomPrintingMarginKey] isKindOfClass:[NSNumber class]]);
+        originalTopMargin = [originalTopMarginNumber doubleValue];
+        originalBottomMargin = [[infoDictionary objectForKey:WebKitOriginalBottomPrintingMarginKey] doubleValue];
+    }
+    
+    CGFloat scale = [info scalingFactor];
+    [info setTopMargin:originalTopMargin + _webFrame-&gt;page()-&gt;headerHeight(_webFrame.get()) * scale];
+    [info setBottomMargin:originalBottomMargin + _webFrame-&gt;page()-&gt;footerHeight(_webFrame.get()) * scale];
+}
+
+- (BOOL)_isPrintingPreview
+{
+    // &lt;rdar://problem/8901041&gt; Please add an API returning whether the current print operation is for preview.
+    // Assuming that if NSPrintOperation is allowed to spawn a thread for printing, it will. Print preview doesn't spawn a thread.
+    return !_isPrintingFromSecondaryThread;
+}
+
+- (void)_updatePreview
+{
+    // &lt;rdar://problem/8900923&gt; Please add an API to force print preview update.
+    ASSERT(!isForcingPreviewUpdate);
+    isForcingPreviewUpdate = YES;
+    [[NSNotificationCenter defaultCenter] postNotificationName:NSPrintInfoDidChangeNotification object:nil];
+    isForcingPreviewUpdate = NO;
+}
+
+- (BOOL)_hasPageRects
+{
+    // WebCore always prints at least one page.
+    return !_printingPageRects.isEmpty();
+}
+
+- (NSUInteger)_firstPrintedPageNumber
+{
+    // Need to directly access the dictionary because -[NSPrintOperation pageRange] verifies pagination, potentially causing recursion.
+    return [[[[_printOperation printInfo] dictionary] objectForKey:NSPrintFirstPage] unsignedIntegerValue];
+}
+
+- (NSUInteger)_lastPrintedPageNumber
+{
+    ASSERT([self _hasPageRects]);
+
+    // Need to directly access the dictionary because -[NSPrintOperation pageRange] verifies pagination, potentially causing recursion.
+    NSUInteger firstPage = [[[[_printOperation printInfo] dictionary] objectForKey:NSPrintFirstPage] unsignedIntegerValue];
+    NSUInteger lastPage = [[[[_printOperation printInfo] dictionary] objectForKey:NSPrintLastPage] unsignedIntegerValue];
+    if (lastPage - firstPage &gt;= _printingPageRects.size())
+        return _printingPageRects.size();
+    return lastPage;
+}
+
+- (uint64_t)_expectedPreviewCallbackForRect:(const IntRect&amp;)rect
+{
+    for (HashMap&lt;uint64_t, WebCore::IntRect&gt;::iterator iter = _expectedPreviewCallbacks.begin(); iter != _expectedPreviewCallbacks.end(); ++iter) {
+        if (iter-&gt;value  == rect)
+            return iter-&gt;key;
+    }
+    return 0;
+}
+
+struct IPCCallbackContext {
+    RetainPtr&lt;WKPrintingView&gt; view;
+    uint64_t callbackID;
+};
+
+static void pageDidDrawToImage(const ShareableBitmap::Handle&amp; imageHandle, IPCCallbackContext* context)
+{
+    ASSERT(RunLoop::isMain());
+
+    WKPrintingView *view = context-&gt;view.get();
+
+    // If the user has already changed print setup, then this response is obsolete. And if this callback is not in response to the latest request,
+    // then the user has already moved to another page - we'll cache the response, but won't draw it.
+    HashMap&lt;uint64_t, WebCore::IntRect&gt;::iterator iter = view-&gt;_expectedPreviewCallbacks.find(context-&gt;callbackID);
+    if (iter != view-&gt;_expectedPreviewCallbacks.end()) {
+        ASSERT([view _isPrintingPreview]);
+
+        if (!imageHandle.isNull()) {
+            RefPtr&lt;ShareableBitmap&gt; image = ShareableBitmap::create(imageHandle, SharedMemory::ReadOnly);
+
+            if (image)
+                view-&gt;_pagePreviews.add(iter-&gt;value, image);
+        }
+
+        view-&gt;_expectedPreviewCallbacks.remove(context-&gt;callbackID);
+        bool receivedResponseToLatestRequest = view-&gt;_latestExpectedPreviewCallback == context-&gt;callbackID;
+        if (receivedResponseToLatestRequest) {
+            view-&gt;_latestExpectedPreviewCallback = 0;
+            [view _updatePreview];
+        }
+    }
+}
+
+- (void)_preparePDFDataForPrintingOnSecondaryThread
+{
+    ASSERT(RunLoop::isMain());
+
+    if (!_webFrame-&gt;page()) {
+        _printingCallbackCondition.notify_one();
+        return;
+    }
+
+    std::lock_guard&lt;std::mutex&gt; lock(_printingCallbackMutex);
+
+    ASSERT([self _hasPageRects]);
+    ASSERT(_printedPagesData.isEmpty());
+    ASSERT(!_printedPagesPDFDocument);
+    ASSERT(!_expectedPrintCallback);
+
+    NSUInteger firstPage = [self _firstPrintedPageNumber];
+    NSUInteger lastPage = [self _lastPrintedPageNumber];
+
+    ASSERT(firstPage &gt; 0);
+    ASSERT(firstPage &lt;= lastPage);
+    LOG(View, &quot;WKPrintingView requesting PDF data for pages %u...%u&quot;, firstPage, lastPage);
+
+    PrintInfo printInfo([_printOperation printInfo]);
+    // Return to printing mode if we're already back to screen (e.g. due to window resizing).
+    _webFrame-&gt;page()-&gt;beginPrinting(_webFrame.get(), printInfo);
+
+    IPCCallbackContext* context = new IPCCallbackContext;
+    RefPtr&lt;DataCallback&gt; callback = DataCallback::create([context](bool, API::Data* data) {
+        ASSERT(RunLoop::isMain());
+
+        OwnPtr&lt;IPCCallbackContext&gt; contextDeleter = adoptPtr(context);
+        WKPrintingView *view = context-&gt;view.get();
+
+        if (context-&gt;callbackID == view-&gt;_expectedPrintCallback) {
+            ASSERT(![view _isPrintingPreview]);
+            ASSERT(view-&gt;_printedPagesData.isEmpty());
+            ASSERT(!view-&gt;_printedPagesPDFDocument);
+            if (data)
+                view-&gt;_printedPagesData.append(data-&gt;bytes(), data-&gt;size());
+            view-&gt;_expectedPrintCallback = 0;
+            view-&gt;_printingCallbackCondition.notify_one();
+        }
+    });
+    _expectedPrintCallback = callback-&gt;callbackID();
+
+    context-&gt;view = self;
+    context-&gt;callbackID = callback-&gt;callbackID();
+
+    _webFrame-&gt;page()-&gt;drawPagesToPDF(_webFrame.get(), printInfo, firstPage - 1, lastPage - firstPage + 1, callback.get());
+}
+
+static void pageDidComputePageRects(const Vector&lt;WebCore::IntRect&gt;&amp; pageRects, double totalScaleFactorForPrinting, IPCCallbackContext* context)
+{
+    ASSERT(RunLoop::isMain());
+
+    WKPrintingView *view = context-&gt;view.get();
+
+    // If the user has already changed print setup, then this response is obsolete.
+    if (context-&gt;callbackID == view-&gt;_expectedComputedPagesCallback) {
+        ASSERT(RunLoop::isMain());
+        ASSERT(view-&gt;_expectedPreviewCallbacks.isEmpty());
+        ASSERT(!view-&gt;_latestExpectedPreviewCallback);
+        ASSERT(!view-&gt;_expectedPrintCallback);
+        ASSERT(view-&gt;_pagePreviews.isEmpty());
+        view-&gt;_expectedComputedPagesCallback = 0;
+
+        view-&gt;_printingPageRects = pageRects;
+        view-&gt;_totalScaleFactorForPrinting = totalScaleFactorForPrinting;
+
+        // Sanitize a response coming from the Web process.
+        if (view-&gt;_printingPageRects.isEmpty())
+            view-&gt;_printingPageRects.append(IntRect(0, 0, 1, 1));
+        if (view-&gt;_totalScaleFactorForPrinting &lt;= 0)
+            view-&gt;_totalScaleFactorForPrinting = 1;
+
+        const IntRect&amp; lastPrintingPageRect = view-&gt;_printingPageRects[view-&gt;_printingPageRects.size() - 1];
+        NSRect newFrameSize = NSMakeRect(0, 0, 
+            ceil(lastPrintingPageRect.maxX() * view-&gt;_totalScaleFactorForPrinting), 
+            ceil(lastPrintingPageRect.maxY() * view-&gt;_totalScaleFactorForPrinting));
+        LOG(View, &quot;WKPrintingView setting frame size to x:%g y:%g width:%g height:%g&quot;, newFrameSize.origin.x, newFrameSize.origin.y, newFrameSize.size.width, newFrameSize.size.height);
+        [view setFrame:newFrameSize];
+
+        if ([view _isPrintingPreview]) {
+            // Show page count, and ask for an actual image to replace placeholder.
+            [view _updatePreview];
+        } else {
+            // When printing, request everything we'll need beforehand.
+            [view _preparePDFDataForPrintingOnSecondaryThread];
+        }
+    }
+}
+
+- (BOOL)_askPageToComputePageRects
+{
+    ASSERT(RunLoop::isMain());
+
+    if (!_webFrame-&gt;page())
+        return NO;
+
+    ASSERT(!_expectedComputedPagesCallback);
+
+    IPCCallbackContext* context = new IPCCallbackContext;
+    RefPtr&lt;ComputedPagesCallback&gt; callback = ComputedPagesCallback::create([context](bool, const Vector&lt;WebCore::IntRect&gt;&amp; pageRects, double totalScaleFactorForPrinting) {
+        OwnPtr&lt;IPCCallbackContext&gt; contextDeleter = adoptPtr(context);
+        pageDidComputePageRects(pageRects, totalScaleFactorForPrinting, context);
+    });
+    _expectedComputedPagesCallback = callback-&gt;callbackID();
+    context-&gt;view = self;
+    context-&gt;callbackID = _expectedComputedPagesCallback;
+
+    _webFrame-&gt;page()-&gt;computePagesForPrinting(_webFrame.get(), PrintInfo([_printOperation printInfo]), callback.release());
+    return YES;
+}
+
+static void prepareDataForPrintingOnSecondaryThread(void* untypedContext)
+{
+    ASSERT(RunLoop::isMain());
+
+    WKPrintingView *view = static_cast&lt;WKPrintingView *&gt;(untypedContext);
+    std::lock_guard&lt;std::mutex&gt; lock(view-&gt;_printingCallbackMutex);
+
+    // We may have received page rects while a message to call this function traveled from secondary thread to main one.
+    if ([view _hasPageRects]) {
+        [view _preparePDFDataForPrintingOnSecondaryThread];
+        return;
+    }
+
+    // A request for pages has already been made, just wait for it to finish.
+    if (view-&gt;_expectedComputedPagesCallback)
+        return;
+
+    [view _askPageToComputePageRects];
+}
+
+- (BOOL)knowsPageRange:(NSRangePointer)range
+{
+    LOG(View, &quot;-[WKPrintingView %p knowsPageRange:], %s, %s&quot;, self, [self _hasPageRects] ? &quot;print data is available&quot; : &quot;print data is not available yet&quot;, RunLoop::isMain() ? &quot;on main thread&quot; : &quot;on secondary thread&quot;);
+    ASSERT(_printOperation == [NSPrintOperation currentOperation]);
+
+    // Assuming that once we switch to printing from a secondary thread, we don't go back.
+    ASSERT(!_isPrintingFromSecondaryThread || !RunLoop::isMain());
+    if (!RunLoop::isMain())
+        _isPrintingFromSecondaryThread = YES;
+
+    if (!_webFrame-&gt;page()) {
+        *range = NSMakeRange(1, NSIntegerMax);
+        return YES;
+    }
+
+    [self _suspendAutodisplay];
+    
+    [self performSelectorOnMainThread:@selector(_adjustPrintingMarginsForHeaderAndFooter) withObject:nil waitUntilDone:YES];
+
+    if ([self _hasPageRects])
+        *range = NSMakeRange(1, _printingPageRects.size());
+    else if (!RunLoop::isMain()) {
+        ASSERT(![self _isPrintingPreview]);
+        std::unique_lock&lt;std::mutex&gt; lock(_printingCallbackMutex);
+        callOnMainThread(prepareDataForPrintingOnSecondaryThread, self);
+        _printingCallbackCondition.wait(lock);
+        *range = NSMakeRange(1, _printingPageRects.size());
+    } else {
+        ASSERT([self _isPrintingPreview]);
+
+        // If a request for pages hasn't already been made, make it now.
+        if (!_expectedComputedPagesCallback)
+            [self _askPageToComputePageRects];
+
+        *range = NSMakeRange(1, NSIntegerMax);
+    }
+    return YES;
+}
+
+- (unsigned)_pageForRect:(NSRect)rect
+{
+    // Assuming that rect exactly matches one of the pages.
+    for (size_t i = 0; i &lt; _printingPageRects.size(); ++i) {
+        IntRect currentRect(_printingPageRects[i]);
+        currentRect.scale(_totalScaleFactorForPrinting);
+        if (rect.origin.y == currentRect.y() &amp;&amp; rect.origin.x == currentRect.x())
+            return i + 1;
+    }
+    ASSERT_NOT_REACHED();
+    return 0; // Invalid page number.
+}
+
+- (void)_drawPDFDocument:(PDFDocument *)pdfDocument page:(unsigned)page atPoint:(NSPoint)point
+{
+    if (!pdfDocument) {
+        LOG_ERROR(&quot;Couldn't create a PDF document with data passed for preview&quot;);
+        return;
+    }
+
+    PDFPage *pdfPage;
+    @try {
+        pdfPage = [pdfDocument pageAtIndex:page];
+    } @catch (id exception) {
+        LOG_ERROR(&quot;Preview data doesn't have page %d: %@&quot;, page, exception);
+        return;
+    }
+
+    NSGraphicsContext *nsGraphicsContext = [NSGraphicsContext currentContext];
+    CGContextRef context = static_cast&lt;CGContextRef&gt;([nsGraphicsContext graphicsPort]);
+
+    CGContextSaveGState(context);
+    CGContextTranslateCTM(context, point.x, point.y);
+    CGContextScaleCTM(context, _totalScaleFactorForPrinting, -_totalScaleFactorForPrinting);
+    CGContextTranslateCTM(context, 0, -[pdfPage boundsForBox:kPDFDisplayBoxMediaBox].size.height);
+    [pdfPage drawWithBox:kPDFDisplayBoxMediaBox];
+
+    CGAffineTransform transform = CGContextGetCTM(context);
+
+    for (PDFAnnotation *annotation in [pdfPage annotations]) {
+        if (![annotation isKindOfClass:pdfAnnotationLinkClass()])
+            continue;
+
+        PDFAnnotationLink *linkAnnotation = (PDFAnnotationLink *)annotation;
+        NSURL *url = [linkAnnotation URL];
+        if (!url)
+            continue;
+
+        CGRect urlRect = NSRectToCGRect([linkAnnotation bounds]);
+        CGRect transformedRect = CGRectApplyAffineTransform(urlRect, transform);
+        CGPDFContextSetURLForRect(context, (CFURLRef)url, transformedRect);
+    }
+
+    CGContextRestoreGState(context);
+}
+
+- (void)_drawPreview:(NSRect)nsRect
+{
+    ASSERT(RunLoop::isMain());
+
+    IntRect scaledPrintingRect(nsRect);
+    scaledPrintingRect.scale(1 / _totalScaleFactorForPrinting);
+    IntSize imageSize(nsRect.size);
+    imageSize.scale(_webFrame-&gt;page()-&gt;deviceScaleFactor());
+    HashMap&lt;WebCore::IntRect, RefPtr&lt;ShareableBitmap&gt;&gt;::iterator pagePreviewIterator = _pagePreviews.find(scaledPrintingRect);
+    if (pagePreviewIterator == _pagePreviews.end())  {
+        // It's too early to ask for page preview if we don't even know page size and scale.
+        if ([self _hasPageRects]) {
+            if (uint64_t existingCallback = [self _expectedPreviewCallbackForRect:scaledPrintingRect]) {
+                // We've already asked for a preview of this page, and are waiting for response.
+                // There is no need to ask again.
+                _latestExpectedPreviewCallback = existingCallback;
+            } else {
+                // Preview isn't available yet, request it asynchronously.
+                if (!_webFrame-&gt;page())
+                    return;
+
+                // Return to printing mode if we're already back to screen (e.g. due to window resizing).
+                _webFrame-&gt;page()-&gt;beginPrinting(_webFrame.get(), PrintInfo([_printOperation printInfo]));
+
+                IPCCallbackContext* context = new IPCCallbackContext;
+                RefPtr&lt;ImageCallback&gt; callback = ImageCallback::create([context](bool, const ShareableBitmap::Handle&amp; imageHandle) {
+                    OwnPtr&lt;IPCCallbackContext&gt; contextDeleter = adoptPtr(context);
+                    pageDidDrawToImage(imageHandle, context);
+                });
+                _latestExpectedPreviewCallback = callback-&gt;callbackID();
+                _expectedPreviewCallbacks.add(_latestExpectedPreviewCallback, scaledPrintingRect);
+
+                context-&gt;view = self;
+                context-&gt;callbackID = callback-&gt;callbackID();
+
+                _webFrame-&gt;page()-&gt;drawRectToImage(_webFrame.get(), PrintInfo([_printOperation printInfo]), scaledPrintingRect, imageSize, callback.get());
+                return;
+            }
+        }
+
+        // FIXME: Draw a placeholder
+        return;
+    }
+
+    RefPtr&lt;ShareableBitmap&gt; bitmap = pagePreviewIterator-&gt;value;
+    CGContextRef cgContext = static_cast&lt;CGContextRef&gt;([[NSGraphicsContext currentContext] graphicsPort]);
+
+    GraphicsContext context(cgContext);
+    GraphicsContextStateSaver stateSaver(context);
+
+    bitmap-&gt;paint(context, _webFrame-&gt;page()-&gt;deviceScaleFactor(), IntPoint(nsRect.origin), bitmap-&gt;bounds());
+}
+
+- (void)drawRect:(NSRect)nsRect
+{
+    LOG(View, &quot;WKPrintingView %p printing rect x:%g, y:%g, width:%g, height:%g%s&quot;, self, nsRect.origin.x, nsRect.origin.y, nsRect.size.width, nsRect.size.height, [self _isPrintingPreview] ? &quot; for preview&quot; : &quot;&quot;);
+
+    ASSERT(_printOperation == [NSPrintOperation currentOperation]);
+
+    if (!_webFrame-&gt;page())
+        return;
+
+    if ([self _isPrintingPreview]) {
+        [self _drawPreview:nsRect];
+        return;
+    }
+
+    ASSERT(!RunLoop::isMain());
+    ASSERT(!_printedPagesData.isEmpty()); // Prepared by knowsPageRange:
+
+    if (!_printedPagesPDFDocument) {
+        RetainPtr&lt;NSData&gt; pdfData = adoptNS([[NSData alloc] initWithBytes:_printedPagesData.data() length:_printedPagesData.size()]);
+        _printedPagesPDFDocument = adoptNS([[pdfDocumentClass() alloc] initWithData:pdfData.get()]);
+    }
+
+    unsigned printedPageNumber = [self _pageForRect:nsRect] - [self _firstPrintedPageNumber];
+    [self _drawPDFDocument:_printedPagesPDFDocument.get() page:printedPageNumber atPoint:NSMakePoint(nsRect.origin.x, nsRect.origin.y)];
+}
+
+- (void)_drawPageBorderWithSizeOnMainThread:(NSSize)borderSize
+{
+    ASSERT(RunLoop::isMain());
+
+    // When printing from a secondary thread, the main thread doesn't have graphics context and printing operation set up.
+    NSGraphicsContext *currentContext = [NSGraphicsContext currentContext];
+    [NSGraphicsContext setCurrentContext:[_printOperation context]];
+
+    ASSERT(![NSPrintOperation currentOperation]);
+    [NSPrintOperation setCurrentOperation:_printOperation];
+
+    [self drawPageBorderWithSize:borderSize];
+
+    [NSPrintOperation setCurrentOperation:nil];
+    [NSGraphicsContext setCurrentContext:currentContext];
+}
+
+- (void)drawPageBorderWithSize:(NSSize)borderSize
+{
+    ASSERT(NSEqualSizes(borderSize, [[_printOperation printInfo] paperSize]));    
+    ASSERT(_printOperation == [NSPrintOperation currentOperation]);
+
+    if (!RunLoop::isMain()) {
+        // Don't call the client from a secondary thread.
+        NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:[WKPrintingView instanceMethodSignatureForSelector:@selector(_drawPageBorderWithSizeOnMainThread:)]];
+        [invocation setSelector:@selector(_drawPageBorderWithSizeOnMainThread:)];
+        [invocation setArgument:&amp;borderSize atIndex:2];
+        [invocation performSelectorOnMainThread:@selector(invokeWithTarget:) withObject:self waitUntilDone:YES];
+        return;
+    }
+
+    if (!_webFrame-&gt;page())
+        return;
+
+    // The header and footer rect height scales with the page, but the width is always
+    // all the way across the printed page (inset by printing margins).
+    NSPrintInfo *printInfo = [_printOperation printInfo];
+    CGFloat scale = [printInfo scalingFactor];
+    NSSize paperSize = [printInfo paperSize];
+    CGFloat headerFooterLeft = [printInfo leftMargin] / scale;
+    CGFloat headerFooterWidth = (paperSize.width - ([printInfo leftMargin] + [printInfo rightMargin])) / scale;
+    NSRect footerRect = NSMakeRect(headerFooterLeft, [printInfo bottomMargin] / scale - _webFrame-&gt;page()-&gt;footerHeight(_webFrame.get()), headerFooterWidth, _webFrame-&gt;page()-&gt;footerHeight(_webFrame.get()));
+    NSRect headerRect = NSMakeRect(headerFooterLeft, (paperSize.height - [printInfo topMargin]) / scale, headerFooterWidth, _webFrame-&gt;page()-&gt;headerHeight(_webFrame.get()));
+
+    NSGraphicsContext *currentContext = [NSGraphicsContext currentContext];
+    [currentContext saveGraphicsState];
+    NSRectClip(headerRect);
+    _webFrame-&gt;page()-&gt;drawHeader(_webFrame.get(), headerRect);
+    [currentContext restoreGraphicsState];
+
+    [currentContext saveGraphicsState];
+    NSRectClip(footerRect);
+    _webFrame-&gt;page()-&gt;drawFooter(_webFrame.get(), footerRect);
+    [currentContext restoreGraphicsState];
+}
+
+- (NSRect)rectForPage:(NSInteger)page
+{
+    ASSERT(_printOperation == [NSPrintOperation currentOperation]);
+    if (![self _hasPageRects]) {
+        LOG(View, &quot;-[WKPrintingView %p rectForPage:%d] - data is not yet available&quot;, self, (int)page);
+        if (!_webFrame-&gt;page()) {
+            // We may have not told AppKit how many pages there are, so it will try to print until a null rect is returned.
+            return NSMakeRect(0, 0, 0, 0);
+        }
+        // We must be still calculating the page range.
+        ASSERT(_expectedComputedPagesCallback);
+        return NSMakeRect(0, 0, 1, 1);
+    }
+
+    // If Web process crashes while computing page rects, we never tell AppKit how many pages there are.
+    // Returning a null rect prevents selecting non-existent pages in preview dialog.
+    if (static_cast&lt;unsigned&gt;(page) &gt; _printingPageRects.size()) {
+        ASSERT(!_webFrame-&gt;page());
+        return NSMakeRect(0, 0, 0, 0);
+    }
+
+    IntRect rect = _printingPageRects[page - 1];
+    rect.scale(_totalScaleFactorForPrinting);
+    LOG(View, &quot;-[WKPrintingView %p rectForPage:%d] -&gt; x %d, y %d, width %d, height %d&quot;, self, (int)page, rect.x(), rect.y(), rect.width(), rect.height());
+    return rect;
+}
+
+// Temporary workaround for &lt;rdar://problem/8944535&gt;. Force correct printout positioning.
+- (NSPoint)locationOfPrintRect:(NSRect)aRect
+{
+    ASSERT(_printOperation == [NSPrintOperation currentOperation]);
+    return NSMakePoint([[_printOperation printInfo] leftMargin], [[_printOperation printInfo] bottomMargin]);
+}
+
+- (void)beginDocument
+{
+    ASSERT(_printOperation == [NSPrintOperation currentOperation]);
+
+    // Forcing preview update gets us here, but page setup hasn't actually changed.
+    if (isForcingPreviewUpdate)
+        return;
+
+    LOG(View, &quot;-[WKPrintingView %p beginDocument]&quot;, self);
+
+    [super beginDocument];
+
+    [self _suspendAutodisplay];
+}
+
+- (void)endDocument
+{
+    ASSERT(_printOperation == [NSPrintOperation currentOperation]);
+
+    // Forcing preview update gets us here, but page setup hasn't actually changed.
+    if (isForcingPreviewUpdate)
+        return;
+
+    LOG(View, &quot;-[WKPrintingView %p endDocument] - clearing cached data&quot;, self);
+
+    // Both existing data and pending responses are now obsolete.
+    _printingPageRects.clear();
+    _totalScaleFactorForPrinting = 1;
+    _pagePreviews.clear();
+    _printedPagesData.clear();
+    _printedPagesPDFDocument = nullptr;
+    _expectedComputedPagesCallback = 0;
+    _expectedPreviewCallbacks.clear();
+    _latestExpectedPreviewCallback = 0;
+    _expectedPrintCallback = 0;
+
+    [self _delayedResumeAutodisplay];
+    
+    [super endDocument];
+}
+@end
</ins></span></pre></div>
<a id="trunkSourceWebKit2UIProcessmacWKTextInputWindowControllerhfromrev164600trunkSourceWebKit2UIProcessAPImacWKTextInputWindowControllerh"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebKit2/UIProcess/mac/WKTextInputWindowController.h (from rev 164600, trunk/Source/WebKit2/UIProcess/API/mac/WKTextInputWindowController.h) (0 => 164601)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/mac/WKTextInputWindowController.h                                (rev 0)
+++ trunk/Source/WebKit2/UIProcess/mac/WKTextInputWindowController.h        2014-02-24 20:53:02 UTC (rev 164601)
</span><span class="lines">@@ -0,0 +1,49 @@
</span><ins>+/*
+ * Copyright (C) 2009, 2010 Apple Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+ */
+
+#ifndef WKTextInputWindowController_h
+#define WKTextInputWindowController_h
+
+#if USE(APPKIT)
+
+@class WKTextInputPanel;
+
+@interface WKTextInputWindowController : NSObject {
+    WKTextInputPanel *_panel;
+}
+
++ (WKTextInputWindowController *)sharedTextInputWindowController;
+
+- (NSTextInputContext *)inputContext;
+- (BOOL)interpretKeyEvent:(NSEvent *)event usingLegacyCocoaTextInput:(BOOL)usingLegacyCocoaTextInput string:(NSString **)string;
+
+- (BOOL)hasMarkedText;
+- (void)unmarkText;
+
+@end
+
+#endif // USE(APPKIT)
+
+#endif // WKTextInputWindowController_h
</ins></span></pre></div>
<a id="trunkSourceWebKit2UIProcessmacWKTextInputWindowControllerh"></a>
<div class="propset"><h4>Property changes: trunk/Source/WebKit2/UIProcess/mac/WKTextInputWindowController.h</h4>
<pre class="diff"><span>
</span></pre></div>
<a id="svnkeywords"></a>
<div class="addfile"><h4>Added: svn:keywords</h4></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4>Added: svn:eol-style</h4></div>
<a id="trunkSourceWebKit2UIProcessmacWKTextInputWindowControllermmfromrev164600trunkSourceWebKit2UIProcessAPImacWKTextInputWindowControllermm"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebKit2/UIProcess/mac/WKTextInputWindowController.mm (from rev 164600, trunk/Source/WebKit2/UIProcess/API/mac/WKTextInputWindowController.mm) (0 => 164601)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/mac/WKTextInputWindowController.mm                                (rev 0)
+++ trunk/Source/WebKit2/UIProcess/mac/WKTextInputWindowController.mm        2014-02-24 20:53:02 UTC (rev 164601)
</span><span class="lines">@@ -0,0 +1,214 @@
</span><ins>+/*
+ * Copyright (C) 2010 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#import &quot;config.h&quot;
+#import &quot;WKTextInputWindowController.h&quot;
+
+#if USE(APPKIT)
+
+#import &lt;WebKitSystemInterface.h&gt;
+
+@interface WKTextInputView : NSTextView {
+}
+@end
+
+@implementation WKTextInputView
+
+- (NSArray *)validAttributesForMarkedText
+{
+    // Let TSM know that a bottom input window would be created for marked text.
+    NSArray *regularAttributes = [super validAttributesForMarkedText];
+    NSMutableArray *floatingWindowAttributes = [NSMutableArray arrayWithArray:regularAttributes];
+    [floatingWindowAttributes addObject:@&quot;__NSUsesFloatingInputWindow&quot;];
+    return floatingWindowAttributes;
+}
+
+@end
+
+@interface WKTextInputPanel : NSPanel {
+    NSTextView *_inputTextView;
+}
+
+- (NSTextInputContext *)_inputContext;
+- (BOOL)_interpretKeyEvent:(NSEvent *)event usingLegacyCocoaTextInput:(BOOL)usingLegacyCocoaTextInput string:(NSString **)string;
+
+- (BOOL)_hasMarkedText;
+- (void)_unmarkText;
+
+@end
+
+#define inputWindowHeight 20
+
+@implementation WKTextInputPanel
+
+- (void)dealloc
+{
+    [[NSNotificationCenter defaultCenter] removeObserver:self];
+    
+    [_inputTextView release];
+    
+    [super dealloc];
+}
+
+- (id)init
+{
+    self = [super initWithContentRect:NSZeroRect styleMask:WKGetInputPanelWindowStyle() backing:NSBackingStoreBuffered defer:YES];
+    if (!self)
+        return nil;
+    
+    // Set the frame size.
+    NSRect visibleFrame = [[NSScreen mainScreen] visibleFrame];
+    NSRect frame = NSMakeRect(visibleFrame.origin.x, visibleFrame.origin.y, visibleFrame.size.width, inputWindowHeight);
+     
+    [self setFrame:frame display:NO];
+        
+    _inputTextView = [[WKTextInputView alloc] initWithFrame:[(NSView *)self.contentView frame]];
+    _inputTextView.autoresizingMask = NSViewWidthSizable | NSViewHeightSizable | NSViewMaxXMargin | NSViewMinXMargin | NSViewMaxYMargin | NSViewMinYMargin;
+        
+    NSScrollView* scrollView = [[NSScrollView alloc] initWithFrame:[(NSView *)self.contentView frame]];
+    scrollView.documentView = _inputTextView;
+    self.contentView = scrollView;
+    [scrollView release];
+        
+    [self setFloatingPanel:YES];
+
+    return self;
+}
+
+- (void)_unmarkText
+{
+    [_inputTextView setString:@&quot;&quot;];
+    [self orderOut:nil];
+}
+
+- (BOOL)_interpretKeyEvent:(NSEvent *)event usingLegacyCocoaTextInput:(BOOL)usingLegacyCocoaTextInput string:(NSString **)string
+{
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored &quot;-Wdeprecated-declarations&quot;
+    BOOL hadMarkedText = [_inputTextView hasMarkedText];
+#pragma clang diagnostic pop

+    *string = nil;
+
+    // Let TSM know that a bottom input window would be created for marked text.
+    // FIXME: Can be removed once we can rely on __NSUsesFloatingInputWindow (or a better API) being available everywhere.
+    EventRef carbonEvent = static_cast&lt;EventRef&gt;(const_cast&lt;void*&gt;([event eventRef]));
+    if (carbonEvent) {
+        Boolean ignorePAH = true;
+        SetEventParameter(carbonEvent, 'iPAH', typeBoolean, sizeof(ignorePAH), &amp;ignorePAH);
+    }
+
+    if (![[_inputTextView inputContext] handleEvent:event])
+        return NO;
+    
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored &quot;-Wdeprecated-declarations&quot;
+    if ([_inputTextView hasMarkedText]) {
+#pragma clang diagnostic pop
+        // Don't show the input method window for dead keys
+        if ([[event characters] length] &gt; 0)
+            [self orderFront:nil];
+
+        return YES;
+    }
+
+    bool shouldReturnTextString = hadMarkedText;
+
+    // In the updated Cocoa text input model spec, we always want to return the text even if the text view didn't have marked text.
+    if (!usingLegacyCocoaTextInput)
+        shouldReturnTextString = true;
+
+    if (shouldReturnTextString) {
+        [self orderOut:nil];
+
+        NSString *text = [[_inputTextView textStorage] string];
+        if ([text length] &gt; 0)
+            *string = [[text copy] autorelease];
+    }
+            
+    [_inputTextView setString:@&quot;&quot;];
+    return hadMarkedText;
+}
+
+- (NSTextInputContext *)_inputContext
+{
+    return [_inputTextView inputContext];
+}
+
+- (BOOL)_hasMarkedText
+{
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored &quot;-Wdeprecated-declarations&quot;
+    return [_inputTextView hasMarkedText];
+#pragma clang diagnostic pop
+}
+
+@end
+
+@implementation WKTextInputWindowController
+
++ (WKTextInputWindowController *)sharedTextInputWindowController
+{
+    static WKTextInputWindowController *textInputWindowController;
+    if (!textInputWindowController)
+        textInputWindowController = [[WKTextInputWindowController alloc] init];
+    
+    return textInputWindowController;
+}
+
+- (id)init
+{
+    self = [super init];
+    if (!self)
+        return nil;
+    
+    _panel = [[WKTextInputPanel alloc] init];
+    
+    return self;
+}
+
+- (NSTextInputContext *)inputContext
+{
+    return [_panel _inputContext];
+}
+
+- (BOOL)hasMarkedText
+{
+    return [_panel _hasMarkedText];
+}
+
+- (BOOL)interpretKeyEvent:(NSEvent *)event usingLegacyCocoaTextInput:(BOOL)usingLegacyCocoaTextInput string:(NSString **)string
+{
+    return [_panel _interpretKeyEvent:event usingLegacyCocoaTextInput:usingLegacyCocoaTextInput string:string];
+}
+
+- (void)unmarkText
+{
+    [_panel _unmarkText];
+}
+
+@end
+
+#endif // USE(APPKIT)
</ins></span></pre></div>
<a id="trunkSourceWebKit2WebKit2xcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj (164600 => 164601)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj        2014-02-24 20:51:05 UTC (rev 164600)
+++ trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj        2014-02-24 20:53:02 UTC (rev 164601)
</span><span class="lines">@@ -80,6 +80,14 @@
</span><span class="cx">                 0FCB4E5318BBE044000FCFC9 /* WKInteractionView.mm in Sources */ = {isa = PBXBuildFile; fileRef = 0FCB4E4318BBE044000FCFC9 /* WKInteractionView.mm */; };
</span><span class="cx">                 0FCB4E5418BBE044000FCFC9 /* WKScrollView.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FCB4E4418BBE044000FCFC9 /* WKScrollView.h */; };
</span><span class="cx">                 0FCB4E5518BBE044000FCFC9 /* WKScrollView.mm in Sources */ = {isa = PBXBuildFile; fileRef = 0FCB4E4518BBE044000FCFC9 /* WKScrollView.mm */; };
</span><ins>+                0FCB4E6018BBE3D9000FCFC9 /* FindIndicatorWindow.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FCB4E5618BBE3D9000FCFC9 /* FindIndicatorWindow.h */; };
+                0FCB4E6118BBE3D9000FCFC9 /* FindIndicatorWindow.mm in Sources */ = {isa = PBXBuildFile; fileRef = 0FCB4E5718BBE3D9000FCFC9 /* FindIndicatorWindow.mm */; };
+                0FCB4E6218BBE3D9000FCFC9 /* PageClientImpl.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FCB4E5818BBE3D9000FCFC9 /* PageClientImpl.h */; };
+                0FCB4E6318BBE3D9000FCFC9 /* PageClientImpl.mm in Sources */ = {isa = PBXBuildFile; fileRef = 0FCB4E5918BBE3D9000FCFC9 /* PageClientImpl.mm */; };
+                0FCB4E6618BBE3D9000FCFC9 /* WKPrintingView.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FCB4E5C18BBE3D9000FCFC9 /* WKPrintingView.h */; };
+                0FCB4E6718BBE3D9000FCFC9 /* WKPrintingView.mm in Sources */ = {isa = PBXBuildFile; fileRef = 0FCB4E5D18BBE3D9000FCFC9 /* WKPrintingView.mm */; };
+                0FCB4E6818BBE3D9000FCFC9 /* WKTextInputWindowController.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FCB4E5E18BBE3D9000FCFC9 /* WKTextInputWindowController.h */; };
+                0FCB4E6918BBE3D9000FCFC9 /* WKTextInputWindowController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 0FCB4E5F18BBE3D9000FCFC9 /* WKTextInputWindowController.mm */; };
</ins><span class="cx">                 0FF24A2D1879E4BC003ABF0C /* RemoteLayerTreeDrawingAreaProxyMessageReceiver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FF24A2B1879E4BC003ABF0C /* RemoteLayerTreeDrawingAreaProxyMessageReceiver.cpp */; };
</span><span class="cx">                 0FF24A2E1879E4BC003ABF0C /* RemoteLayerTreeDrawingAreaProxyMessages.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FF24A2C1879E4BC003ABF0C /* RemoteLayerTreeDrawingAreaProxyMessages.h */; };
</span><span class="cx">                 1A043976124D034800FFBFB5 /* PluginProcess.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A043974124D034800FFBFB5 /* PluginProcess.h */; };
</span><span class="lines">@@ -194,8 +202,6 @@
</span><span class="cx">                 1A44B95716B737AA00B7BBD8 /* StorageNamespaceImpl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A17635416B1D5D000D88FD6 /* StorageNamespaceImpl.cpp */; };
</span><span class="cx">                 1A44B95B16B73F9F00B7BBD8 /* StorageManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A44B95916B73F9F00B7BBD8 /* StorageManager.cpp */; };
</span><span class="cx">                 1A44B95C16B73F9F00B7BBD8 /* StorageManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A44B95A16B73F9F00B7BBD8 /* StorageManager.h */; };
</span><del>-                1A4A9AA812B7E796008FE984 /* WKTextInputWindowController.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A4A9AA612B7E796008FE984 /* WKTextInputWindowController.h */; };
-                1A4A9AA912B7E796008FE984 /* WKTextInputWindowController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1A4A9AA712B7E796008FE984 /* WKTextInputWindowController.mm */; };
</del><span class="cx">                 1A4A9C5512B816CF008FE984 /* NetscapePluginModule.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A4A9C5312B816CF008FE984 /* NetscapePluginModule.cpp */; };
</span><span class="cx">                 1A4A9C5612B816CF008FE984 /* NetscapePluginModule.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A4A9C5412B816CF008FE984 /* NetscapePluginModule.h */; };
</span><span class="cx">                 1A4A9C9A12B821CD008FE984 /* NetscapePluginModuleMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1A4A9C9912B821CD008FE984 /* NetscapePluginModuleMac.mm */; };
</span><span class="lines">@@ -250,8 +256,6 @@
</span><span class="cx">                 1A90C23812650717003E44D4 /* PageOverlay.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A90C23612650717003E44D4 /* PageOverlay.cpp */; };
</span><span class="cx">                 1A910071126675C4001842F5 /* FindIndicator.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A91006F126675C3001842F5 /* FindIndicator.h */; };
</span><span class="cx">                 1A910072126675C4001842F5 /* FindIndicator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A910070126675C4001842F5 /* FindIndicator.cpp */; };
</span><del>-                1A91010A1268C8CA001842F5 /* FindIndicatorWindow.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A9101081268C8CA001842F5 /* FindIndicatorWindow.h */; };
-                1A91010B1268C8CA001842F5 /* FindIndicatorWindow.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1A9101091268C8CA001842F5 /* FindIndicatorWindow.mm */; };
</del><span class="cx">                 1A92DC1112F8BA460017AF65 /* LayerTreeContext.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A92DC1012F8BA460017AF65 /* LayerTreeContext.h */; };
</span><span class="cx">                 1A92DC1312F8BAB90017AF65 /* LayerTreeContextMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1A92DC1212F8BAB90017AF65 /* LayerTreeContextMac.mm */; };
</span><span class="cx">                 1A9E32891821636900F5D04C /* WKRemoteObjectRegistry.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A9E32871821636900F5D04C /* WKRemoteObjectRegistry.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="lines">@@ -1011,8 +1015,6 @@
</span><span class="cx">                 BC111B0F112F5E4F00337BAB /* WebPageProxy.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC111B0B112F5E4F00337BAB /* WebPageProxy.cpp */; };
</span><span class="cx">                 BC111B11112F5E4F00337BAB /* WebProcessProxy.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC111B0D112F5E4F00337BAB /* WebProcessProxy.cpp */; };
</span><span class="cx">                 BC111B1D112F5FE600337BAB /* ProcessLauncherMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = BC111B1B112F5FE600337BAB /* ProcessLauncherMac.mm */; };
</span><del>-                BC111B50112F619200337BAB /* PageClientImpl.h in Headers */ = {isa = PBXBuildFile; fileRef = BC111B4B112F619200337BAB /* PageClientImpl.h */; };
-                BC111B51112F619200337BAB /* PageClientImpl.mm in Sources */ = {isa = PBXBuildFile; fileRef = BC111B4C112F619200337BAB /* PageClientImpl.mm */; };
</del><span class="cx">                 BC111B5D112F629800337BAB /* WebEventFactory.h in Headers */ = {isa = PBXBuildFile; fileRef = BC111B5B112F629800337BAB /* WebEventFactory.h */; };
</span><span class="cx">                 BC111B5E112F629800337BAB /* WebEventFactory.mm in Sources */ = {isa = PBXBuildFile; fileRef = BC111B5C112F629800337BAB /* WebEventFactory.mm */; };
</span><span class="cx">                 BC14DF77120B5B7900826C0C /* InjectedBundleScriptWorld.h in Headers */ = {isa = PBXBuildFile; fileRef = BC14DF75120B5B7900826C0C /* InjectedBundleScriptWorld.h */; };
</span><span class="lines">@@ -1400,8 +1402,6 @@
</span><span class="cx">                 DF58C6361371ACA000F9A37C /* NativeWebWheelEventMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = DF58C6351371ACA000F9A37C /* NativeWebWheelEventMac.mm */; };
</span><span class="cx">                 E11D35AE16B63D1B006D23D7 /* com.apple.WebProcess.sb in Resources */ = {isa = PBXBuildFile; fileRef = E1967E37150AB5E200C73169 /* com.apple.WebProcess.sb */; };
</span><span class="cx">                 E133FD8A1423DD7F00FC7BFB /* WebKit.icns in Resources */ = {isa = PBXBuildFile; fileRef = E133FD891423DD7F00FC7BFB /* WebKit.icns */; };
</span><del>-                E134F01712EA5D33004EC58D /* WKPrintingView.h in Headers */ = {isa = PBXBuildFile; fileRef = E134F01512EA5D11004EC58D /* WKPrintingView.h */; };
-                E134F01A12EA5D99004EC58D /* WKPrintingView.mm in Sources */ = {isa = PBXBuildFile; fileRef = E134F01912EA5D99004EC58D /* WKPrintingView.mm */; };
</del><span class="cx">                 E13833EC189C33C8001E2350 /* LocalStorageDetails.h in Headers */ = {isa = PBXBuildFile; fileRef = E13833EB189C33C8001E2350 /* LocalStorageDetails.h */; };
</span><span class="cx">                 E14A954916E016A40068DE82 /* NetworkProcessPlatformStrategies.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E14A954716E016A40068DE82 /* NetworkProcessPlatformStrategies.cpp */; };
</span><span class="cx">                 E14A954A16E016A40068DE82 /* NetworkProcessPlatformStrategies.h in Headers */ = {isa = PBXBuildFile; fileRef = E14A954816E016A40068DE82 /* NetworkProcessPlatformStrategies.h */; };
</span><span class="lines">@@ -1737,6 +1737,14 @@
</span><span class="cx">                 0FCB4E4318BBE044000FCFC9 /* WKInteractionView.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = WKInteractionView.mm; path = ios/WKInteractionView.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 0FCB4E4418BBE044000FCFC9 /* WKScrollView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WKScrollView.h; path = ios/WKScrollView.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 0FCB4E4518BBE044000FCFC9 /* WKScrollView.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = WKScrollView.mm; path = ios/WKScrollView.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                0FCB4E5618BBE3D9000FCFC9 /* FindIndicatorWindow.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FindIndicatorWindow.h; sourceTree = &quot;&lt;group&gt;&quot;; };
+                0FCB4E5718BBE3D9000FCFC9 /* FindIndicatorWindow.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = FindIndicatorWindow.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
+                0FCB4E5818BBE3D9000FCFC9 /* PageClientImpl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PageClientImpl.h; sourceTree = &quot;&lt;group&gt;&quot;; };
+                0FCB4E5918BBE3D9000FCFC9 /* PageClientImpl.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = PageClientImpl.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
+                0FCB4E5C18BBE3D9000FCFC9 /* WKPrintingView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKPrintingView.h; sourceTree = &quot;&lt;group&gt;&quot;; };
+                0FCB4E5D18BBE3D9000FCFC9 /* WKPrintingView.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WKPrintingView.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
+                0FCB4E5E18BBE3D9000FCFC9 /* WKTextInputWindowController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKTextInputWindowController.h; sourceTree = &quot;&lt;group&gt;&quot;; };
+                0FCB4E5F18BBE3D9000FCFC9 /* WKTextInputWindowController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WKTextInputWindowController.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 0FF24A2B1879E4BC003ABF0C /* RemoteLayerTreeDrawingAreaProxyMessageReceiver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RemoteLayerTreeDrawingAreaProxyMessageReceiver.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 0FF24A2C1879E4BC003ABF0C /* RemoteLayerTreeDrawingAreaProxyMessages.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RemoteLayerTreeDrawingAreaProxyMessages.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 0FF24A2F1879E4FE003ABF0C /* RemoteLayerTreeDrawingAreaProxy.messages.in */ = {isa = PBXFileReference; lastKnownFileType = text; path = RemoteLayerTreeDrawingAreaProxy.messages.in; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -1864,8 +1872,6 @@
</span><span class="cx">                 1A445BA4184D5FDA004B3414 /* WKContextConnectionClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKContextConnectionClient.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 1A44B95916B73F9F00B7BBD8 /* StorageManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = StorageManager.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 1A44B95A16B73F9F00B7BBD8 /* StorageManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StorageManager.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><del>-                1A4A9AA612B7E796008FE984 /* WKTextInputWindowController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKTextInputWindowController.h; sourceTree = &quot;&lt;group&gt;&quot;; };
-                1A4A9AA712B7E796008FE984 /* WKTextInputWindowController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WKTextInputWindowController.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</del><span class="cx">                 1A4A9C5312B816CF008FE984 /* NetscapePluginModule.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = NetscapePluginModule.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 1A4A9C5412B816CF008FE984 /* NetscapePluginModule.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NetscapePluginModule.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 1A4A9C9912B821CD008FE984 /* NetscapePluginModuleMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = NetscapePluginModuleMac.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -1929,8 +1935,6 @@
</span><span class="cx">                 1A90C23612650717003E44D4 /* PageOverlay.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PageOverlay.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 1A91006F126675C3001842F5 /* FindIndicator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FindIndicator.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 1A910070126675C4001842F5 /* FindIndicator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FindIndicator.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><del>-                1A9101081268C8CA001842F5 /* FindIndicatorWindow.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FindIndicatorWindow.h; sourceTree = &quot;&lt;group&gt;&quot;; };
-                1A9101091268C8CA001842F5 /* FindIndicatorWindow.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = FindIndicatorWindow.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</del><span class="cx">                 1A92DC1012F8BA460017AF65 /* LayerTreeContext.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LayerTreeContext.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 1A92DC1212F8BAB90017AF65 /* LayerTreeContextMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = LayerTreeContextMac.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 1A9E32871821636900F5D04C /* WKRemoteObjectRegistry.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKRemoteObjectRegistry.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -2772,8 +2776,6 @@
</span><span class="cx">                 BC111B0B112F5E4F00337BAB /* WebPageProxy.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 4; path = WebPageProxy.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 BC111B0D112F5E4F00337BAB /* WebProcessProxy.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebProcessProxy.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 BC111B1B112F5FE600337BAB /* ProcessLauncherMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ProcessLauncherMac.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><del>-                BC111B4B112F619200337BAB /* PageClientImpl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PageClientImpl.h; sourceTree = &quot;&lt;group&gt;&quot;; };
-                BC111B4C112F619200337BAB /* PageClientImpl.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = PageClientImpl.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</del><span class="cx">                 BC111B5B112F629800337BAB /* WebEventFactory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebEventFactory.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 BC111B5C112F629800337BAB /* WebEventFactory.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebEventFactory.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 BC122FA3132707F300F7EAC1 /* PluginProcess.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = PluginProcess.xcconfig; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -3196,8 +3198,6 @@
</span><span class="cx">                 DF58C6311371AC5800F9A37C /* NativeWebWheelEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NativeWebWheelEvent.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 DF58C6351371ACA000F9A37C /* NativeWebWheelEventMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = NativeWebWheelEventMac.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 E133FD891423DD7F00FC7BFB /* WebKit.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; name = WebKit.icns; path = Resources/WebKit.icns; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><del>-                E134F01512EA5D11004EC58D /* WKPrintingView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKPrintingView.h; sourceTree = &quot;&lt;group&gt;&quot;; };
-                E134F01912EA5D99004EC58D /* WKPrintingView.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WKPrintingView.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</del><span class="cx">                 E13833EB189C33C8001E2350 /* LocalStorageDetails.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LocalStorageDetails.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 E14A954716E016A40068DE82 /* NetworkProcessPlatformStrategies.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = NetworkProcessPlatformStrategies.cpp; path = NetworkProcess/NetworkProcessPlatformStrategies.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 E14A954816E016A40068DE82 /* NetworkProcessPlatformStrategies.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = NetworkProcessPlatformStrategies.h; path = NetworkProcess/NetworkProcessPlatformStrategies.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -5353,7 +5353,6 @@
</span><span class="cx">                 BC111B47112F616900337BAB /* mac */ = {
</span><span class="cx">                         isa = PBXGroup;
</span><span class="cx">                         children = (
</span><del>-                                BCBAAC58144E38B90053F82F /* WKView Details */,
</del><span class="cx">                                 BC8699B3116AADAA002A925B /* WKView.mm */,
</span><span class="cx">                                 BC8699B4116AADAA002A925B /* WKViewInternal.h */,
</span><span class="cx">                         );
</span><span class="lines">@@ -5824,21 +5823,6 @@
</span><span class="cx">                         path = WebContentService.Development;
</span><span class="cx">                         sourceTree = &quot;&lt;group&gt;&quot;;
</span><span class="cx">                 };
</span><del>-                BCBAAC58144E38B90053F82F /* WKView Details */ = {
-                        isa = PBXGroup;
-                        children = (
-                                1A9101081268C8CA001842F5 /* FindIndicatorWindow.h */,
-                                1A9101091268C8CA001842F5 /* FindIndicatorWindow.mm */,
-                                BC111B4B112F619200337BAB /* PageClientImpl.h */,
-                                BC111B4C112F619200337BAB /* PageClientImpl.mm */,
-                                E134F01512EA5D11004EC58D /* WKPrintingView.h */,
-                                E134F01912EA5D99004EC58D /* WKPrintingView.mm */,
-                                1A4A9AA612B7E796008FE984 /* WKTextInputWindowController.h */,
-                                1A4A9AA712B7E796008FE984 /* WKTextInputWindowController.mm */,
-                        );
-                        name = &quot;WKView Details&quot;;
-                        sourceTree = &quot;&lt;group&gt;&quot;;
-                };
</del><span class="cx">                 BCBECDBF16B5CE0D00047A1A /* PluginService.Development */ = {
</span><span class="cx">                         isa = PBXGroup;
</span><span class="cx">                         children = (
</span><span class="lines">@@ -5860,12 +5844,14 @@
</span><span class="cx">                 BCCF085C113F3B7500C650C5 /* mac */ = {
</span><span class="cx">                         isa = PBXGroup;
</span><span class="cx">                         children = (
</span><del>-                                868160CF187645370021E79D /* WindowServerConnection.mm */,
-                                868160CD18763D4B0021E79D /* WindowServerConnection.h */,
</del><span class="cx">                                 B878B613133428DC006888E9 /* CorrectionPanel.h */,
</span><span class="cx">                                 B878B614133428DC006888E9 /* CorrectionPanel.mm */,
</span><del>-                                0FF24A2F1879E4FE003ABF0C /* RemoteLayerTreeDrawingAreaProxy.messages.in */,
</del><ins>+                                0FCB4E5618BBE3D9000FCFC9 /* FindIndicatorWindow.h */,
+                                0FCB4E5718BBE3D9000FCFC9 /* FindIndicatorWindow.mm */,
+                                0FCB4E5818BBE3D9000FCFC9 /* PageClientImpl.h */,
+                                0FCB4E5918BBE3D9000FCFC9 /* PageClientImpl.mm */,
</ins><span class="cx">                                 1AB16AE01648656D00290D62 /* RemoteLayerTreeDrawingAreaProxy.h */,
</span><ins>+                                0FF24A2F1879E4FE003ABF0C /* RemoteLayerTreeDrawingAreaProxy.messages.in */,
</ins><span class="cx">                                 1AB16ADF1648656D00290D62 /* RemoteLayerTreeDrawingAreaProxy.mm */,
</span><span class="cx">                                 1AA3D75A1651B44F008713D0 /* RemoteLayerTreeHost.h */,
</span><span class="cx">                                 1AA3D7591651B44F008713D0 /* RemoteLayerTreeHost.mm */,
</span><span class="lines">@@ -5876,8 +5862,8 @@
</span><span class="cx">                                 1AF05D8514688348008B1E81 /* TiledCoreAnimationDrawingAreaProxy.h */,
</span><span class="cx">                                 1AF05D8414688348008B1E81 /* TiledCoreAnimationDrawingAreaProxy.mm */,
</span><span class="cx">                                 2D125C5C1857EA05003BA3CB /* ViewGestureController.h */,
</span><del>-                                2D125C5D1857EA05003BA3CB /* ViewGestureControllerMac.mm */,
</del><span class="cx">                                 2D1B5D5A18586599006C6596 /* ViewGestureController.messages.in */,
</span><ins>+                                2D125C5D1857EA05003BA3CB /* ViewGestureControllerMac.mm */,
</ins><span class="cx">                                 2D6CD117189058A500E5A4A0 /* ViewSnapshotStore.h */,
</span><span class="cx">                                 2D6CD118189058A500E5A4A0 /* ViewSnapshotStore.mm */,
</span><span class="cx">                                 728E86EF1795188C0087879E /* WebColorPickerMac.h */,
</span><span class="lines">@@ -5892,10 +5878,16 @@
</span><span class="cx">                                 BC5750961268F3C6006F0F12 /* WebPopupMenuProxyMac.mm */,
</span><span class="cx">                                 BC84EB1712A7100C0083F2DA /* WebPreferencesMac.mm */,
</span><span class="cx">                                 51D130571382F10500351EDD /* WebProcessProxyMac.mm */,
</span><ins>+                                868160CD18763D4B0021E79D /* WindowServerConnection.h */,
+                                868160CF187645370021E79D /* WindowServerConnection.mm */,
</ins><span class="cx">                                 E1AEA22D14687BDB00804569 /* WKFullKeyboardAccessWatcher.h */,
</span><span class="cx">                                 E1AEA22E14687BDB00804569 /* WKFullKeyboardAccessWatcher.mm */,
</span><span class="cx">                                 CDCA85C7132ABA4E00E961DF /* WKFullScreenWindowController.h */,
</span><span class="cx">                                 CDCA85C6132ABA4E00E961DF /* WKFullScreenWindowController.mm */,
</span><ins>+                                0FCB4E5C18BBE3D9000FCFC9 /* WKPrintingView.h */,
+                                0FCB4E5D18BBE3D9000FCFC9 /* WKPrintingView.mm */,
+                                0FCB4E5E18BBE3D9000FCFC9 /* WKTextInputWindowController.h */,
+                                0FCB4E5F18BBE3D9000FCFC9 /* WKTextInputWindowController.mm */,
</ins><span class="cx">                         );
</span><span class="cx">                         path = mac;
</span><span class="cx">                         sourceTree = &quot;&lt;group&gt;&quot;;
</span><span class="lines">@@ -6302,6 +6294,7 @@
</span><span class="cx">                                 BCA284D71492F2C7001F9042 /* WKConnection.h in Headers */,
</span><span class="cx">                                 BC017D0716260FF4007054F5 /* WKDOMDocument.h in Headers */,
</span><span class="cx">                                 BC017D0916260FF4007054F5 /* WKDOMElement.h in Headers */,
</span><ins>+                                0FCB4E6218BBE3D9000FCFC9 /* PageClientImpl.h in Headers */,
</ins><span class="cx">                                 BC017D0D16260FF4007054F5 /* WKDOMNode.h in Headers */,
</span><span class="cx">                                 BC39C4361626366F008BC689 /* WKDOMRange.h in Headers */,
</span><span class="cx">                                 293EBEAB1627D9C9005F89F1 /* WKDOMText.h in Headers */,
</span><span class="lines">@@ -6362,7 +6355,6 @@
</span><span class="cx">                                 1A90C1F41264FD71003E44D4 /* FindController.h in Headers */,
</span><span class="cx">                                 1A910071126675C4001842F5 /* FindIndicator.h in Headers */,
</span><span class="cx">                                 515E7728183DD6F60007203F /* AsyncRequest.h in Headers */,
</span><del>-                                1A91010A1268C8CA001842F5 /* FindIndicatorWindow.h in Headers */,
</del><span class="cx">                                 BCE81D8D1319F7EF00241910 /* FontInfo.h in Headers */,
</span><span class="cx">                                 1ABC3DFC1899F51C004F0626 /* WKNavigationDelegate.h in Headers */,
</span><span class="cx">                                 BC17753F118BABF0007D9E9A /* GenericCallback.h in Headers */,
</span><span class="lines">@@ -6400,6 +6392,7 @@
</span><span class="cx">                                 1A9E32891821636900F5D04C /* WKRemoteObjectRegistry.h in Headers */,
</span><span class="cx">                                 51654EFE184EF33F007DC837 /* UniqueIDBDatabaseBackingStoreSQLite.h in Headers */,
</span><span class="cx">                                 BC33E0D112408E8600360F3F /* InjectedBundleRangeHandle.h in Headers */,
</span><ins>+                                0FCB4E6018BBE3D9000FCFC9 /* FindIndicatorWindow.h in Headers */,
</ins><span class="cx">                                 BC14DF77120B5B7900826C0C /* InjectedBundleScriptWorld.h in Headers */,
</span><span class="cx">                                 BCB0B0DE12305A8C00B1341E /* InjectedBundleUserMessageCoders.h in Headers */,
</span><span class="cx">                                 1AE49A4911FFA8CE0048B464 /* JSNPMethod.h in Headers */,
</span><span class="lines">@@ -6471,7 +6464,6 @@
</span><span class="cx">                                 1A5B1C511898606F004FCF9B /* WKNavigation.h in Headers */,
</span><span class="cx">                                 7CF47FFB17275C57008ACB91 /* PageBanner.h in Headers */,
</span><span class="cx">                                 BC6EDAA6111271C600E7678B /* PageClient.h in Headers */,
</span><del>-                                BC111B50112F619200337BAB /* PageClientImpl.h in Headers */,
</del><span class="cx">                                 1A90C23712650717003E44D4 /* PageOverlay.h in Headers */,
</span><span class="cx">                                 C574A58112E66681002DFE98 /* PasteboardTypes.h in Headers */,
</span><span class="cx">                                 E19582D3153CBFD700B60875 /* PDFKitImports.h in Headers */,
</span><span class="lines">@@ -6499,6 +6491,7 @@
</span><span class="cx">                                 1A2BB6D114117B4D000F35D4 /* PluginProcessConnectionMessages.h in Headers */,
</span><span class="cx">                                 1A2D90D21281C966001EB962 /* PluginProcessCreationParameters.h in Headers */,
</span><span class="cx">                                 1A0EC603124A9F2C007EF4A5 /* PluginProcessManager.h in Headers */,
</span><ins>+                                0FCB4E6618BBE3D9000FCFC9 /* WKPrintingView.h in Headers */,
</ins><span class="cx">                                 1A1EC69E1872092100B951F0 /* ImportanceAssertion.h in Headers */,
</span><span class="cx">                                 1A0EC6C0124BBD9B007EF4A5 /* PluginProcessMessages.h in Headers */,
</span><span class="cx">                                 1A0EC75E124BC7B2007EF4A5 /* PluginProcessProxy.h in Headers */,
</span><span class="lines">@@ -6900,7 +6893,6 @@
</span><span class="cx">                                 762B748D120BC75C00819339 /* WKPreferencesPrivate.h in Headers */,
</span><span class="cx">                                 37C4C08918149F23003688B9 /* WKBackForwardListItemInternal.h in Headers */,
</span><span class="cx">                                 51D0D437183B353D0097041D /* DatabaseProcessIDBConnectionMessages.h in Headers */,
</span><del>-                                E134F01712EA5D33004EC58D /* WKPrintingView.h in Headers */,
</del><span class="cx">                                 BCBAACED145225E30053F82F /* WKProcessGroupPrivate.h in Headers */,
</span><span class="cx">                                 512F58FC12A88A5400629530 /* WKProtectionSpace.h in Headers */,
</span><span class="cx">                                 518ACAEA12AEE6BB00B04B83 /* WKProtectionSpaceTypes.h in Headers */,
</span><span class="lines">@@ -6923,7 +6915,6 @@
</span><span class="cx">                                 BC40761A124FF0370068F20A /* WKStringCF.h in Headers */,
</span><span class="cx">                                 759CCD591808F1690078E8A8 /* WebOriginDataManagerProxyChangeClient.h in Headers */,
</span><span class="cx">                                 BC9099801256A98200083756 /* WKStringPrivate.h in Headers */,
</span><del>-                                1A4A9AA812B7E796008FE984 /* WKTextInputWindowController.h in Headers */,
</del><span class="cx">                                 5175095A1897249700408FAC /* IDBIdentifier.h in Headers */,
</span><span class="cx">                                 1A3C888018A5ABAE00C4C962 /* WKPreferencesInternal.h in Headers */,
</span><span class="cx">                                 BC407608124FF0270068F20A /* WKType.h in Headers */,
</span><span class="lines">@@ -6944,6 +6935,7 @@
</span><span class="cx">                                 C5E1AFE916B20B75006CC1F2 /* WKWebArchive.h in Headers */,
</span><span class="cx">                                 C5E1AFEB16B20B7E006CC1F2 /* WKWebArchiveResource.h in Headers */,
</span><span class="cx">                                 BC989D82161A7E5D000D46D3 /* WKWebProcessPlugIn.h in Headers */,
</span><ins>+                                0FCB4E6818BBE3D9000FCFC9 /* WKTextInputWindowController.h in Headers */,
</ins><span class="cx">                                 BC8F2F2E16273ACC005FACB5 /* WKWebProcessPlugInBrowserContextControllerInternal.h in Headers */,
</span><span class="cx">                                 29501724162A4504004A9D71 /* WKWebProcessPlugInBrowserContextControllerPrivate.h in Headers */,
</span><span class="cx">                                 1F7506B61859165700EC0FF7 /* WKWebProcessPlugInNodeHandleInternal.h in Headers */,
</span><span class="lines">@@ -7752,7 +7744,6 @@
</span><span class="cx">                                 1A1E093318861D3800D2DC49 /* WebProgressTrackerClient.cpp in Sources */,
</span><span class="cx">                                 1A90C1F51264FD71003E44D4 /* FindController.cpp in Sources */,
</span><span class="cx">                                 1A910072126675C4001842F5 /* FindIndicator.cpp in Sources */,
</span><del>-                                1A91010B1268C8CA001842F5 /* FindIndicatorWindow.mm in Sources */,
</del><span class="cx">                                 BCE81D8C1319F7EF00241910 /* FontInfo.cpp in Sources */,
</span><span class="cx">                                 378E1A4918208CD60031007A /* WKNSString.mm in Sources */,
</span><span class="cx">                                 BC06F43012DBB9B6002D78DE /* GeolocationPermissionRequestManager.cpp in Sources */,
</span><span class="lines">@@ -7777,10 +7768,12 @@
</span><span class="cx">                                 CD67D30E15C08F9A00843ADF /* InjectedBundlePageDiagnosticLoggingClient.cpp in Sources */,
</span><span class="cx">                                 E1EE53E711F8CFFB00CCBEE4 /* InjectedBundlePageEditorClient.cpp in Sources */,
</span><span class="cx">                                 BC14E109120B905E00826C0C /* InjectedBundlePageFormClient.cpp in Sources */,
</span><ins>+                                0FCB4E6918BBE3D9000FCFC9 /* WKTextInputWindowController.mm in Sources */,
</ins><span class="cx">                                 37D0B5C81845232700F6CE7D /* WKErrorRecoveryAttempting.m in Sources */,
</span><span class="cx">                                 CD5C66A0134B9D38004FE2A8 /* InjectedBundlePageFullScreenClient.cpp in Sources */,
</span><span class="cx">                                 755422CB180650020046F6A8 /* WebOriginDataManager.cpp in Sources */,
</span><span class="cx">                                 BCA8C6A811E3BA5F00812FB7 /* InjectedBundlePageLoaderClient.cpp in Sources */,
</span><ins>+                                0FCB4E6718BBE3D9000FCFC9 /* WKPrintingView.mm in Sources */,
</ins><span class="cx">                                 1AAB037C185F99D800EDF501 /* APIData.cpp in Sources */,
</span><span class="cx">                                 BC8147AA12F64CDA007B2C32 /* InjectedBundlePagePolicyClient.cpp in Sources */,
</span><span class="cx">                                 659C551E130006410025C0C2 /* InjectedBundlePageResourceLoadClient.cpp in Sources */,
</span><span class="lines">@@ -7861,7 +7854,6 @@
</span><span class="cx">                                 51E351F5180F5C7500E53BE9 /* WebIDBFactoryBackend.cpp in Sources */,
</span><span class="cx">                                 7C387434172F5615001BD88A /* PageBanner.cpp in Sources */,
</span><span class="cx">                                 7C6D37FC172F555F009D2847 /* PageBannerMac.mm in Sources */,
</span><del>-                                BC111B51112F619200337BAB /* PageClientImpl.mm in Sources */,
</del><span class="cx">                                 1A90C23812650717003E44D4 /* PageOverlay.cpp in Sources */,
</span><span class="cx">                                 C574A58212E66681002DFE98 /* PasteboardTypes.mm in Sources */,
</span><span class="cx">                                 E19582D6153CC05400B60875 /* PDFKitImports.mm in Sources */,
</span><span class="lines">@@ -8189,6 +8181,7 @@
</span><span class="cx">                                 BCBAAC72144E61990053F82F /* WKBrowsingContextController.mm in Sources */,
</span><span class="cx">                                 BCBAACF51452324F0053F82F /* WKBrowsingContextGroup.mm in Sources */,
</span><span class="cx">                                 51290992183ACEAF005522A6 /* WebIDBServerConnection.cpp in Sources */,
</span><ins>+                                0FCB4E6118BBE3D9000FCFC9 /* FindIndicatorWindow.mm in Sources */,
</ins><span class="cx">                                 BC204EEE11C83EC8008F3375 /* WKBundle.cpp in Sources */,
</span><span class="cx">                                 7C6E70FB18B2DC7A00F24E2E /* WebProcessCocoa.mm in Sources */,
</span><span class="cx">                                 935EEB9E127761AC003322B8 /* WKBundleBackForwardList.cpp in Sources */,
</span><span class="lines">@@ -8281,7 +8274,6 @@
</span><span class="cx">                                 7C135AA8173B0BCA00586AE2 /* WKPluginInformation.cpp in Sources */,
</span><span class="cx">                                 1AC86FF3130B46D3002C1257 /* WKPluginSiteDataManager.cpp in Sources */,
</span><span class="cx">                                 BCD597D1112B56AC00EC8C23 /* WKPreferences.cpp in Sources */,
</span><del>-                                E134F01A12EA5D99004EC58D /* WKPrintingView.mm in Sources */,
</del><span class="cx">                                 BCBAACEC145225E30053F82F /* WKProcessGroup.mm in Sources */,
</span><span class="cx">                                 512F58FB12A88A5400629530 /* WKProtectionSpace.cpp in Sources */,
</span><span class="cx">                                 37948408150C4B9700E52CE9 /* WKRenderLayer.cpp in Sources */,
</span><span class="lines">@@ -8293,7 +8285,6 @@
</span><span class="cx">                                 1AC1337118566C7C00F3EC05 /* APIFrameHandle.cpp in Sources */,
</span><span class="cx">                                 BC407605124FF0270068F20A /* WKString.cpp in Sources */,
</span><span class="cx">                                 BC407619124FF0370068F20A /* WKStringCF.mm in Sources */,
</span><del>-                                1A4A9AA912B7E796008FE984 /* WKTextInputWindowController.mm in Sources */,
</del><span class="cx">                                 1AC7537B183A9FDB0072CB15 /* PageLoadState.cpp in Sources */,
</span><span class="cx">                                 BC407607124FF0270068F20A /* WKType.cpp in Sources */,
</span><span class="cx">                                 7CD5EBBE1746B04C000C1C45 /* WKTypeRefWrapper.mm in Sources */,
</span><span class="lines">@@ -8306,6 +8297,7 @@
</span><span class="cx">                                 BC40762A124FF0400068F20A /* WKURLRequestNS.mm in Sources */,
</span><span class="cx">                                 512A9760180E031D0039A149 /* DatabaseProcessMessageReceiver.cpp in Sources */,
</span><span class="cx">                                 BC40760D124FF0270068F20A /* WKURLResponse.cpp in Sources */,
</span><ins>+                                0FCB4E6318BBE3D9000FCFC9 /* PageClientImpl.mm in Sources */,
</ins><span class="cx">                                 1ADCB86A189831B30022EE5A /* NavigationActionData.cpp in Sources */,
</span><span class="cx">                                 BC40762C124FF0400068F20A /* WKURLResponseNS.mm in Sources */,
</span><span class="cx">                                 2D819B9E18627EE9001F03D1 /* ViewGestureGeometryCollector.cpp in Sources */,
</span></span></pre>
</div>
</div>

</body>
</html>