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

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

Issue 1957653003: mash: Don't close system tray bubble for clicks in menus/notifications (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase 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/aura/mus/mus_util.h"
14 #include "ui/views/mus/native_widget_mus.h"
15 #include "ui/views/widget/widget.h"
16
17 using mash::wm::mojom::Container;
18
19 namespace ash {
20 namespace sysui {
21
22 namespace {
23
24 // Returns true if |widget| is in |container|.
25 bool IsInContainer(views::Widget* widget, Container container) {
26 mus::Window* window =
27 aura::GetMusWindow(widget->GetTopLevelWidget()->GetNativeWindow());
28 if (window->HasSharedProperty(mash::wm::mojom::kWindowContainer_Property))
29 return container ==
30 static_cast<Container>(window->GetSharedProperty<int32_t>(
31 mash::wm::mojom::kWindowContainer_Property));
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