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

Unified Diff: content/browser/web_contents/web_contents_impl.cc

Issue 944763002: Make Page Visibility API work when the browser window is visible or not Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove the VisibilityNotify event handler Created 5 years, 10 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: content/browser/web_contents/web_contents_impl.cc
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index 8dad3e7904accddb5d06e94501e0e4fc02ede46d..652a867f2000385755dd4853a84016e64521bd18 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -1087,6 +1087,10 @@ void WebContentsImpl::WasShown() {
}
void WebContentsImpl::WasHidden() {
+ WasHidden(false);
+}
+
+void WebContentsImpl::WasHidden(bool content_visible) {
// If there are entities capturing screenshots or video (e.g., mirroring),
// don't activate the "disable rendering" optimization.
if (capturer_count_ == 0) {
@@ -1098,7 +1102,7 @@ void WebContentsImpl::WasHidden() {
// calls us).
for (RenderWidgetHostView* view : GetRenderWidgetHostViewsInTree()) {
if (view)
- view->Hide();
+ view->Hide(content_visible);
}
// Release any video power save blockers held as video is not visible.

Powered by Google App Engine
This is Rietveld 408576698