<!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>[164605] 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/164605">164605</a></dd>
<dt>Author</dt> <dd>simon.fraser@apple.com</dd>
<dt>Date</dt> <dd>2014-02-24 13:35:52 -0800 (Mon, 24 Feb 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>Remove PDFViewController.*, which is unused
https://bugs.webkit.org/show_bug.cgi?id=129270

Reviewed by Tim Horton.

* UIProcess/mac/PDFViewController.h: Removed.
* UIProcess/mac/PDFViewController.mm: Removed.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
</ul>

<h3>Removed Paths</h3>
<ul>
<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>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (164604 => 164605)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2014-02-24 21:15:56 UTC (rev 164604)
+++ trunk/Source/WebKit2/ChangeLog        2014-02-24 21:35:52 UTC (rev 164605)
</span><span class="lines">@@ -1,3 +1,13 @@
</span><ins>+2014-02-24  Simon Fraser  &lt;simon.fraser@apple.com&gt;
+
+        Remove PDFViewController.*, which is unused
+        https://bugs.webkit.org/show_bug.cgi?id=129270
+
+        Reviewed by Tim Horton.
+
+        * UIProcess/mac/PDFViewController.h: Removed.
+        * UIProcess/mac/PDFViewController.mm: Removed.
+
</ins><span class="cx"> 2014-02-24  Anders Carlsson  &lt;andersca@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Rename WKProcessClass to WKProcessPool
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessmacPDFViewControllerh"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebKit2/UIProcess/mac/PDFViewController.h (164604 => 164605)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/mac/PDFViewController.h        2014-02-24 21:15:56 UTC (rev 164604)
+++ trunk/Source/WebKit2/UIProcess/mac/PDFViewController.h        2014-02-24 21:35:52 UTC (rev 164605)
</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 *);
-
-    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="trunkSourceWebKit2UIProcessmacPDFViewControllermm"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebKit2/UIProcess/mac/PDFViewController.mm (164604 => 164605)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/mac/PDFViewController.mm        2014-02-24 21:15:56 UTC (rev 164604)
+++ trunk/Source/WebKit2/UIProcess/mac/PDFViewController.mm        2014-02-24 21:35:52 UTC (rev 164605)
</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>
</div>

</body>
</html>