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

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

Issue 228333002: Close the created popup widget on blurring a WebContents regardless of whether the renderer process… Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 8 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 a19fcd9921d563c334e361a83b4689aad1dc658e..b1c64755938144bbb9f88bd435287d730b51f1d4 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -338,6 +338,7 @@ WebContentsImpl::WebContentsImpl(
color_chooser_identifier_(0),
render_view_message_source_(NULL),
fullscreen_widget_routing_id_(MSG_ROUTING_NONE),
+ current_popup_host_view_(NULL),
is_subframe_(false) {
for (size_t i = 0; i < g_created_callbacks.Get().size(); i++)
g_created_callbacks.Get().at(i).Run(this);
@@ -987,6 +988,11 @@ void WebContentsImpl::WasHidden() {
FOR_EACH_OBSERVER(WebContentsObserver, observers_, WasHidden());
+ if (current_popup_host_view_) {
+ current_popup_host_view_->Destroy();
+ current_popup_host_view_ = NULL;
+ }
+
should_normally_be_visible_ = false;
}
@@ -1030,6 +1036,9 @@ void WebContentsImpl::Observe(int type,
break;
}
}
+ if (host->GetView() == current_popup_host_view_) {
+ current_popup_host_view_ = NULL;
+ }
break;
}
default:
@@ -1565,6 +1574,8 @@ void WebContentsImpl::ShowCreatedWidget(int route_id,
widget_host_view->Focus();
} else {
widget_host_view->InitAsPopup(GetRenderWidgetHostViewPort(), initial_pos);
+ DCHECK(!current_popup_host_view_);
+ current_popup_host_view_ = widget_host_view;
}
RenderWidgetHostImpl* render_widget_host_impl =
« 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