Index: ash/container_delegate_aura.cc |
diff --git a/ash/container_delegate_aura.cc b/ash/container_delegate_aura.cc |
new file mode 100644 |
index 0000000000000000000000000000000000000000..976a3338ea59eee3f88c7c9d8d8780e8e35bfa64 |
--- /dev/null |
+++ b/ash/container_delegate_aura.cc |
@@ -0,0 +1,37 @@ |
+// Copyright 2016 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#include "ash/container_delegate_aura.h" |
+ |
+#include "ash/root_window_controller.h" |
+#include "ash/shell_window_ids.h" |
+#include "ui/views/widget/widget.h" |
+ |
+namespace ash { |
+namespace { |
+ |
+bool IsInContainer(views::Widget* widget, int container_id) { |
+ aura::Window* window = widget->GetNativeWindow(); |
+ RootWindowController* root_controller = |
+ GetRootWindowController(window->GetRootWindow()); |
+ if (!root_controller) |
+ return false; |
+ return root_controller->GetContainer(container_id)->Contains(window); |
+} |
+ |
+} // namespace |
+ |
+ContainerDelegateAura::ContainerDelegateAura() {} |
+ |
+ContainerDelegateAura::~ContainerDelegateAura() {} |
+ |
+bool ContainerDelegateAura::IsInMenuContainer(views::Widget* widget) { |
+ return IsInContainer(widget, kShellWindowId_MenuContainer); |
+} |
+ |
+bool ContainerDelegateAura::IsInStatusContainer(views::Widget* widget) { |
+ return IsInContainer(widget, kShellWindowId_StatusContainer); |
+} |
+ |
+} // namespace ash |