Title: [87562] branches/safari-534-branch

Diff

Modified: branches/safari-534-branch/Source/WebKit2/ChangeLog (87561 => 87562)


--- branches/safari-534-branch/Source/WebKit2/ChangeLog	2011-05-27 21:05:00 UTC (rev 87561)
+++ branches/safari-534-branch/Source/WebKit2/ChangeLog	2011-05-27 21:08:11 UTC (rev 87562)
@@ -1,5 +1,29 @@
 2011-05-27  Mark Rowe  <mr...@apple.com>
 
+        Merge r87421.
+
+    2011-05-25  Brian Weinstein  <bweinst...@apple.com>
+
+        Reviewed by Adam Roben.
+
+        WebKit2: Status bar, toolbar, and menu bar checks should be in the injected bundle
+        https://bugs.webkit.org/show_bug.cgi?id=61474
+        <rdar://problem/9468337>
+
+        * WebProcess/InjectedBundle/API/c/WKBundlePage.h:
+        * WebProcess/InjectedBundle/InjectedBundlePageUIClient.cpp:
+        (WebKit::InjectedBundlePageUIClient::statusBarIsVisible): Call the function on the client
+            if it exists.
+        (WebKit::InjectedBundlePageUIClient::menuBarIsVisible): Ditto.
+        (WebKit::InjectedBundlePageUIClient::toolbarsAreVisible): Ditto.
+        * WebProcess/InjectedBundle/InjectedBundlePageUIClient.h:
+        * WebProcess/WebCoreSupport/WebChromeClient.cpp:
+        (WebKit::WebChromeClient::statusbarVisible): Add a possible short-circuit in the injected bundle.
+        (WebKit::WebChromeClient::menubarVisible): Ditto.
+        (WebKit::WebChromeClient::toolbarsVisible): Ditto.
+
+2011-05-27  Mark Rowe  <mr...@apple.com>
+
         Merge r87335.
 
     2011-05-25  Mark Rowe  <mr...@apple.com>

Modified: branches/safari-534-branch/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.h (87561 => 87562)


--- branches/safari-534-branch/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.h	2011-05-27 21:05:00 UTC (rev 87561)
+++ branches/safari-534-branch/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.h	2011-05-27 21:08:11 UTC (rev 87562)
@@ -171,6 +171,13 @@
 };
 typedef struct WKBundlePageResourceLoadClient WKBundlePageResourceLoadClient;
 
+enum {
+    WKBundlePageUIElementVisibilityUnknown,
+    WKBundlePageUIElementVisible,
+    WKBundlePageUIElementHidden
+};
+typedef uint32_t WKBundlePageUIElementVisibility;
+    
 // UI Client
 typedef void (*WKBundlePageWillAddMessageToConsoleCallback)(WKBundlePageRef page, WKStringRef message, uint32_t lineNumber, const void *clientInfo);
 typedef void (*WKBundlePageWillSetStatusbarTextCallback)(WKBundlePageRef page, WKStringRef statusbarText, const void *clientInfo);
@@ -182,6 +189,9 @@
 typedef void (*WKBundlePagePaintCustomOverhangAreaCallback)(WKBundlePageRef page, WKGraphicsContextRef graphicsContext, WKRect horizontalOverhang, WKRect verticalOverhang, WKRect dirtyRect, const void* clientInfo);
 typedef WKStringRef (*WKBundlePageGenerateFileForUploadCallback)(WKBundlePageRef page, WKStringRef originalFilePath, const void* clientInfo);
 typedef bool (*WKBundlePageShouldRubberBandInDirectionCallback)(WKBundlePageRef page, WKScrollDirection scrollDirection, const void* clientInfo);
+typedef WKBundlePageUIElementVisibility (*WKBundlePageStatusBarIsVisible)(WKBundlePageRef page, const void *clientInfo);
+typedef WKBundlePageUIElementVisibility (*WKBundlePageMenuBarIsVisible)(WKBundlePageRef page, const void *clientInfo);
+typedef WKBundlePageUIElementVisibility (*WKBundlePageToolbarsAreVisible)(WKBundlePageRef page, const void *clientInfo);
     
 struct WKBundlePageUIClient {
     int                                                                 version;
@@ -197,6 +207,9 @@
     WKBundlePageGenerateFileForUploadCallback                           shouldGenerateFileForUpload;
     WKBundlePageGenerateFileForUploadCallback                           generateFileForUpload;
     WKBundlePageShouldRubberBandInDirectionCallback                     shouldRubberBandInDirection;
+    WKBundlePageStatusBarIsVisible                                      statusBarIsVisible;
+    WKBundlePageMenuBarIsVisible                                        menuBarIsVisible;
+    WKBundlePageToolbarsAreVisible                                      toolbarsAreVisible;
 };
 typedef struct WKBundlePageUIClient WKBundlePageUIClient;
 

Modified: branches/safari-534-branch/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageUIClient.cpp (87561 => 87562)


--- branches/safari-534-branch/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageUIClient.cpp	2011-05-27 21:05:00 UTC (rev 87561)
+++ branches/safari-534-branch/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageUIClient.cpp	2011-05-27 21:08:11 UTC (rev 87562)
@@ -121,5 +121,29 @@
         return true;
     return m_client.shouldRubberBandInDirection(toAPI(page), direction, m_client.clientInfo);
 }
+    
+WKBundlePageUIElementVisibility InjectedBundlePageUIClient::statusBarIsVisible(WebPage* page)
+{
+    if (!m_client.statusBarIsVisible)
+        return WKBundlePageUIElementVisibilityUnknown;
+    
+    return m_client.statusBarIsVisible(toAPI(page), m_client.clientInfo);
+}
 
