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

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

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_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 3cae1cc9100ed874ac25d94e75629e9e481fdf19..233ab997d05f1d6ebedffe0b2cb11eba368cba37 100644
--- a/content/browser/web_contents/web_contents_view_aura.cc
+++ b/content/browser/web_contents/web_contents_view_aura.cc
@@ -660,9 +660,7 @@ WebContentsViewAura::WebContentsViewAura(WebContentsImpl* web_contents,
current_rvh_for_drag_(NULL),
current_overscroll_gesture_(OVERSCROLL_NONE),
completed_overscroll_gesture_(OVERSCROLL_NONE),
- navigation_overlay_(nullptr),
- is_or_was_visible_(false) {
-}
+ navigation_overlay_(nullptr) {}
void WebContentsViewAura::SetDelegateForTesting(
WebContentsViewDelegate* delegate) {
@@ -1298,30 +1296,7 @@ void WebContentsViewAura::OnWindowVisibilityChanged(aura::Window* window,
if (window != window_.get() && window_->Contains(window))
return;
- UpdateWebContentsVisibility(visible);
-}
-
-void WebContentsViewAura::UpdateWebContentsVisibility(bool 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
- // content got loaded. In this state the window content is undefined and can
- // show garbage.
- // However - the page load mechanism requires an activation call through a
- // visibility call to (re)load.
- if (visible) {
- is_or_was_visible_ = true;
- web_contents_->WasShown();
- }
- return;
- }
- if (visible) {
- if (!web_contents_->should_normally_be_visible())
- web_contents_->WasShown();
- } else {
- if (web_contents_->should_normally_be_visible())
- web_contents_->WasHidden();
- }
+ web_contents_->UpdateWebContentsVisibility(visible);
}
} // namespace content

Powered by Google App Engine
This is Rietveld 408576698