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

Unified Diff: ash/mus/sysui_application.cc

Issue 1816753002: Enable mash shelf tooltips. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address destructor comment. Created 4 years, 9 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/shelf_delegate_mus.cc ('k') | ash/shelf/app_list_button.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/mus/sysui_application.cc
diff --git a/ash/mus/sysui_application.cc b/ash/mus/sysui_application.cc
index 16585a31d4abb7d0c51b6f52f9f233df224449e6..5fd5aac6af670d22618fe8d572ec0f52503903b7 100644
--- a/ash/mus/sysui_application.cc
+++ b/ash/mus/sysui_application.cc
@@ -45,11 +45,11 @@ namespace sysui {
namespace {
-// Tries to determine the corresponding container in mash from the ash container
-// for the widget.
-mash::wm::mojom::Container GetContainerId(aura::Window* container) {
- DCHECK(container);
- int id = container->id();
+// Tries to determine the corresponding mash container from widget init params.
+mash::wm::mojom::Container GetContainerId(
+ const views::Widget::InitParams& params) {
+ DCHECK(params.parent);
+ const int id = params.parent->id();
if (id == kShellWindowId_DesktopBackgroundContainer)
return mash::wm::mojom::Container::USER_BACKGROUND;
// mash::wm::ShelfLayout manages both the shelf and the status area.
@@ -57,6 +57,16 @@ mash::wm::mojom::Container GetContainerId(aura::Window* container) {
id == kShellWindowId_StatusContainer) {
return mash::wm::mojom::Container::USER_SHELF;
}
+
+ // Show mash shelf tooltips and settings bubbles in the menu container.
+ if (params.type == views::Widget::InitParams::Type::TYPE_MENU ||
+ params.type == views::Widget::InitParams::Type::TYPE_BUBBLE) {
+ return mash::wm::mojom::Container::MENUS;
+ }
+
+ if (params.type == views::Widget::InitParams::Type::TYPE_TOOLTIP)
+ return mash::wm::mojom::Container::TOOLTIPS;
+
return mash::wm::mojom::Container::COUNT;
}
@@ -118,7 +128,7 @@ class NativeWidgetFactory {
views::internal::NativeWidgetDelegate* delegate) {
std::map<std::string, std::vector<uint8_t>> properties;
if (params.parent) {
- mash::wm::mojom::Container container = GetContainerId(params.parent);
+ mash::wm::mojom::Container container = GetContainerId(params);
if (container != mash::wm::mojom::Container::COUNT) {
properties[mash::wm::mojom::kWindowContainer_Property] =
mojo::TypeConverter<const std::vector<uint8_t>, int32_t>::Convert(
« no previous file with comments | « ash/mus/shelf_delegate_mus.cc ('k') | ash/shelf/app_list_button.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698