- Revision
- 87421
- Author
- [email protected]
- Date
- 2011-05-26 12:48:46 -0700 (Thu, 26 May 2011)
Log Message
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>
Reviewed by Adam Roben.
Source/WebKit2:
* 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.
Tools:
* WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
(WTR::InjectedBundlePage::InjectedBundlePage): Add empty entries in the WKBundlePageUIClient.
Modified Paths
Diff
Modified: trunk/Source/WebKit2/ChangeLog (87420 => 87421)
--- trunk/Source/WebKit2/ChangeLog 2011-05-26 19:46:23 UTC (rev 87420)
+++ trunk/Source/WebKit2/ChangeLog 2011-05-26 19:48:46 UTC (rev 87421)
@@ -1,3 +1,23 @@
+2011-05-25 Brian Weinstein <[email protected]>
+
+ 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-26 Steve Falkenburg <[email protected]>
Reviewed by Adam Roben.
Modified: trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.h (87420 => 87421)
--- trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.h 2011-05-26 19:46:23 UTC (rev 87420)
+++ trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.h 2011-05-26 19:48:46 UTC (rev 87421)
@@ -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: trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageUIClient.cpp (87420 => 87421)
--- trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageUIClient.cpp 2011-05-26 19:46:23 UTC (rev 87420)
+++ trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageUIClient.cpp 2011-05-26 19:48:46 UTC (rev 87421)
@@ -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: trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageUIClient.h (87420 => 87421)
--- trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageUIClient.h 2011-05-26 19:46:23 UTC (rev 87420)
+++ trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageUIClient.h 2011-05-26 19:48:46 UTC (rev 87421)
@@ -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: trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp (87420 => 87421)
--- trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp 2011-05-26 19:46:23 UTC (rev 87420)
+++ trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp 2011-05-26 19:48:46 UTC (rev 87421)
@@ -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: trunk/Tools/ChangeLog (87420 => 87421)
--- trunk/Tools/ChangeLog 2011-05-26 19:46:23 UTC (rev 87420)
+++ trunk/Tools/ChangeLog 2011-05-26 19:48:46 UTC (rev 87421)
@@ -1,3 +1,14 @@
+2011-05-25 Brian Weinstein <[email protected]>
+
+ 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-26 Andreas Kling <[email protected]>
Unreviewed, correct address to webkit-committers mailing list.
Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp (87420 => 87421)
--- trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp 2011-05-26 19:46:23 UTC (rev 87420)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp 2011-05-26 19:48:46 UTC (rev 87421)
@@ -226,6 +226,9 @@
0, /*shouldGenerateFileForUpload*/
0, /*generateFileForUpload*/
0, /*shouldRubberBandInDirection*/
+ 0, /*statusBarIsVisible*/
+ 0, /*menuBarIsVisible*/
+ 0, /*toolbarsAreVisible*/
};
WKBundlePageSetUIClient(m_page, &uiClient);