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