Chromium Code Reviews| Index: ash/mus/sysui_application.cc |
| diff --git a/ash/mus/sysui_application.cc b/ash/mus/sysui_application.cc |
| index 92302485d160fb25dfd6b507f008afd9812dc1ea..836d6a231375b26480fbcc51ab26ac6584b5de2e 100644 |
| --- a/ash/mus/sysui_application.cc |
| +++ b/ash/mus/sysui_application.cc |
| @@ -48,7 +48,6 @@ namespace { |
| // 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; |
| @@ -58,16 +57,17 @@ mash::wm::mojom::Container GetContainerId( |
| 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; |
| + // Determine the container based on Widget type. |
| + switch (params.type) { |
| + case views::Widget::InitParams::Type::TYPE_BUBBLE: |
| + return mash::wm::mojom::Container::BUBBLES; |
| + case views::Widget::InitParams::Type::TYPE_MENU: |
| + return mash::wm::mojom::Container::MENUS; |
| + case views::Widget::InitParams::Type::TYPE_TOOLTIP: |
| + return mash::wm::mojom::Container::TOOLTIPS; |
| + default: |
| + return mash::wm::mojom::Container::COUNT; |
|
msw
2016/04/06 18:18:56
nit q: is the final return statement inside a swit
James Cook
2016/04/06 18:21:28
Dunno what we prefer from a style perspective, but
|
| } |
| - |
| - if (params.type == views::Widget::InitParams::Type::TYPE_TOOLTIP) |
| - return mash::wm::mojom::Container::TOOLTIPS; |
| - |
| - return mash::wm::mojom::Container::COUNT; |
| } |
| // Tries to determine the corresponding ash window type from the ash container |