+WKBundlePageUIElementVisibility InjectedBundlePageUIClient::menuBarIsVisible(WebPage* page)
+{
+    if (!m_client.menuBarIsVisible)
+        return WKBundlePageUIElementVisibilityUnknown;
+    
+    return m_client.menuBarIsVisible(toAPI(page), m_client.clientInfo);
+}
+
+WKBundlePageUIElementVisibility InjectedBundlePageUIClient::toolbarsAreVisible(WebPage* page)
+{
+    if (!m_client.toolbarsAreVisible)
+        return WKBundlePageUIElementVisibilityUnknown;
+    
+    return m_client.toolbarsAreVisible(toAPI(page), m_client.clientInfo);
+}
+
 } // namespace WebKit

Modified: branches/safari-534-branch/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageUIClient.h (87561 => 87562)


--- branches/safari-534-branch/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageUIClient.h	2011-05-27 21:05:00 UTC (rev 87561)
+++ branches/safari-534-branch/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageUIClient.h	2011-05-27 21:08:11 UTC (rev 87562)
@@ -60,6 +60,10 @@
     String generateFileForUpload(WebPage*, const String& originalFilePath);
     
     bool shouldRubberBandInDirection(WebPage*, WKScrollDirection) const;
+
+    WKBundlePageUIElementVisibility statusBarIsVisible(WebPage*);
+    WKBundlePageUIElementVisibility menuBarIsVisible(WebPage*);
+    WKBundlePageUIElementVisibility toolbarsAreVisible(WebPage*);
 };
 
 } // namespace WebKit

Modified: branches/safari-534-branch/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp (87561 => 87562)


--- branches/safari-534-branch/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp	2011-05-27 21:05:00 UTC (rev 87561)
+++ branches/safari-534-branch/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp	2011-05-27 21:08:11 UTC (rev 87562)
@@ -198,6 +198,10 @@
 
 bool WebChromeClient::toolbarsVisible()
 {
+    WKBundlePageUIElementVisibility toolbarsVisibility = m_page->injectedBundleUIClient().toolbarsAreVisible(m_page);
+    if (toolbarsVisibility != WKBundlePageUIElementVisibilityUnknown)
+        return toolbarsVisibility == WKBundlePageUIElementVisible;
+    
     bool toolbarsAreVisible = true;
     if (!WebProcess::shared().connection()->sendSync(Messages::WebPageProxy::GetToolbarsAreVisible(), Messages::WebPageProxy::GetToolbarsAreVisible::Reply(toolbarsAreVisible), m_page->pageID()))
         return true;
@@ -212,6 +216,10 @@
 
 bool WebChromeClient::statusbarVisible()
 {
+    WKBundlePageUIElementVisibility statusbarVisibility = m_page->injectedBundleUIClient().statusBarIsVisible(m_page);
+    if (statusbarVisibility != WKBundlePageUIElementVisibilityUnknown)
+        return statusbarVisibility == WKBundlePageUIElementVisible;
+
     bool statusBarIsVisible = true;
     if (!WebProcess::shared().connection()->sendSync(Messages::WebPageProxy::GetStatusBarIsVisible(), Messages::WebPageProxy::GetStatusBarIsVisible::Reply(statusBarIsVisible), m_page->pageID()))
         return true;
@@ -237,6 +245,10 @@
 
 bool WebChromeClient::menubarVisible()
 {
+    WKBundlePageUIElementVisibility menubarVisibility = m_page->injectedBundleUIClient().menuBarIsVisible(m_page);
+    if (menubarVisibility != WKBundlePageUIElementVisibilityUnknown)
+        return menubarVisibility == WKBundlePageUIElementVisible;
+    
     bool menuBarIsVisible = true;
     if (!WebProcess::shared().connection()->sendSync(Messages::WebPageProxy::GetMenuBarIsVisible(), Messages::WebPageProxy::GetMenuBarIsVisible::Reply(menuBarIsVisible), m_page->pageID()))
         return true;

Modified: branches/safari-534-branch/Tools/ChangeLog (87561 => 87562)


--- branches/safari-534-branch/Tools/ChangeLog	2011-05-27 21:05:00 UTC (rev 87561)
+++ branches/safari-534-branch/Tools/ChangeLog	2011-05-27 21:08:11 UTC (rev 87562)
@@ -1,5 +1,20 @@
 2011-05-27  Mark Rowe  <mr...@apple.com>
 
+        Merge r87421.
+
+    2011-05-25  Brian Weinstein  <bweinst...@apple.com>
+
+        Reviewed by Adam Roben.
+
+        WebKit2: Status bar, toolbar, and menu bar checks should be in the injected bundle
+        https://bugs.webkit.org/show_bug.cgi?id=61474
+        <rdar://problem/9468337>
+
+        * WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
+        (WTR::InjectedBundlePage::InjectedBundlePage): Add empty entries in the WKBundlePageUIClient.
+
+2011-05-27  Mark Rowe  <mr...@apple.com>
+
         Merge r87324.
 
     2011-05-25  Jon Honeycutt  <jhoneyc...@apple.com>

Modified: branches/safari-534-branch/Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp (87561 => 87562)


--- branches/safari-534-branch/Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp	2011-05-27 21:05:00 UTC (rev 87561)
+++ branches/safari-534-branch/Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp	2011-05-27 21:08:11 UTC (rev 87562)
@@ -226,6 +226,9 @@
         0, /*shouldGenerateFileForUpload*/
         0, /*generateFileForUpload*/
         0, /*shouldRubberBandInDirection*/
+        0, /*statusBarIsVisible*/
+        0, /*menuBarIsVisible*/
+        0, /*toolbarsAreVisible*/
     };
     WKBundlePageSetUIClient(m_page, &uiClient);
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to