diff options
author | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-10-07 21:02:59 +0000 |
---|---|---|
committer | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-10-07 21:02:59 +0000 |
commit | 87b0d82e3a7323306b3a5b7c94a01226ab601254 (patch) | |
tree | 54f9d25c8e9e71ba1fb2bdbbfad23d7e94f46190 /ui/aura/toplevel_window_container.cc | |
parent | 39944f52a7d6495574b27443f9d935a76c5d488a (diff) | |
download | chromium_src-87b0d82e3a7323306b3a5b7c94a01226ab601254.zip chromium_src-87b0d82e3a7323306b3a5b7c94a01226ab601254.tar.gz chromium_src-87b0d82e3a7323306b3a5b7c94a01226ab601254.tar.bz2 |
Changes the way windows are parented when their parent is set to NULL.. Adds a DesktopDelegate interface implemented by the aura client. The implementor handles parenting of windows when their parent is set to NULL, and also figures out how to activate windows.. Replaces Desktop::default_parent() with this. Requires adjusting some of the tests and adding a TestDesktopDelegate implementation that reconstructs what default_parent did.BUG=noneTEST=existing unit tests
Review URL: http://codereview.chromium.org/8194004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@104558 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/aura/toplevel_window_container.cc')
-rw-r--r-- | ui/aura/toplevel_window_container.cc | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/ui/aura/toplevel_window_container.cc b/ui/aura/toplevel_window_container.cc index e171d9e..eeb8f04 100644 --- a/ui/aura/toplevel_window_container.cc +++ b/ui/aura/toplevel_window_container.cc @@ -8,7 +8,6 @@ #include "ui/aura/toplevel_window_event_filter.h" namespace aura { -namespace internal { ToplevelWindowContainer::ToplevelWindowContainer() : Window(NULL) { @@ -19,9 +18,23 @@ ToplevelWindowContainer::ToplevelWindowContainer() ToplevelWindowContainer::~ToplevelWindowContainer() { } -bool ToplevelWindowContainer::IsToplevelWindowContainer() const { - return true; +Window* ToplevelWindowContainer::GetTopmostWindowToActivate( + Window* ignore) const { + for (Window::Windows::const_reverse_iterator i = children().rbegin(); + i != children().rend(); ++i) { + Window* w = *i; + if (*i != ignore && (*i)->CanActivate()) + return *i; + } + return NULL; } -} // namespace internal +ToplevelWindowContainer* ToplevelWindowContainer::AsToplevelWindowContainer() { + return this; +} + +const ToplevelWindowContainer* + ToplevelWindowContainer::AsToplevelWindowContainer() const { + return this; +} } // namespace aura |