Title: [98189] trunk/Source/WebKit2
Revision
98189
Author
a...@apple.com
Date
2011-10-21 21:57:09 -0700 (Fri, 21 Oct 2011)

Log Message

[WK2] Clicking a print button in a PDF doesn't do anything
https://bugs.webkit.org/show_bug.cgi?id=70663
<rdar://problem/9795014>

Reviewed by Dan Bernstein.

* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::printMainFrame): Added a public method
that PDFViewController could call.

* UIProcess/API/mac/PDFViewController.h:
* UIProcess/API/mac/PDFViewController.mm:
(-[WKPDFView PDFViewPerformPrint:]):
(WebKit::PDFViewController::print):
Connect PDFView delegate method for printing.

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (98188 => 98189)


--- trunk/Source/WebKit2/ChangeLog	2011-10-22 03:58:55 UTC (rev 98188)
+++ trunk/Source/WebKit2/ChangeLog	2011-10-22 04:57:09 UTC (rev 98189)
@@ -1,3 +1,21 @@
+2011-10-21  Alexey Proskuryakov  <a...@apple.com>
+
+        [WK2] Clicking a print button in a PDF doesn't do anything
+        https://bugs.webkit.org/show_bug.cgi?id=70663
+        <rdar://problem/9795014>
+
+        Reviewed by Dan Bernstein.
+
+        * UIProcess/WebPageProxy.h:
+        * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::printMainFrame): Added a public method
+        that PDFViewController could call.
+
+        * UIProcess/API/mac/PDFViewController.h:
+        * UIProcess/API/mac/PDFViewController.mm:
+        (-[WKPDFView PDFViewPerformPrint:]):
+        (WebKit::PDFViewController::print):
+        Connect PDFView delegate method for printing.
+
 2011-10-21  Sam Weinig  <s...@webkit.org>
 
         Lookup does not work on text using web fonts in WebKit2

Modified: trunk/Source/WebKit2/UIProcess/API/mac/PDFViewController.h (98188 => 98189)


--- trunk/Source/WebKit2/UIProcess/API/mac/PDFViewController.h	2011-10-22 03:58:55 UTC (rev 98188)
+++ trunk/Source/WebKit2/UIProcess/API/mac/PDFViewController.h	2011-10-22 04:57:09 UTC (rev 98189)
@@ -66,6 +66,7 @@
     void openPDFInFinder();
     void savePDFToDownloadsFolder();
     void linkClicked(const String& url);
+    void print();
 
     void findString(const String&, FindOptions, unsigned maxMatchCount);
     void countStringMatches(const String&, FindOptions, unsigned maxMatchCount);

Modified: trunk/Source/WebKit2/UIProcess/API/mac/PDFViewController.mm (98188 => 98189)


--- trunk/Source/WebKit2/UIProcess/API/mac/PDFViewController.mm	2011-10-22 03:58:55 UTC (rev 98188)
+++ trunk/Source/WebKit2/UIProcess/API/mac/PDFViewController.mm	2011-10-22 04:57:09 UTC (rev 98189)
@@ -360,6 +360,11 @@
     _pdfViewController->savePDFToDownloadsFolder();
 }
 
+- (void)PDFViewPerformPrint:(PDFView *)sender
+{
+    _pdfViewController->print();
+}
+
 @end
 
 namespace WebKit {
@@ -603,6 +608,11 @@
     page()->linkClicked(url, event);
 }
 
+void PDFViewController::print()
+{
+    page()->printMainFrame();
+}
+
 void PDFViewController::findString(const String& string, FindOptions options, unsigned maxMatchCount)
 {
     BOOL forward = !(options & FindOptionsBackwards);

Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp (98188 => 98189)


--- trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp	2011-10-22 03:58:55 UTC (rev 98188)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp	2011-10-22 04:57:09 UTC (rev 98189)
@@ -2200,6 +2200,11 @@
     m_isPerformingDOMPrintOperation = false;
 }
 
+void WebPageProxy::printMainFrame()
+{
+    printFrame(m_mainFrame->frameID());
+}
+
 #if PLATFORM(QT)
 void WebPageProxy::didChangeContentsSize(const IntSize& size)
 {

Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.h (98188 => 98189)


--- trunk/Source/WebKit2/UIProcess/WebPageProxy.h	2011-10-22 03:58:55 UTC (rev 98188)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.h	2011-10-22 04:57:09 UTC (rev 98189)
@@ -568,6 +568,8 @@
 
     void setShouldSendEventsSynchronously(bool sync) { m_shouldSendEventsSynchronously = sync; };
 
+    void printMainFrame();
+
 private:
     WebPageProxy(PageClient*, PassRefPtr<WebProcessProxy>, WebPageGroup*, uint64_t pageID);
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to