Replace Frame::print with Chrome::print and remove -[WebFrameBridge print]
authoraroben <aroben@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 16 Jul 2007 22:01:23 +0000 (22:01 +0000)
committeraroben <aroben@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 16 Jul 2007 22:01:23 +0000 (22:01 +0000)
WebCore:

        Replace Frame::print with Chrome::print

        This also adds a Frame* parameter to Chrome::print and
        ChromeClient::print so that it knows which Frame to print.

        Reviewed by Darin.

        All tests pass.

        * bindings/js/kjs_window.cpp:
        (KJS::WindowFunc::callAsFunction): Call Chrome::print.
        * editing/JSEditor.cpp: Ditto.

        * bridge/win/FrameWin.cpp: Removed Frame::print.
        * page/Frame.h: Ditto.
        * page/mac/FrameMac.mm: Ditto.
        * page/qt/FrameQt.cpp: Ditto.
        * platform/gdk/FrameGdk.cpp: Ditto.
        * page/mac/WebCoreFrameBridge.h: Removed -print.

        * page/Chrome.cpp: Added Frame* parameter to Chrome::print and pass it
        up to the ChromeClient.
        * page/Chrome.h: Ditto.
        * page/ChromeClient.h: Ditto.
        * platform/gdk/TemporaryLinkStubs.cpp: Ditto.
        * platform/graphics/svg/SVGImageEmptyClients.h: Ditto.

WebKit:

        Move printing from WebFrameBridge to WebChromeClient

        Reviewed by Darin.

        * WebCoreSupport/WebChromeClient.h: Updated for ChromeClient changes.
        * WebCoreSupport/WebChromeClient.mm:
        (WebChromeClient::print): Moved code from WebFrameBridge.
        * WebCoreSupport/WebFrameBridge.mm: Removed -print.

WebKit/win:

        Updated WebChromeClient for ChromeClient changes.

        Reviewed by Darin.

        * WebChromeClient.cpp:
        (WebChromeClient::print): Added a Frame* parameter.
        * WebChromeClient.h: Ditto.

WebKitQt:

        Updated ChromeClientQt for ChromeClient changes.

        Reviewed by Darin.

        * WebCoreSupport/ChromeClientQt.cpp:
        (WebCore::ChromeClientQt::print): Added a Frame* parameter.
        * WebCoreSupport/ChromeClientQt.h: Ditto.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@24330 268f45cc-cd09-0410-ab3c-d52691b4dbfc

24 files changed:
WebCore/ChangeLog
WebCore/bindings/js/kjs_window.cpp
WebCore/bridge/win/FrameWin.cpp
WebCore/editing/JSEditor.cpp
WebCore/page/Chrome.cpp
WebCore/page/Chrome.h
WebCore/page/ChromeClient.h
WebCore/page/Frame.h
WebCore/page/mac/FrameMac.mm
WebCore/page/mac/WebCoreFrameBridge.h
WebCore/page/qt/FrameQt.cpp
WebCore/platform/gdk/FrameGdk.cpp
WebCore/platform/gdk/TemporaryLinkStubs.cpp
WebCore/platform/graphics/svg/SVGImageEmptyClients.h
WebKit/ChangeLog
WebKit/WebCoreSupport/WebChromeClient.h
WebKit/WebCoreSupport/WebChromeClient.mm
WebKit/WebCoreSupport/WebFrameBridge.mm
WebKit/win/ChangeLog
WebKit/win/WebChromeClient.cpp
WebKit/win/WebChromeClient.h
WebKitQt/ChangeLog
WebKitQt/WebCoreSupport/ChromeClientQt.cpp
WebKitQt/WebCoreSupport/ChromeClientQt.h

