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

Unified 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 side-by-side diff with in-line comments
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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/mus/container_delegate_mus.cc
diff --git a/ash/mus/container_delegate_mus.cc b/ash/mus/container_delegate_mus.cc
new file mode 100644
index 0000000000000000000000000000000000000000..44d13b476b29dd8a71a4b6cea0f781b9bc68b5b8
--- /dev/null
+++ b/ash/mus/container_delegate_mus.cc
@@ -0,0 +1,51 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "ash/mus/container_delegate_mus.h"
+
+#include <stdint.h>
+
+#include "components/mus/public/cpp/property_type_converters.h"
+#include "components/mus/public/cpp/window.h"
+#include "components/mus/public/cpp/window_property.h"
+#include "mash/wm/public/interfaces/container.mojom.h"
+#include "ui/aura/mus/mus_util.h"
+#include "ui/views/mus/native_widget_mus.h"
+#include "ui/views/widget/widget.h"
+
+using mash::wm::mojom::Container;
+
+namespace ash {
+namespace sysui {
+
+namespace {
+
+// Returns true if |widget| is in |container|.
+bool IsInContainer(views::Widget* widget, Container container) {
+ mus::Window* window =
+ aura::GetMusWindow(widget->GetTopLevelWidget()->GetNativeWindow());
+ if (window->HasSharedProperty(mash::wm::mojom::kWindowContainer_Property))
+ return container ==
+ static_cast<Container>(window->GetSharedProperty<int32_t>(
+ mash::wm::mojom::kWindowContainer_Property));
+
+ return false;
+}
+
+} // namespace
+
+ContainerDelegateMus::ContainerDelegateMus() {}
+
+ContainerDelegateMus::~ContainerDelegateMus() {}
+
+bool ContainerDelegateMus::IsInMenuContainer(views::Widget* widget) {
+ return IsInContainer(widget, Container::MENUS);
+}
+
+bool ContainerDelegateMus::IsInStatusContainer(views::Widget* widget) {
+ return IsInContainer(widget, Container::STATUS);
+}
+
+} // namespace sysui
+} // namespace ash
« 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