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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « ash/container_delegate_aura.h ('k') | ash/mus/BUILD.gn » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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/root_window_controller.h"
8 #include "ash/shell_window_ids.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
OLDNEW
« 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