index 77dbf1845f0c207e4ce3731ce778ffe9caf5d70e..5929cc571a6db4279c4381214b531305be3f874f 100644 (file)
@@ -1,3 +1,32 @@
+2007-07-16  Adam Roben  <aroben@apple.com>
+
+        Replace Frame::print with Chrome::print
+
+        This also adds a Frame* parameter to Chrome::print and
+        ChromeClient::print so that it knows which Frame to print.
+
+        Reviewed by Darin.
+
+        All tests pass.
+
+        * bindings/js/kjs_window.cpp:
+        (KJS::WindowFunc::callAsFunction): Call Chrome::print.
+        * editing/JSEditor.cpp: Ditto.
+
+        * bridge/win/FrameWin.cpp: Removed Frame::print.
+        * page/Frame.h: Ditto.
+        * page/mac/FrameMac.mm: Ditto.
+        * page/qt/FrameQt.cpp: Ditto.
+        * platform/gdk/FrameGdk.cpp: Ditto.
+        * page/mac/WebCoreFrameBridge.h: Removed -print.
+
+        * page/Chrome.cpp: Added Frame* parameter to Chrome::print and pass it
+        up to the ChromeClient.
+        * page/Chrome.h: Ditto.
+        * page/ChromeClient.h: Ditto.
+        * platform/gdk/TemporaryLinkStubs.cpp: Ditto.
+        * platform/graphics/svg/SVGImageEmptyClients.h: Ditto.
+
 2007-07-16  Adele Peterson  <adele@apple.com>
 
         Reviewed by Brady.
index 5496826b2904fc78e81fca423da66bbb10581b47..3d75780b59298c1796324fda04a1aaa62d1e1e50 100644 (file)
@@ -1370,7 +1370,8 @@ JSValue *WindowFunc::callAsFunction(ExecState *exec, JSObject *thisObj, const Li
       return Window::retrieve(frame); // global object
   }
   case Window::Print:
-    frame->print();
+    if (Page* page = frame->page())
+        page->chrome()->print(frame);
     return jsUndefined();
   case Window::ScrollBy:
     window->updateLayout();
index 8fb47e308571d78c9ec446a83b33df91fe7a8273..f830ea18c3b7487e8abb16e0700618b39949ef53 100644 (file)
@@ -191,10 +191,4 @@ void Frame::dashboardRegionsChanged()
 {
 }
 
-void Frame::print()
-{
-    if (d->m_page)
-        d->m_page->chrome()->print();
-}
-
 } // namespace WebCore
index 76c93603c0b0498933c7a30ce892b86cc3f391d8..62d379fdebb093e7926d305d20f2922fd40264b9 100644 (file)
@@ -411,7 +411,8 @@ bool execPasteAndMatchStyle(Frame* frame, bool, const String&)
 
 bool execPrint(Frame* frame, bool, const String&)
 {
-    frame->print();
+    if (Page* page = frame->page())
+        page->chrome()->print(frame);
     return true;
 }
 
index 932a8673266cff2f77809562b9a32b13161769f3..09b29ea25643410128c4c22fdb91e831f95c6619 100644 (file)
@@ -335,9 +335,9 @@ void Chrome::setToolTip(const HitTestResult& result)
     m_client->setToolTip(toolTip);
 }
 
-void Chrome::print()
+void Chrome::print(Frame* frame)
 {
-    m_client->print();
+    m_client->print(frame);
 }
 
 PageGroupLoadDeferrer::PageGroupLoadDeferrer(Page* page, bool deferSelf)
index d2fafcfd4bc82c85e0b2d63359fa97376d597af7..e5a0ee65a55a13e3760c0f3836e72a34e00881dd 100644 (file)
@@ -123,7 +123,7 @@ namespace WebCore {
 
         void setToolTip(const HitTestResult&);
 
-        void print();
+        void print(Frame*);
 
 #if PLATFORM(MAC)
         void focusNSView(NSView*);
index 370a1dc386caeaff7c639de4fe7ae50b0cddfb20..a3f619dcff8073255e3e15b3bd371e49b8134905 100644 (file)
@@ -101,7 +101,7 @@ namespace WebCore {
 
         virtual void setToolTip(const String&) = 0;
 
-        virtual void print() = 0;
+        virtual void print(Frame*) = 0;
 };
 
 }
index 031dbf49b2406cae0432b9f6d671f40ef962de25..821de3aa0d886827ed5b9a9cb1ca6c4f163b2b00 100644 (file)
@@ -245,7 +245,6 @@ private:
 public:
     void focusWindow();
     void unfocusWindow();
-    void print();
     bool shouldClose();
     void scheduleClose();
 
index 61cdd54e8ea217827461e444c786cde75cbad9f6..1dbcfcd82b2379527804d8941e274567480ad904 100644 (file)
@@ -491,11 +491,6 @@ NSWritingDirection Frame::baseWritingDirectionForSelectionStart() const
     return result;
 }
 
