Implement WebKit2 callback equivalent to - [WebUIDelegate webView:setStatusText:]
authorweinig@apple.com <weinig@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 12 Sep 2010 01:50:30 +0000 (01:50 +0000)
committerweinig@apple.com <weinig@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 12 Sep 2010 01:50:30 +0000 (01:50 +0000)
<rdar://problem/8359252>
https://bugs.webkit.org/show_bug.cgi?id=45605

Reviewed by Dan Bernstein.

WebKit2:

* Shared/CoreIPCSupport/WebPageProxyMessageKinds.h:
* UIProcess/API/C/WKPage.h:
* UIProcess/API/qt/qwkpage.cpp:
(QWKPage::QWKPage):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::didReceiveMessage):
(WebKit::WebPageProxy::setStatusText):
* UIProcess/WebPageProxy.h:
* UIProcess/WebUIClient.cpp:
(WebKit::WebUIClient::setStatusText):
* UIProcess/WebUIClient.h:
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::setStatusbarText):

WebKitTools:

* MiniBrowser/mac/BrowserWindowController.m:
(setStatusText):
(contentsSizeChanged):
(-[BrowserWindowController awakeFromNib]):
* MiniBrowser/win/BrowserView.cpp:
(runJavaScriptConfirm):
(runJavaScriptPrompt):
(setStatusText):
(contentsSizeChanged):
(BrowserView::create):
* WebKitTestRunner/TestController.cpp:
(WTR::createOtherPage):
(WTR::TestController::initialize):

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

13 files changed:
WebKit2/ChangeLog
WebKit2/Shared/CoreIPCSupport/WebPageProxyMessageKinds.h
WebKit2/UIProcess/API/C/WKPage.h
WebKit2/UIProcess/API/qt/qwkpage.cpp
WebKit2/UIProcess/WebPageProxy.cpp
WebKit2/UIProcess/WebPageProxy.h
WebKit2/UIProcess/WebUIClient.cpp
WebKit2/UIProcess/WebUIClient.h
WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp
WebKitTools/ChangeLog
WebKitTools/MiniBrowser/mac/BrowserWindowController.m
WebKitTools/MiniBrowser/win/BrowserView.cpp
WebKitTools/WebKitTestRunner/TestController.cpp

index b5a295c3b92d0874b9d3cc340686b7f8b37dcc30..98f63beca4b6aca413549cce3843046cf752813b 100644 (file)
@@ -1,3 +1,25 @@
+2010-09-11  Sam Weinig  <sam@webkit.org>
+
+        Reviewed by Dan Bernstein.
+
+        Implement WebKit2 callback equivalent to - [WebUIDelegate webView:setStatusText:]
+        <rdar://problem/8359252>
+        https://bugs.webkit.org/show_bug.cgi?id=45605
+
+        * Shared/CoreIPCSupport/WebPageProxyMessageKinds.h:
+        * UIProcess/API/C/WKPage.h:
+        * UIProcess/API/qt/qwkpage.cpp:
+        (QWKPage::QWKPage):
+        * UIProcess/WebPageProxy.cpp:
+        (WebKit::WebPageProxy::didReceiveMessage):
+        (WebKit::WebPageProxy::setStatusText):
+        * UIProcess/WebPageProxy.h:
+        * UIProcess/WebUIClient.cpp:
+        (WebKit::WebUIClient::setStatusText):
+        * UIProcess/WebUIClient.h:
+        * WebProcess/WebCoreSupport/WebChromeClient.cpp:
+        (WebKit::WebChromeClient::setStatusbarText):
+
 2010-09-11  Sam Weinig  <sam@webkit.org>
 
         Reviewed by Dan Bernstein.
