Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(328)

Unified Diff: third_party/WebKit/Source/web/WebViewImpl.cpp

Issue 1991273003: Fire visibilityChange event on out-of-process iframes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix android test+naming Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/web/WebViewImpl.cpp
diff --git a/third_party/WebKit/Source/web/WebViewImpl.cpp b/third_party/WebKit/Source/web/WebViewImpl.cpp
index fad565d27c6eaef57d89c1087056567fb40a7363..502a27776939782eea2731eb7285c31c839bf296 100644
--- a/third_party/WebKit/Source/web/WebViewImpl.cpp
+++ b/third_party/WebKit/Source/web/WebViewImpl.cpp
@@ -333,16 +333,16 @@ private:
// WebView ----------------------------------------------------------------
-WebView* WebView::create(WebViewClient* client)
+WebView* WebView::create(WebViewClient* client, bool isVisible)
{
// Pass the WebViewImpl's self-reference to the caller.
- return WebViewImpl::create(client);
+ return WebViewImpl::create(client, isVisible);
}
-WebViewImpl* WebViewImpl::create(WebViewClient* client)
+WebViewImpl* WebViewImpl::create(WebViewClient* client, bool isVisible)
{
// Pass the WebViewImpl's self-reference to the caller.
- return adoptRef(new WebViewImpl(client)).leakRef();
+ return adoptRef(new WebViewImpl(client, isVisible)).leakRef();
}
void WebView::setUseExternalPopupMenus(bool useExternalPopupMenus)
@@ -400,7 +400,7 @@ HashSet<WebViewImpl*>& WebViewImpl::allInstances()
return allInstances;
}
-WebViewImpl::WebViewImpl(WebViewClient* client)
+WebViewImpl::WebViewImpl(WebViewClient* client, bool isVisible)
: m_client(client)
, m_spellCheckClient(nullptr)
, m_chromeClientImpl(ChromeClientImpl::create(this))
@@ -468,9 +468,7 @@ WebViewImpl::WebViewImpl(WebViewClient* client)
provideDedicatedWorkerGlobalScopeProxyProviderTo(*m_page, DedicatedWorkerGlobalScopeProxyProviderImpl::create());
StorageNamespaceController::provideStorageNamespaceTo(*m_page, &m_storageClientImpl);
- if (m_client) {
- setVisibilityState(m_client->visibilityState(), true);
- }
+ setVisibilityState(isVisible ? WebPageVisibilityStateVisible : WebPageVisibilityStateHidden, true);
initializeLayerTreeView();

Powered by Google App Engine
This is Rietveld 408576698