Chromium Code Reviews| 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/root_window_controller.h" | 5 #include "ash/mus/root_window_controller.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <map> | 10 #include <map> |
| 11 #include <sstream> | 11 #include <sstream> |
| 12 #include <string> | 12 #include <string> |
| 13 #include <utility> | 13 #include <utility> |
| 14 #include <vector> | 14 #include <vector> |
| 15 | 15 |
| 16 #include "ash/common/root_window_controller_common.h" | |
| 17 #include "ash/common/shelf/shelf_layout_manager.h" | 16 #include "ash/common/shelf/shelf_layout_manager.h" |
| 18 #include "ash/common/shell_window_ids.h" | 17 #include "ash/common/shell_window_ids.h" |
| 19 #include "ash/common/wm/always_on_top_controller.h" | 18 #include "ash/common/wm/always_on_top_controller.h" |
| 20 #include "ash/common/wm/container_finder.h" | 19 #include "ash/common/wm/container_finder.h" |
| 21 #include "ash/common/wm/dock/docked_window_layout_manager.h" | 20 #include "ash/common/wm/dock/docked_window_layout_manager.h" |
| 22 #include "ash/common/wm/panels/panel_layout_manager.h" | 21 #include "ash/common/wm/panels/panel_layout_manager.h" |
| 23 #include "ash/common/wm/root_window_layout_manager.h" | 22 #include "ash/common/wm/root_window_layout_manager.h" |
| 24 #include "ash/common/wm/workspace/workspace_layout_manager.h" | 23 #include "ash/common/wm/workspace/workspace_layout_manager.h" |
| 25 #include "ash/mus/bridge/wm_root_window_controller_mus.h" | 24 #include "ash/mus/bridge/wm_root_window_controller_mus.h" |
| 26 #include "ash/mus/bridge/wm_shelf_mus.h" | 25 #include "ash/mus/bridge/wm_shelf_mus.h" |
| (...skipping 22 matching lines...) Expand all Loading... | |
| 49 namespace ash { | 48 namespace ash { |
| 50 namespace mus { | 49 namespace mus { |
| 51 | 50 |
| 52 RootWindowController::RootWindowController(WindowManager* window_manager, | 51 RootWindowController::RootWindowController(WindowManager* window_manager, |
| 53 ui::Window* root, | 52 ui::Window* root, |
| 54 const display::Display& display) | 53 const display::Display& display) |
| 55 : window_manager_(window_manager), | 54 : window_manager_(window_manager), |
| 56 root_(root), | 55 root_(root), |
| 57 window_count_(0), | 56 window_count_(0), |
| 58 display_(display) { | 57 display_(display) { |
| 59 wm_root_window_controller_.reset( | 58 wm_root_window_controller_ = base::MakeUnique<WmRootWindowControllerMus>( |
|
msw
2016/08/30 21:26:46
nit: move to initializer list?
sky
2016/08/30 22:02:56
I avoid that because of supplying 'this', but I th
| |
| 60 new WmRootWindowControllerMus(window_manager_->shell(), this)); | 59 window_manager_->shell(), this); |
| 61 | 60 |
| 62 root_window_controller_common_.reset( | 61 wm_root_window_controller_->CreateContainers(); |
| 63 new RootWindowControllerCommon(WmWindowMus::Get(root_))); | 62 wm_root_window_controller_->CreateLayoutManagers(); |
| 64 root_window_controller_common_->CreateContainers(); | |
| 65 root_window_controller_common_->CreateLayoutManagers(); | |
| 66 CreateLayoutManagers(); | 63 CreateLayoutManagers(); |
| 67 | 64 |
| 68 disconnected_app_handler_.reset(new DisconnectedAppHandler(root)); | 65 disconnected_app_handler_.reset(new DisconnectedAppHandler(root)); |
| 69 | 66 |
| 70 // Force a layout of the root, and its children, RootWindowLayout handles | 67 // Force a layout of the root, and its children, RootWindowLayout handles |
| 71 // both. | 68 // both. |
| 72 root_window_controller_common_->root_window_layout()->OnWindowResized(); | 69 wm_root_window_controller_->root_window_layout()->OnWindowResized(); |
| 73 | 70 |
| 74 for (size_t i = 0; i < kNumActivatableShellWindowIds; ++i) { | 71 for (size_t i = 0; i < kNumActivatableShellWindowIds; ++i) { |
| 75 window_manager_->window_manager_client()->AddActivationParent( | 72 window_manager_->window_manager_client()->AddActivationParent( |
| 76 GetWindowByShellWindowId(kActivatableShellWindowIds[i])->mus_window()); | 73 GetWindowByShellWindowId(kActivatableShellWindowIds[i])->mus_window()); |
| 77 } | 74 } |
| 78 | 75 |
| 79 WmWindowMus* always_on_top_container = | 76 WmWindowMus* always_on_top_container = |
| 80 GetWindowByShellWindowId(kShellWindowId_AlwaysOnTopContainer); | 77 GetWindowByShellWindowId(kShellWindowId_AlwaysOnTopContainer); |
| 81 always_on_top_controller_.reset( | 78 always_on_top_controller_.reset( |
| 82 new AlwaysOnTopController(always_on_top_container)); | 79 new AlwaysOnTopController(always_on_top_container)); |
| 83 } | 80 } |
| 84 | 81 |
| 85 RootWindowController::~RootWindowController() { | 82 RootWindowController::~RootWindowController() { |
| 86 root_window_controller_common_->DeleteWorkspaceController(); | 83 wm_root_window_controller_->DeleteWorkspaceController(); |
| 87 } | 84 } |
| 88 | 85 |
| 89 shell::Connector* RootWindowController::GetConnector() { | 86 shell::Connector* RootWindowController::GetConnector() { |
| 90 return window_manager_->connector(); | 87 return window_manager_->connector(); |
| 91 } | 88 } |
| 92 | 89 |
| 93 ui::Window* RootWindowController::NewTopLevelWindow( | 90 ui::Window* RootWindowController::NewTopLevelWindow( |
| 94 std::map<std::string, std::vector<uint8_t>>* properties) { | 91 std::map<std::string, std::vector<uint8_t>>* properties) { |
| 95 // TODO(sky): panels need a different frame, http:://crbug.com/614362. | 92 // TODO(sky): panels need a different frame, http:://crbug.com/614362. |
| 96 const bool provide_non_client_frame = | 93 const bool provide_non_client_frame = |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 194 WmWindowMus* panel_container = | 191 WmWindowMus* panel_container = |
| 195 GetWindowByShellWindowId(kShellWindowId_PanelContainer); | 192 GetWindowByShellWindowId(kShellWindowId_PanelContainer); |
| 196 std::unique_ptr<PanelLayoutManager> panel_layout_manager = | 193 std::unique_ptr<PanelLayoutManager> panel_layout_manager = |
| 197 base::MakeUnique<PanelLayoutManager>(panel_container); | 194 base::MakeUnique<PanelLayoutManager>(panel_container); |
| 198 panel_layout_manager->SetShelf(wm_shelf_.get()); | 195 panel_layout_manager->SetShelf(wm_shelf_.get()); |
| 199 panel_container->SetLayoutManager(std::move(panel_layout_manager)); | 196 panel_container->SetLayoutManager(std::move(panel_layout_manager)); |
| 200 } | 197 } |
| 201 | 198 |
| 202 } // namespace mus | 199 } // namespace mus |
| 203 } // namespace ash | 200 } // namespace ash |
| OLD | NEW |