index 1cf49ce5d54f28cb3e1280838638d339a3484591..138c569488460ff9b98130748900ed861620e0fe 100644 (file)
@@ -65,6 +65,7 @@ enum Kind {
     DidStartProgress,
     DidStartProvisionalLoadForFrame,
     SetCursor,
+    SetStatusText,
     SetToolTip,
     TakeFocus,
     WillSubmitForm,
index 78ac012afedc4d9432b705fb90dd932c55f830e0..58f20d6e31cc616528d56b9674e3a0fe3950e97f 100644 (file)
@@ -140,6 +140,7 @@ typedef void (*WKPageCloseCallback)(WKPageRef page, const void *clientInfo);
 typedef void (*WKPageRunJavaScriptAlertCallback)(WKPageRef page, WKStringRef alertText, WKFrameRef frame, const void *clientInfo);
 typedef bool (*WKPageRunJavaScriptConfirmCallback)(WKPageRef page, WKStringRef message, WKFrameRef frame, const void *clientInfo);
 typedef WKStringRef (*WKPageRunJavaScriptPromptCallback)(WKPageRef page, WKStringRef message, WKStringRef defaultValue, WKFrameRef frame, const void *clientInfo);
+typedef void (*WKPageSetStatusTextCallback)(WKPageRef page, WKStringRef text, const void *clientInfo);
 typedef void (*WKPageContentsSizeChangedCallback)(WKPageRef page, int width, int height, WKFrameRef frame, const void *clientInfo);
 
 struct WKPageUIClient {
@@ -151,6 +152,7 @@ struct WKPageUIClient {
     WKPageRunJavaScriptAlertCallback                                    runJavaScriptAlert;
     WKPageRunJavaScriptConfirmCallback                                  runJavaScriptConfirm;
     WKPageRunJavaScriptPromptCallback                                   runJavaScriptPrompt;
+    WKPageSetStatusTextCallback                                         setStatusText;
     WKPageContentsSizeChangedCallback                                   contentsSizeChanged;
 };
 typedef struct WKPageUIClient WKPageUIClient;
index c72c267bd6d25a4db04ac0535af21beab4d846f8..7ace67804fa3770f179d9d4eebe6b899b85425fb 100644 (file)
@@ -258,6 +258,7 @@ QWKPage::QWKPage(WKPageNamespaceRef namespaceRef)
         qt_wk_runJavaScriptAlert,
         0,  /* runJavaScriptConfirm */
         0,  /* runJavaScriptPrompt */
+        0   /* setStatusText */
         0   /* contentsSizeChanged */
     };
     WKPageSetPageUIClient(pageRef(), &uiClient);
index 3ce65fb5ecf12bf71027b0f0c9f7f12bbd3662e9..1f608b21a99d8faf8cbb1b2e5457dcbc9fde9def 100644 (file)
@@ -476,7 +476,6 @@ void WebPageProxy::getStatistics(WKContextStatistics* statistics)
     statistics->numberOfWKFrames += process()->frameCountInPage(this);
 }
 