-void Frame::print()
-{
-    [d->m_bridge print];
-}
-
 void Frame::issuePasteCommand()
 {
     [d->m_bridge issuePasteCommand];
index 7d8b25c2decdad69763fbe1228b97e704dbaaf38..a53ddbf01c66407d2b21bd8a72d95a4b7381b1bd 100644 (file)
@@ -278,8 +278,6 @@ typedef enum ObjectElementType {
 
 - (ObjectElementType)determineObjectFromMIMEType:(NSString*)MIMEType URL:(NSURL*)URL;
 
-- (void)print;
-
 - (jobject)getAppletInView:(NSView *)view;
 
 // Deprecated, use getAppletInView: instead.
index 1b972f4d9b12fabe3efeeb7c62381ce28effa099..d685842dee1786a4b8c67b04b4b146bfdd3806d7 100644 (file)
@@ -101,11 +101,6 @@ void Frame::issueTransposeCommand()
     notImplemented();
 }
 
-void Frame::print()
-{
-    notImplemented();
-}
-
 KJS::Bindings::Instance* Frame::createScriptInstanceForWidget(WebCore::Widget* widget)
 {
     return 0;
index 9fa1be6ee334ffb21c113c712aba5b5279a529f5..9ae55ae0b58c049f203f6d63934a2a3543a4207c 100644 (file)
@@ -231,11 +231,6 @@ void FrameGdk::handleGdkEvent(GdkEvent* event)
     }
 }
 
-void Frame::print() 
-{
-    notImplemented();
-}
-
 void Frame::issueTransposeCommand()
 {
     notImplemented();
index 29fd6ab41b0e47dfca7f22c6a15e89f2fbd1a701..f3f5031525aed9ac4cfd23c20264eac73e2e38d8 100644 (file)
@@ -178,7 +178,7 @@ void ChromeClientGdk::setToolTip(const String&)
     notImplemented();
 }
 
-void ChromeClientGdk::print()
+void ChromeClientGdk::print(Frame*)
 {
     notImplemented();
 }
index 7a29bd2d6020935b9b611ab374f090eb326b1674..61458e2df357a4e794602a29c708994104148978 100644 (file)
@@ -114,7 +114,7 @@ public:
     
     virtual void setToolTip(const String&) { }
 
-    virtual void print() { }
+    virtual void print(Frame*) { }
 };
 
 class SVGEmptyFrameLoaderClient : public FrameLoaderClient {
index 9e6792a57782b258444c900274a3f0051f494129..a914079855856e7b6e7ff0d6205bf253fd882e62 100644 (file)
@@ -1,3 +1,14 @@
+2007-07-16  Adam Roben  <aroben@apple.com>
+
+        Move printing from WebFrameBridge to WebChromeClient
+
+        Reviewed by Darin.
+
+        * WebCoreSupport/WebChromeClient.h: Updated for ChromeClient changes.
+        * WebCoreSupport/WebChromeClient.mm:
+        (WebChromeClient::print): Moved code from WebFrameBridge.
+        * WebCoreSupport/WebFrameBridge.mm: Removed -print.
+
 2007-07-16  Darin Adler  <darin@apple.com>
 
         * StringsNotToBeLocalized.txt: Update for recent changes.
index d6d7aa9b337c48970c590ec32637ea7f8805b3ff..2674df7c6eaf5e459d20baadc25e002c84a67604 100644 (file)
@@ -99,7 +99,7 @@ public:
 
     virtual void setToolTip(const WebCore::String&);
 
-    virtual void print();
+    virtual void print(WebCore::Frame*);
 private:
     WebView *m_webView;
 };
index 106a180d5f78cc2c67cb48bc9e2cffc95a2b22e0..4f337e5386168230e6d765410aaa23916104e3d8 100644 (file)
@@ -383,7 +383,12 @@ void WebChromeClient::setToolTip(const String& toolTip)
     [(WebHTMLView *)[[[m_webView mainFrame] frameView] documentView] _setToolTip:toolTip];
 }
 
