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

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

Issue 2257763002: Re-write many calls to WrapUnique() with MakeUnique() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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_shell_mus.cc ('k') | ash/shell.cc » ('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 189 matching lines...) Expand 10 before | Expand all | Expand 10 after
200 GetWindowByShellWindowId(kShellWindowId_DefaultContainer); 200 GetWindowByShellWindowId(kShellWindowId_DefaultContainer);
201 // WorkspaceLayoutManager is not a mash::wm::LayoutManager (it's a 201 // WorkspaceLayoutManager is not a mash::wm::LayoutManager (it's a
202 // wm::LayoutManager), so it can't be in |layout_managers_|. 202 // wm::LayoutManager), so it can't be in |layout_managers_|.
203 workspace_layout_manager_ = new WorkspaceLayoutManager(default_container); 203 workspace_layout_manager_ = new WorkspaceLayoutManager(default_container);
204 default_container->SetLayoutManager( 204 default_container->SetLayoutManager(
205 base::WrapUnique(workspace_layout_manager_)); 205 base::WrapUnique(workspace_layout_manager_));
206 206
207 WmWindowMus* docked_container = 207 WmWindowMus* docked_container =
208 GetWindowByShellWindowId(kShellWindowId_DockedContainer); 208 GetWindowByShellWindowId(kShellWindowId_DockedContainer);
209 docked_container->SetLayoutManager( 209 docked_container->SetLayoutManager(
210 base::WrapUnique(new DockedWindowLayoutManager(docked_container))); 210 base::MakeUnique<DockedWindowLayoutManager>(docked_container));
211 211
212 WmWindowMus* panel_container = 212 WmWindowMus* panel_container =
213 GetWindowByShellWindowId(kShellWindowId_PanelContainer); 213 GetWindowByShellWindowId(kShellWindowId_PanelContainer);
214 panel_container->SetLayoutManager( 214 panel_container->SetLayoutManager(
215 base::WrapUnique(new PanelLayoutManager(panel_container))); 215 base::MakeUnique<PanelLayoutManager>(panel_container));
216 } 216 }
217 217
218 void RootWindowController::CreateStatusArea() { 218 void RootWindowController::CreateStatusArea() {
219 WmWindowMus* status_container = 219 WmWindowMus* status_container =
220 GetWindowByShellWindowId(kShellWindowId_StatusContainer); 220 GetWindowByShellWindowId(kShellWindowId_StatusContainer);
221 // Owned by native widget. 221 // Owned by native widget.
222 StatusAreaWidget* status_area_widget = 222 StatusAreaWidget* status_area_widget =
223 new StatusAreaWidget(status_container, wm_shelf_.get()); 223 new StatusAreaWidget(status_container, wm_shelf_.get());
224 status_area_widget->CreateTrayViews(); 224 status_area_widget->CreateTrayViews();
225 // TODO(jamescook): Remove this when ash::StatusAreaLayoutManager and 225 // TODO(jamescook): Remove this when ash::StatusAreaLayoutManager and
226 // ash::ShelfLayoutManager are working in mash. http://crbug.com/621112 226 // ash::ShelfLayoutManager are working in mash. http://crbug.com/621112
227 gfx::Size display_size = display_.bounds().size(); 227 gfx::Size display_size = display_.bounds().size();
228 status_area_widget->SetBounds(gfx::Rect(display_size.width() - 179, 228 status_area_widget->SetBounds(gfx::Rect(display_size.width() - 179,
229 display_size.height() - 48, 120, 40)); 229 display_size.height() - 48, 120, 40));
230 if (WmShell::Get()->GetSessionStateDelegate()->IsActiveUserSessionStarted()) 230 if (WmShell::Get()->GetSessionStateDelegate()->IsActiveUserSessionStarted())
231 status_area_widget->Show(); 231 status_area_widget->Show();
232 } 232 }
233 233
234 } // namespace mus 234 } // namespace mus
235 } // namespace ash 235 } // namespace ash
OLDNEW
« no previous file with comments | « ash/mus/bridge/wm_shell_mus.cc ('k') | ash/shell.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698