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

Unified Diff: content/browser/web_contents/web_contents_view_aura.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_view_aura.cc
diff --git a/content/browser/web_contents/web_contents_view_aura.cc b/content/browser/web_contents/web_contents_view_aura.cc
index da9af68e420cdc09215582c10653ba5f9c4bb620..0c3d7ba93b4c8a4cbffd9e2b20c8b8c063f8fa8b 100644
--- a/content/browser/web_contents/web_contents_view_aura.cc
+++ b/content/browser/web_contents/web_contents_view_aura.cc
@@ -1610,15 +1610,17 @@ int WebContentsViewAura::OnPerformDrop(const ui::DropTargetEvent& event) {
}
void WebContentsViewAura::OnWindowVisibilityChanged(aura::Window* window,
- bool visible) {
+ bool visible,
+ bool content_visible) {
// Ignore any visibility changes in the hierarchy below.
if (window != window_.get() && window_->Contains(window))
return;
- UpdateWebContentsVisibility(visible);
+ UpdateWebContentsVisibility(visible, content_visible);
}
-void WebContentsViewAura::UpdateWebContentsVisibility(bool visible) {
+void WebContentsViewAura::UpdateWebContentsVisibility(bool visible,
+ bool content_visible) {
if (!is_or_was_visible_) {
// We should not hide the web contents before it was shown the first time,
// since resources would immediately be destroyed and only re-created after
@@ -1637,7 +1639,7 @@ void WebContentsViewAura::UpdateWebContentsVisibility(bool visible) {
web_contents_->WasShown();
} else {
if (web_contents_->should_normally_be_visible())
- web_contents_->WasHidden();
+ web_contents_->WasHidden(content_visible);
}
}

Powered by Google App Engine
This is Rietveld 408576698