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

Unified Diff: content/browser/renderer_host/render_widget_host_view_aura.cc

Issue 115453004: Moves management of transients out of Window (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: remove unneeded parens Created 6 years, 11 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 | « chrome/browser/ui/views/extensions/extension_popup.cc ('k') | ui/aura/aura.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/render_widget_host_view_aura.cc
diff --git a/content/browser/renderer_host/render_widget_host_view_aura.cc b/content/browser/renderer_host/render_widget_host_view_aura.cc
index 80797bd6c895ae26f3d3b13c1f0d15d296dad930..a45ad0b6f19acb831497bd1aa89b836a67e92d9d 100644
--- a/content/browser/renderer_host/render_widget_host_view_aura.cc
+++ b/content/browser/renderer_host/render_widget_host_view_aura.cc
@@ -55,6 +55,7 @@
#include "ui/aura/client/focus_client.h"
#include "ui/aura/client/screen_position_client.h"
#include "ui/aura/client/tooltip_client.h"
+#include "ui/aura/client/transient_window_client.h"
#include "ui/aura/client/window_tree_client.h"
#include "ui/aura/env.h"
#include "ui/aura/root_window.h"
@@ -504,6 +505,9 @@ void RenderWidgetHostViewAura::InitAsPopup(
popup_parent_host_view_ =
static_cast<RenderWidgetHostViewAura*>(parent_host_view);
+ // TransientWindowClient may be NULL during tests.
+ aura::client::TransientWindowClient* transient_window_client =
+ aura::client::GetTransientWindowClient();
RenderWidgetHostViewAura* old_child =
popup_parent_host_view_->popup_child_host_view_;
if (old_child) {
@@ -511,7 +515,10 @@ void RenderWidgetHostViewAura::InitAsPopup(
// similar mechanism to ensure a second popup doesn't cause the first one
// to never get a chance to filter events. See crbug.com/160589.
DCHECK(old_child->popup_parent_host_view_ == popup_parent_host_view_);
- popup_parent_host_view_->window_->RemoveTransientChild(old_child->window_);
+ if (transient_window_client) {
+ transient_window_client->RemoveTransientChild(
+ popup_parent_host_view_->window_, old_child->window_);
+ }
old_child->popup_parent_host_view_ = NULL;
}
popup_parent_host_view_->popup_child_host_view_ = this;
@@ -524,7 +531,10 @@ void RenderWidgetHostViewAura::InitAsPopup(
// Setting the transient child allows for the popup to get mouse events when
// in a system modal dialog.
// This fixes crbug.com/328593.
- popup_parent_host_view_->window_->AddTransientChild(window_);
+ if (transient_window_client) {
+ transient_window_client->AddTransientChild(
+ popup_parent_host_view_->window_, window_);
+ }
SetBounds(bounds_in_screen);
Show();
« no previous file with comments | « chrome/browser/ui/views/extensions/extension_popup.cc ('k') | ui/aura/aura.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698