| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "ui/aura/toplevel_window_container.h" | 5 #include "ui/aura/toplevel_window_container.h" |
| 6 | 6 |
| 7 #include "base/utf_string_conversions.h" | 7 #include "base/utf_string_conversions.h" |
| 8 #include "ui/aura/toplevel_window_event_filter.h" | 8 #include "ui/aura/toplevel_window_event_filter.h" |
| 9 | 9 |
| 10 namespace aura { | 10 namespace aura { |
| 11 namespace internal { | |
| 12 | 11 |
| 13 ToplevelWindowContainer::ToplevelWindowContainer() | 12 ToplevelWindowContainer::ToplevelWindowContainer() |
| 14 : Window(NULL) { | 13 : Window(NULL) { |
| 15 set_name("ToplevelWindowContainer"); | 14 set_name("ToplevelWindowContainer"); |
| 16 SetEventFilter(new ToplevelWindowEventFilter(this)); | 15 SetEventFilter(new ToplevelWindowEventFilter(this)); |
| 17 } | 16 } |
| 18 | 17 |
| 19 ToplevelWindowContainer::~ToplevelWindowContainer() { | 18 ToplevelWindowContainer::~ToplevelWindowContainer() { |
| 20 } | 19 } |
| 21 | 20 |
| 22 bool ToplevelWindowContainer::IsToplevelWindowContainer() const { | 21 Window* ToplevelWindowContainer::GetTopmostWindowToActivate( |
| 23 return true; | 22 Window* ignore) const { |
| 23 for (Window::Windows::const_reverse_iterator i = children().rbegin(); |
| 24 i != children().rend(); ++i) { |
| 25 if (*i != ignore && (*i)->CanActivate()) |
| 26 return *i; |
| 27 } |
| 28 return NULL; |
| 24 } | 29 } |
| 25 | 30 |
| 26 } // namespace internal | 31 ToplevelWindowContainer* ToplevelWindowContainer::AsToplevelWindowContainer() { |
| 32 return this; |
| 33 } |
| 34 |
| 35 const ToplevelWindowContainer* |
| 36 ToplevelWindowContainer::AsToplevelWindowContainer() const { |
| 37 return this; |
| 38 } |
| 27 } // namespace aura | 39 } // namespace aura |
| OLD | NEW |