-void WebChromeClient::print()
+void WebChromeClient::print(Frame* frame)
 {
-    // FIXME: printing is still handled via WebFrameBridge
+    WebFrameView* frameView = [kit(frame) frameView];
+    id wd = [m_webView UIDelegate];
+    if ([wd respondsToSelector:@selector(webView:printFrameView:)])
+        [wd webView:m_webView printFrameView:frameView];
+    else
+        [[WebDefaultUIDelegate sharedUIDelegate] webView:m_webView printFrameView:frameView];
 }
index fb4b81de76e9830fe58a08d9b4366f52e94ee720..04c24b686095d37617ea79c4a8729459433488a5 100644 (file)
@@ -630,15 +630,6 @@ NSString *WebPluginContainerKey =   @"WebPluginContainer";
     return ObjectElementNone;
 }
 
-- (void)print
-{
-    id wd = [[self webView] UIDelegate];    
-    if ([wd respondsToSelector:@selector(webView:printFrameView:)])
-        [wd webView:[self webView] printFrameView:[_frame frameView]];
-    else
-        [[WebDefaultUIDelegate sharedUIDelegate] webView:[self webView] printFrameView:[_frame frameView]];
-}
-
 - (jobject)getAppletInView:(NSView *)view
 {
     if ([view respondsToSelector:@selector(webPlugInGetApplet)])
index 92933dd649acfcea4a7b9414597305aa28782d3e..98c8e50ea0958401d1fb9d550447fe12ebb3283c 100644 (file)
@@ -1,3 +1,13 @@
+2007-07-16  Adam Roben  <aroben@apple.com>
+
+        Updated WebChromeClient for ChromeClient changes.
+
+        Reviewed by Darin.
+
+        * WebChromeClient.cpp:
+        (WebChromeClient::print): Added a Frame* parameter.
+        * WebChromeClient.h: Ditto.
+
 2007-07-16  Oliver Hunt  <oliver@apple.com>
 
         Reviewed by Steve.
index 71eb9a0417171bc4f89c5ce12b0a8d2c381b956f..b81c00023229693614f5acb1e0bd5567984daba8 100644 (file)
@@ -443,7 +443,7 @@ void WebChromeClient::setToolTip(const String& toolTip)
     m_webView->setToolTip(toolTip);
 }
 
-void WebChromeClient::print()
+void WebChromeClient::print(Frame*)
 {
     COMPtr<IWebUIDelegate> uiDelegate;
     COMPtr<IWebUIDelegate2> uiDelegate2;
index d014c406d645a24d022eab22567a6fc338b3f0f5..f63cb0f1188c4976d97d92f57dda245b6dc9a31c 100644 (file)
@@ -92,7 +92,7 @@ public:
 
     virtual void setToolTip(const WebCore::String&);
 
-    virtual void print();
+    virtual void print(WebCore::Frame*);
 
 private:
     WebView* m_webView;
index 77a9320eddfc79ec1d90d8373bca931d137c71bd..65bb3a3a0f0fab49bf1456a79ef9aa69c50d0f8f 100644 (file)
@@ -1,3 +1,13 @@
+2007-07-16  Adam Roben  <aroben@apple.com>
+
+        Updated ChromeClientQt for ChromeClient changes.
+
+        Reviewed by Darin.
+
+        * WebCoreSupport/ChromeClientQt.cpp:
+        (WebCore::ChromeClientQt::print): Added a Frame* parameter.
+        * WebCoreSupport/ChromeClientQt.h: Ditto.
+
 2007-07-13  Mark Rowe  <mrowe@apple.com>
 
         Reviewed by Mitz.
index cd182adc2ff725df154579d4b3b58214f689f329..a1f35e76ce7b5e946484b14495b38b207cea2e87 100644 (file)
@@ -305,7 +305,7 @@ void ChromeClientQt::setToolTip(const String&)
     notImplemented();
 }
 
-void ChromeClientQt::print()
+void ChromeClientQt::print(Frame*)
 {
     notImplemented();
 }
index 7cdc218a5636cfd142704b7f1a4a3bdf676e07e1..0c4f0d3e29b17dbbc6b32ec64ef4f2bb1e914671 100644 (file)
@@ -106,7 +106,7 @@ namespace WebCore {
 
         virtual void setToolTip(const String&);
 
-        virtual void print();
+        virtual void print(Frame*);
 
         QWebPage* m_webPage;
     };