diff options
author | sky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-01-07 19:52:52 +0000 |
---|---|---|
committer | sky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-01-07 19:52:52 +0000 |
commit | 751b13df3b768295e4b215aca45b9f1ea8bd373c (patch) | |
tree | 50660265c2fe6a4e81d834117c2e1f5a03d50a0e /content | |
parent | 691b2001018e28625ceeb0d4710472ff66ef9857 (diff) | |
download | chromium_src-751b13df3b768295e4b215aca45b9f1ea8bd373c.zip chromium_src-751b13df3b768295e4b215aca45b9f1ea8bd373c.tar.gz chromium_src-751b13df3b768295e4b215aca45b9f1ea8bd373c.tar.bz2 |
Moves management of transients out of Window
And into TransientWindowManager. Additionally moves handling of NULL
layer stacking into TransientStackingWindowClient. The tests that were
exercising these code paths have all been moved to ui/views/corewm.
Also wires up TransientStackingWindowClient in a couple of places that
didn't have it.
The order of removing from transient parent as well as destroying of
transient children is slightly differently than before. To get the
order exactly as it was would require some new specific observer
functions. I'm hoping we don't need those. Hopefully this doesn't
cause issues, if it does I'll revisit.
I ended up exposing convenience functions. That's because typing
something like:
views::corewm::TransientWindowManager::Get(window)->AddTransientChild()
was too much for me. There is also some subtlety in so far as the
Get() function that takes a const Window* may return NULL, where as
non-const never returns NULL.
Lastly I had to make Window friend TransientWindowManager. This is
temporary until I create a specific TransientWindowManagerObserver
that contains the two transient related observer functions in
WindowObserver.
BUG=none
TEST=none
R=ben@chromium.org
Review URL: https://codereview.chromium.org/115453004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@243368 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content')
-rw-r--r-- | content/browser/renderer_host/render_widget_host_view_aura.cc | 14 |
1 files changed, 12 insertions, 2 deletions
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 7558818..9a38126 100644 --- a/content/browser/renderer_host/render_widget_host_view_aura.cc +++ b/content/browser/renderer_host/render_widget_host_view_aura.cc @@ -56,6 +56,7 @@ #include "ui/aura/client/scoped_tooltip_disabler.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" @@ -505,6 +506,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) { @@ -512,7 +516,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; @@ -525,7 +532,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(); |