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

Side by Side Diff: ash/sysui/container_delegate_mus.cc

Issue 2086143002: Convert TrayEventFilter to wm common types (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: tweak Created 4 years, 6 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/sysui/container_delegate_mus.h ('k') | ash/sysui/shell_delegate_mus.h » ('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/sysui/container_delegate_mus.h"
6
7 #include <stdint.h>
8
9 #include "ash/public/interfaces/container.mojom.h"
10 #include "components/mus/public/cpp/property_type_converters.h"
11 #include "components/mus/public/cpp/window.h"
12 #include "components/mus/public/cpp/window_property.h"
13 #include "ui/aura/mus/mus_util.h"
14 #include "ui/views/mus/native_widget_mus.h"
15 #include "ui/views/widget/widget.h"
16
17 namespace ash {
18 namespace sysui {
19
20 namespace {
21
22 // Returns true if |widget| is in |container|.
23 bool IsInContainer(views::Widget* widget, mojom::Container container) {
24 mus::Window* window =
25 aura::GetMusWindow(widget->GetTopLevelWidget()->GetNativeWindow());
26 if (window->HasSharedProperty(mojom::kWindowContainer_Property))
27 return container ==
28 static_cast<mojom::Container>(window->GetSharedProperty<int32_t>(
29 mojom::kWindowContainer_Property));
30
31 return false;
32 }
33
34 } // namespace
35
36 ContainerDelegateMus::ContainerDelegateMus() {}
37
38 ContainerDelegateMus::~ContainerDelegateMus() {}
39
40 bool ContainerDelegateMus::IsInMenuContainer(views::Widget* widget) {
41 return IsInContainer(widget, mojom::Container::MENUS);
42 }
43
44 bool ContainerDelegateMus::IsInStatusContainer(views::Widget* widget) {
45 return IsInContainer(widget, mojom::Container::STATUS);
46 }
47
48 } // namespace sysui
49 } // namespace ash
OLDNEW
« no previous file with comments | « ash/sysui/container_delegate_mus.h ('k') | ash/sysui/shell_delegate_mus.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698