| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "ash/mus/sysui_application.h" | 5 #include "ash/mus/sysui_application.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 #include <set> | 8 #include <set> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 const char kResourceFileStrings[] = "ash_resources_strings.pak"; | 57 const char kResourceFileStrings[] = "ash_resources_strings.pak"; |
| 58 const char kResourceFile100[] = "ash_resources_100_percent.pak"; | 58 const char kResourceFile100[] = "ash_resources_100_percent.pak"; |
| 59 const char kResourceFile200[] = "ash_resources_200_percent.pak"; | 59 const char kResourceFile200[] = "ash_resources_200_percent.pak"; |
| 60 | 60 |
| 61 // Tries to determine the corresponding mash container from widget init params. | 61 // Tries to determine the corresponding mash container from widget init params. |
| 62 mash::wm::mojom::Container GetContainerId( | 62 mash::wm::mojom::Container GetContainerId( |
| 63 const views::Widget::InitParams& params) { | 63 const views::Widget::InitParams& params) { |
| 64 const int id = params.parent->id(); | 64 const int id = params.parent->id(); |
| 65 if (id == kShellWindowId_DesktopBackgroundContainer) | 65 if (id == kShellWindowId_DesktopBackgroundContainer) |
| 66 return mash::wm::mojom::Container::USER_BACKGROUND; | 66 return mash::wm::mojom::Container::USER_BACKGROUND; |
| 67 // mash::wm::ShelfLayout manages both the shelf and the status area. | 67 if (id == kShellWindowId_ShelfContainer) |
| 68 if (id == kShellWindowId_ShelfContainer || | |
| 69 id == kShellWindowId_StatusContainer) { | |
| 70 return mash::wm::mojom::Container::USER_SHELF; | 68 return mash::wm::mojom::Container::USER_SHELF; |
| 71 } | 69 if (id == kShellWindowId_StatusContainer) |
| 70 return mash::wm::mojom::Container::STATUS; |
| 72 | 71 |
| 73 // Determine the container based on Widget type. | 72 // Determine the container based on Widget type. |
| 74 switch (params.type) { | 73 switch (params.type) { |
| 75 case views::Widget::InitParams::Type::TYPE_BUBBLE: | 74 case views::Widget::InitParams::Type::TYPE_BUBBLE: |
| 76 return mash::wm::mojom::Container::BUBBLES; | 75 return mash::wm::mojom::Container::BUBBLES; |
| 77 case views::Widget::InitParams::Type::TYPE_MENU: | 76 case views::Widget::InitParams::Type::TYPE_MENU: |
| 78 return mash::wm::mojom::Container::MENUS; | 77 return mash::wm::mojom::Container::MENUS; |
| 79 case views::Widget::InitParams::Type::TYPE_TOOLTIP: | 78 case views::Widget::InitParams::Type::TYPE_TOOLTIP: |
| 80 return mash::wm::mojom::Container::TOOLTIPS; | 79 return mash::wm::mojom::Container::TOOLTIPS; |
| 81 default: | 80 default: |
| (...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 325 void SysUIApplication::Create( | 324 void SysUIApplication::Create( |
| 326 ::shell::Connection* connection, | 325 ::shell::Connection* connection, |
| 327 mojo::InterfaceRequest<mash::shelf::mojom::ShelfController> request) { | 326 mojo::InterfaceRequest<mash::shelf::mojom::ShelfController> request) { |
| 328 mash::shelf::mojom::ShelfController* shelf_controller = | 327 mash::shelf::mojom::ShelfController* shelf_controller = |
| 329 static_cast<ShelfDelegateMus*>(Shell::GetInstance()->GetShelfDelegate()); | 328 static_cast<ShelfDelegateMus*>(Shell::GetInstance()->GetShelfDelegate()); |
| 330 shelf_controller_bindings_.AddBinding(shelf_controller, std::move(request)); | 329 shelf_controller_bindings_.AddBinding(shelf_controller, std::move(request)); |
| 331 } | 330 } |
| 332 | 331 |
| 333 } // namespace sysui | 332 } // namespace sysui |
| 334 } // namespace ash | 333 } // namespace ash |
| OLD | NEW |