Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1154)

Unified Diff: ash/container_delegate_aura.cc

Issue 1949823002: WIP: Eliminate event.target() usage from TrayEventFilter (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: container delegate Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/container_delegate_aura.h ('k') | ash/mus/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « ash/container_delegate_aura.h ('k') | ash/mus/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698