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

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: 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 3b300b6e4f774eeb75b2580c72714c9d6a11a20d..6cc6d343d01f4b3d24c1cde8826b594c4b4221e7 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -1091,6 +1091,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) {
@@ -1102,7 +1106,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