-
 void WebPageProxy::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments)
 {
     if (messageID.is<CoreIPC::MessageClassDrawingAreaProxy>()) {
@@ -716,6 +715,13 @@ void WebPageProxy::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::M
             contentsSizeChanged(process()->webFrame(frameID), size);
             break;
         }
+        case WebPageProxyMessage::SetStatusText: {
+            String text;
+            if (!arguments->decode(CoreIPC::Out(text)))
+                return;
+            setStatusText(text);
+            break;
+        }
         case WebPageProxyMessage::RegisterEditCommandForUndo: {
             uint64_t commandID;
             uint32_t editAction;
@@ -1000,6 +1006,11 @@ String WebPageProxy::runJavaScriptPrompt(WebFrameProxy* frame, const String& mes
     return m_uiClient.runJavaScriptPrompt(this, message, defaultValue, frame);
 }
 
+void WebPageProxy::setStatusText(const String& text)
+{
+    m_uiClient.setStatusText(this, text);
+}
+
 void WebPageProxy::contentsSizeChanged(WebFrameProxy* frame, const WebCore::IntSize& size)
 {
     m_uiClient.contentsSizeChanged(this, size, frame);
index 3e52db5c1aaaac500009ecb6a602277a753d66b4..abc5c3b4a7b3d67416343bfbe0ea8320d8772b8f 100644 (file)
@@ -224,6 +224,7 @@ private:
     void runJavaScriptAlert(WebFrameProxy*, const WTF::String&);
     bool runJavaScriptConfirm(WebFrameProxy* frame, const WTF::String&);
     WTF::String runJavaScriptPrompt(WebFrameProxy* frame, const WTF::String&, const WTF::String&);
+    void setStatusText(const String&);
     void contentsSizeChanged(WebFrameProxy*, const WebCore::IntSize&);
 
     // Back/Forward list management
index 094072cbeeb9266a7a80ea6cc37b4696129d3595..6c86cebd40b82ff4a7712172fb8decaeb303dd56 100644 (file)
@@ -103,6 +103,14 @@ String WebUIClient::runJavaScriptPrompt(WebPageProxy* page, const String& messag
     return result;
 }
 
+void WebUIClient::setStatusText(WebPageProxy* page, const String& text)
+{
+    if (!m_pageUIClient.setStatusText)
+        return;
+
+    m_pageUIClient.setStatusText(toRef(page), toRef(text.impl()), m_pageUIClient.clientInfo);
+}
+
 void WebUIClient::contentsSizeChanged(WebPageProxy* page, const IntSize& size, WebFrameProxy* frame)
 {
     if (!m_pageUIClient.contentsSizeChanged)
index ec530de0a2575a26869953ab3f721f3df75c4338..22cc87de6c05e76debf623397baba26b7edbcba9 100644 (file)
@@ -50,6 +50,7 @@ public:
     void runJavaScriptAlert(WebPageProxy*, const WTF::String&, WebFrameProxy*);
     bool runJavaScriptConfirm(WebPageProxy*, const WTF::String&, WebFrameProxy*);
     WTF::String runJavaScriptPrompt(WebPageProxy*, const WTF::String&, const WTF::String&, WebFrameProxy*);
+    void setStatusText(WebPageProxy*, const String&);
     void contentsSizeChanged(WebPageProxy*, const WebCore::IntSize&, WebFrameProxy*);
 
 private:
index 1281a66c2109d4af4e99166a35bd8f4e010705ca..1abe1b082fba8c3f0e82085b842e4d52be2800aa 100644 (file)
@@ -282,7 +282,7 @@ void WebChromeClient::setStatusbarText(const String& statusbarText)
     // Notify the bundle client.
     m_page->injectedBundleUIClient().willSetStatusbarText(m_page, statusbarText);
 
-    notImplemented();
+    WebProcess::shared().connection()->send(WebPageProxyMessage::SetStatusText, m_page->pageID(), statusbarText);
 }
 
 bool WebChromeClient::shouldInterruptJavaScript()
index 3cbe0bbe7c16a8e02b2eb2377888973693f6fafc..558022c28138d42b535a07e7fb2302d09411dd11 100644 (file)
@@ -1,3 +1,25 @@
+2010-09-11  Sam Weinig  <sam@webkit.org>
+
+        Reviewed by Dan Bernstein.
+
+        Implement WebKit2 callback equivalent to - [WebUIDelegate webView:setStatusText:]
+        <rdar://problem/8359252>
+        https://bugs.webkit.org/show_bug.cgi?id=45605
+
+        * MiniBrowser/mac/BrowserWindowController.m:
+        (setStatusText):
+        (contentsSizeChanged):
+        (-[BrowserWindowController awakeFromNib]):
+        * MiniBrowser/win/BrowserView.cpp:
+        (runJavaScriptConfirm):
+        (runJavaScriptPrompt):
+        (setStatusText):
+        (contentsSizeChanged):
+        (BrowserView::create):
+        * WebKitTestRunner/TestController.cpp:
+        (WTR::createOtherPage):
+        (WTR::TestController::initialize):
+
 2010-09-11  Sam Weinig  <sam@webkit.org>
 
         Reviewed by Dan Bernstein.
index eb7784f02ec35f6675b0af129fd9e10c574d0f69..43351e5ab4d1605d2f9eea3f62808d16ab6663ca 100644 (file)
@@ -461,6 +461,16 @@ static WKStringRef runJavaScriptPrompt(WKPageRef page, WKStringRef message, WKSt
     return WKStringCreateWithCFString((CFStringRef)result);
 }
 
+static void setStatusText(WKPageRef page, WKStringRef text, const void* clientInfo)
+{
+    LOG(@"setStatusText");
+}
+
+static void contentsSizeChanged(WKPageRef page, int width, int height, WKFrameRef frame, const void *clientInfo)
+{
+    LOG(@"contentsSizeChanged");
+}
+
 - (void)awakeFromNib
 {
     _webView = [[WKView alloc] initWithFrame:[containerView frame] pageNamespaceRef:_pageNamespace];
@@ -511,7 +521,8 @@ static WKStringRef runJavaScriptPrompt(WKPageRef page, WKStringRef message, WKSt
         runJavaScriptAlert,
         runJavaScriptConfirm,
         runJavaScriptPrompt,
-        0           /* contentsSizeChanged */
+        setStatusText,
+        contentsSizeChanged
     };
     WKPageSetPageUIClient(_webView.pageRef, &uiClient);
 }
index d3d5e72b22ac338011bbe85734380362a68dd8f9..919451ddd14c636b2e76b8c614a0645b061fc9f3 100644 (file)
@@ -60,6 +60,21 @@ static void runJavaScriptAlert(WKPageRef page, WKStringRef alertText, WKFrameRef
 {
 }
 
+static bool runJavaScriptConfirm(WKPageRef page, WKStringRef message, WKFrameRef frame, const void* clientInfo)
+{
+}
+
+static WKStringRef runJavaScriptPrompt(WKPageRef page, WKStringRef message, WKStringRef defaultValue, WKFrameRef frame, const void* clientInfo)
+{
+}
+
+static void setStatusText(WKPageRef page, WKStringRef text, const void* clientInfo)
+{
+}
+
+static void contentsSizeChanged(WKPageRef page, int width, int height, WKFrameRef frame, const void *clientInfo)
+{
+}
 
 void BrowserView::create(RECT webViewRect, BrowserWindow* parentWindow)
 {
@@ -84,8 +99,12 @@ void BrowserView::create(RECT webViewRect, BrowserWindow* parentWindow)
         showPage,
         closePage,
         runJavaScriptAlert,
-        0               /* contentsSizeChanged */
+        runJavaScriptConfirm,
+        runJavaScriptPrompt,
+        setStatusText,
+        contentsSizeChanged
     };
+
     WKPageSetPageUIClient(WKViewGetPage(m_webView), &uiClient);
 }
 
index 6f97b9fd98341e58005eb13e9612cd0507d459d8..0cea616588c6d9862fdce51b1e5cc482f0efb12f 100644 (file)
@@ -83,6 +83,7 @@ static WKPageRef createOtherPage(WKPageRef oldPage, const void*)
         0,
         0,
         0,
+        0,
         0
     };
     WKPageSetPageUIClient(newPage, &otherPageUIClient);
@@ -160,6 +161,7 @@ void TestController::initialize(int argc, const char* argv[])
         0,
         0,
         0,
+        0,
         0
     };
     WKPageSetPageUIClient(m_mainWebView->page(), &pageUIClient);