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

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: . 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
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 =
sky 2016/05/06 21:20:46 Use GetMusWindow, that way you don't need casts. A
James Cook 2016/05/06 22:46:24 Done.
26 static_cast<views::NativeWidgetMus*>(widget->native_widget())->window();
27 if (window->HasSharedProperty(mash::wm::mojom::kWindowContainer_Property))
28 return container ==
29 static_cast<Container>(window->GetSharedProperty<int32_t>(
30 mash::wm::mojom::kWindowContainer_Property));
31
32 return false;
33 }
34
35 } // namespace
36
37 ContainerDelegateMus::ContainerDelegateMus() {}
38
39 ContainerDelegateMus::~ContainerDelegateMus() {}
40
41 bool ContainerDelegateMus::IsInMenuContainer(views::Widget* widget) {
42 return IsInContainer(widget, Container::MENUS);
43 }
44
45 bool ContainerDelegateMus::IsInStatusContainer(views::Widget* widget) {
46 return IsInContainer(widget, Container::STATUS);
47 }
48
49 } // namespace sysui
50 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698