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

Side by Side Diff: ash/mus/root_window_controller.cc

Issue 2304443002: ash: Move ShelfWidget ownership to WmShelf and refactor access to it (Closed)
Patch Set: review comments Created 4 years, 3 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 unified diff | Download patch
« no previous file with comments | « ash/mus/bridge/wm_shelf_mus.cc ('k') | ash/root_window_controller.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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>
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 } 163 }
164 164
165 void RootWindowController::CreateLayoutManagers() { 165 void RootWindowController::CreateLayoutManagers() {
166 // Override the default layout managers for certain containers. 166 // Override the default layout managers for certain containers.
167 WmWindowMus* lock_screen_container = 167 WmWindowMus* lock_screen_container =
168 GetWindowByShellWindowId(kShellWindowId_LockScreenContainer); 168 GetWindowByShellWindowId(kShellWindowId_LockScreenContainer);
169 layout_managers_[lock_screen_container->mus_window()].reset( 169 layout_managers_[lock_screen_container->mus_window()].reset(
170 new ScreenlockLayout(lock_screen_container->mus_window())); 170 new ScreenlockLayout(lock_screen_container->mus_window()));
171 171
172 // Creating the shelf also creates the status area and both layout managers. 172 // Creating the shelf also creates the status area and both layout managers.
173 wm_shelf_.reset(new WmShelfMus(wm_root_window_controller_.get())); 173 wm_shelf_.reset(new WmShelfMus(wm_root_window_controller_->GetWindow()));
174 174
175 WmWindowMus* default_container = 175 WmWindowMus* default_container =
176 GetWindowByShellWindowId(kShellWindowId_DefaultContainer); 176 GetWindowByShellWindowId(kShellWindowId_DefaultContainer);
177 // WorkspaceLayoutManager is not a mash::wm::LayoutManager (it's a 177 // WorkspaceLayoutManager is not a mash::wm::LayoutManager (it's a
178 // wm::LayoutManager), so it can't be in |layout_managers_|. 178 // wm::LayoutManager), so it can't be in |layout_managers_|.
179 workspace_layout_manager_ = new WorkspaceLayoutManager(default_container); 179 workspace_layout_manager_ = new WorkspaceLayoutManager(default_container);
180 default_container->SetLayoutManager( 180 default_container->SetLayoutManager(
181 base::WrapUnique(workspace_layout_manager_)); 181 base::WrapUnique(workspace_layout_manager_));
182 182
183 WmWindowMus* docked_container = 183 WmWindowMus* docked_container =
184 GetWindowByShellWindowId(kShellWindowId_DockedContainer); 184 GetWindowByShellWindowId(kShellWindowId_DockedContainer);
185 std::unique_ptr<DockedWindowLayoutManager> docked_window_layout_manager = 185 std::unique_ptr<DockedWindowLayoutManager> docked_window_layout_manager =
186 base::MakeUnique<DockedWindowLayoutManager>(docked_container); 186 base::MakeUnique<DockedWindowLayoutManager>(docked_container);
187 docked_window_layout_manager->SetShelf(wm_shelf_.get()); 187 docked_window_layout_manager->SetShelf(wm_shelf_.get());
188 docked_window_layout_manager->AddObserver(wm_shelf_->shelf_layout_manager()); 188 docked_window_layout_manager->AddObserver(wm_shelf_->shelf_layout_manager());
189 docked_container->SetLayoutManager(std::move(docked_window_layout_manager)); 189 docked_container->SetLayoutManager(std::move(docked_window_layout_manager));
190 190
191 WmWindowMus* panel_container = 191 WmWindowMus* panel_container =
192 GetWindowByShellWindowId(kShellWindowId_PanelContainer); 192 GetWindowByShellWindowId(kShellWindowId_PanelContainer);
193 std::unique_ptr<PanelLayoutManager> panel_layout_manager = 193 std::unique_ptr<PanelLayoutManager> panel_layout_manager =
194 base::MakeUnique<PanelLayoutManager>(panel_container); 194 base::MakeUnique<PanelLayoutManager>(panel_container);
195 panel_layout_manager->SetShelf(wm_shelf_.get()); 195 panel_layout_manager->SetShelf(wm_shelf_.get());
196 panel_container->SetLayoutManager(std::move(panel_layout_manager)); 196 panel_container->SetLayoutManager(std::move(panel_layout_manager));
197 } 197 }
198 198
199 } // namespace mus 199 } // namespace mus
200 } // namespace ash 200 } // namespace ash
OLDNEW
« no previous file with comments | « ash/mus/bridge/wm_shelf_mus.cc ('k') | ash/root_window_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698