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

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

Issue 321253003: Ensure show/hide are properly called on interstitial pages if present. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix test compilation, add test case for the bug. Created 6 years, 6 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
« no previous file with comments | « content/browser/web_contents/web_contents_impl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 dd371919e5d473c7b8f7960d12221e94d4997be4..f5301e6942270c392922f23b7c849daf6b234e14 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -216,9 +216,13 @@ void SendToAllFramesInternal(IPC::Message* message, RenderFrameHost* rfh) {
rfh->Send(message_copy);
}
-void AddRenderWidgetHostToSet(std::set<RenderWidgetHostImpl*>* set,
- RenderFrameHost* rfh) {
- set->insert(static_cast<RenderFrameHostImpl*>(rfh)->GetRenderWidgetHost());
+void AddRenderWidgetHostViewToSet(std::set<RenderWidgetHostView*>* set,
+ RenderFrameHost* rfh) {
+ RenderWidgetHostView* rwhv = static_cast<RenderFrameHostImpl*>(rfh)
+ ->frame_tree_node()
+ ->render_manager()
+ ->GetRenderWidgetHostView();
+ set->insert(rwhv);
}
} // namespace
@@ -941,15 +945,14 @@ base::TimeTicks WebContentsImpl::GetLastActiveTime() const {
void WebContentsImpl::WasShown() {
controller_.SetActive(true);
- std::set<RenderWidgetHostImpl*> widgets = GetRenderWidgetHostsInTree();
- for (std::set<RenderWidgetHostImpl*>::iterator iter = widgets.begin();
+ std::set<RenderWidgetHostView*> widgets = GetRenderWidgetHostViewsInTree();
+ for (std::set<RenderWidgetHostView*>::iterator iter = widgets.begin();
iter != widgets.end();
iter++) {
- RenderWidgetHostView* rwhv = (*iter)->GetView();
- if (rwhv) {
- rwhv->Show();
+ if (*iter) {
+ (*iter)->Show();
#if defined(OS_MACOSX)
- rwhv->SetActive(true);
+ (*iter)->SetActive(true);
#endif
}
}
@@ -979,13 +982,12 @@ void WebContentsImpl::WasHidden() {
// removes the |GetRenderViewHost()|; then when we actually destroy the
// window, OnWindowPosChanged() notices and calls WasHidden() (which
// calls us).
- std::set<RenderWidgetHostImpl*> widgets = GetRenderWidgetHostsInTree();
- for (std::set<RenderWidgetHostImpl*>::iterator iter = widgets.begin();
+ std::set<RenderWidgetHostView*> widgets = GetRenderWidgetHostViewsInTree();
+ for (std::set<RenderWidgetHostView*>::iterator iter = widgets.begin();
iter != widgets.end();
iter++) {
- RenderWidgetHostView* rwhv = (*iter)->GetView();
- if (rwhv)
- rwhv->Hide();
+ if (*iter)
+ (*iter)->Hide();
}
}
@@ -1142,9 +1144,15 @@ void WebContentsImpl::RemoveObserver(WebContentsObserver* observer) {
observers_.RemoveObserver(observer);
}
-std::set<RenderWidgetHostImpl*> WebContentsImpl::GetRenderWidgetHostsInTree() {
- std::set<RenderWidgetHostImpl*> set;
- ForEachFrame(base::Bind(&AddRenderWidgetHostToSet, base::Unretained(&set)));
+std::set<RenderWidgetHostView*>
+WebContentsImpl::GetRenderWidgetHostViewsInTree() {
+ std::set<RenderWidgetHostView*> set;
+ if (ShowingInterstitialPage()) {
+ set.insert(GetRenderWidgetHostView());
+ } else {
+ ForEachFrame(
+ base::Bind(&AddRenderWidgetHostViewToSet, base::Unretained(&set)));
+ }
return set;
}
« no previous file with comments | « content/browser/web_contents/web_contents_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698