OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "ash/container_delegate_aura.h" | 5 #include "ash/container_delegate_aura.h" |
6 | 6 |
| 7 #include "ash/common/shell_window_ids.h" |
7 #include "ash/root_window_controller.h" | 8 #include "ash/root_window_controller.h" |
8 #include "ash/shell_window_ids.h" | |
9 #include "ui/views/widget/widget.h" | 9 #include "ui/views/widget/widget.h" |
10 | 10 |
11 namespace ash { | 11 namespace ash { |
12 namespace { | 12 namespace { |
13 | 13 |
14 bool IsInContainer(views::Widget* widget, int container_id) { | 14 bool IsInContainer(views::Widget* widget, int container_id) { |
15 aura::Window* window = widget->GetNativeWindow(); | 15 aura::Window* window = widget->GetNativeWindow(); |
16 RootWindowController* root_controller = | 16 RootWindowController* root_controller = |
17 GetRootWindowController(window->GetRootWindow()); | 17 GetRootWindowController(window->GetRootWindow()); |
18 if (!root_controller) | 18 if (!root_controller) |
19 return false; | 19 return false; |
20 return root_controller->GetContainer(container_id)->Contains(window); | 20 return root_controller->GetContainer(container_id)->Contains(window); |
21 } | 21 } |
22 | 22 |
23 } // namespace | 23 } // namespace |
24 | 24 |
25 ContainerDelegateAura::ContainerDelegateAura() {} | 25 ContainerDelegateAura::ContainerDelegateAura() {} |
26 | 26 |
27 ContainerDelegateAura::~ContainerDelegateAura() {} | 27 ContainerDelegateAura::~ContainerDelegateAura() {} |
28 | 28 |
29 bool ContainerDelegateAura::IsInMenuContainer(views::Widget* widget) { | 29 bool ContainerDelegateAura::IsInMenuContainer(views::Widget* widget) { |
30 return IsInContainer(widget, kShellWindowId_MenuContainer); | 30 return IsInContainer(widget, kShellWindowId_MenuContainer); |
31 } | 31 } |
32 | 32 |
33 bool ContainerDelegateAura::IsInStatusContainer(views::Widget* widget) { | 33 bool ContainerDelegateAura::IsInStatusContainer(views::Widget* widget) { |
34 return IsInContainer(widget, kShellWindowId_StatusContainer); | 34 return IsInContainer(widget, kShellWindowId_StatusContainer); |
35 } | 35 } |
36 | 36 |
37 } // namespace ash | 37 } // namespace ash |
OLD | NEW |