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

Side by Side Diff: ash/mus/container_delegate_mus.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/mus/container_delegate_mus.h ('k') | ash/mus/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/mus/container_delegate_mus.h"
6
7 #include <stdint.h>
8
9 #include "components/mus/public/cpp/property_type_converters.h"
10 #include "components/mus/public/cpp/window.h"
11 #include "components/mus/public/cpp/window_property.h"
12 #include "mash/wm/public/interfaces/container.mojom.h"
13 #include "ui/views/mus/native_widget_mus.h"
14 #include "ui/views/widget/widget.h"
15
16 using mash::wm::mojom::Container;
17
18 namespace ash {
19 namespace sysui {
20
21 namespace {
22
23 // Returns true if a top-level |widget| is in |container|.
24 bool IsInContainer(views::Widget* widget, Container container) {
25 mus::Window* window = static_cast<views::NativeWidgetMus*>(widget
26 ->native_widget())->window();
27 if (window->HasSharedProperty(mash::wm::mojom::kWindowContainer_Property)) {
28 Container c = static_cast<Container>(window->GetSharedProperty<int32_t>(
29 mash::wm::mojom::kWindowContainer_Property));
30 LOG(ERROR) << "JAMES IsInContainer got " << c;
31 return container == c; //JAMES inline me
32 }
33 return false;
34 }
35
36 } // namespace
37
38 ContainerDelegateMus::ContainerDelegateMus() {}
39
40 ContainerDelegateMus::~ContainerDelegateMus() {}
41
42 bool ContainerDelegateMus::IsInMenuContainer(views::Widget* widget) {
43 return IsInContainer(widget, Container::MENUS);
44 }
45
46 bool ContainerDelegateMus::IsInStatusContainer(views::Widget* widget) {
47 return IsInContainer(widget, Container::STATUS);
48 }
49
50 } // namespace sysui
51 } // namespace ash
OLDNEW
« no previous file with comments | « ash/mus/container_delegate_mus.h ('k') | ash/mus/shell_delegate_mus.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698