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

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

Issue 1733173002: Mac: Make calling WebContents::WasShown/WasHidden the responsibility of the content layer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Respond to comments Created 4 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.h
diff --git a/content/browser/web_contents/web_contents_impl.h b/content/browser/web_contents/web_contents_impl.h
index 79c0c86e2b34d8b5df32c2775f16e94cb3222efd..266e3efb32e2fc62b34474e823879cbdce6ec4c9 100644
--- a/content/browser/web_contents/web_contents_impl.h
+++ b/content/browser/web_contents/web_contents_impl.h
@@ -728,6 +728,9 @@ class CONTENT_EXPORT WebContentsImpl
return media_web_contents_observer_.get();
}
+ // Update the web contents visibility.
+ void UpdateWebContentsVisibility(bool visible);
+
private:
friend class WebContentsObserver;
friend class WebContents; // To implement factory methods.
@@ -1166,6 +1169,12 @@ class CONTENT_EXPORT WebContentsImpl
// Tracks whether RWHV should be visible once capturer_count_ becomes zero.
bool should_normally_be_visible_;
+ // Tracks whether this WebContents was ever set to be visible. Used to
+ // facilitate WebContents being loaded in the background by setting
+ // |should_normally_be_visible_|. Ensures WasShown() will trigger when first
+ // becoming visible to the user, and prevents premature unloading.
+ bool did_first_set_visible_;
+
// See getter above.
bool is_being_destroyed_;

Powered by Google App Engine
This is Rietveld 408576698