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

Side by Side Diff: ash/common/wm_shell.cc

Issue 2635093002: Switch Preferences to use Factory (Closed)
Patch Set: dcheck for bound Created 3 years, 11 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
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/common/wm_shell.h" 5 #include "ash/common/wm_shell.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "ash/common/accelerators/accelerator_controller.h" 9 #include "ash/common/accelerators/accelerator_controller.h"
10 #include "ash/common/accelerators/ash_focus_manager_factory.h" 10 #include "ash/common/accelerators/ash_focus_manager_factory.h"
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after
264 shutdown_controller_(base::MakeUnique<ShutdownController>()), 264 shutdown_controller_(base::MakeUnique<ShutdownController>()),
265 system_tray_controller_(base::MakeUnique<SystemTrayController>()), 265 system_tray_controller_(base::MakeUnique<SystemTrayController>()),
266 system_tray_notifier_(base::MakeUnique<SystemTrayNotifier>()), 266 system_tray_notifier_(base::MakeUnique<SystemTrayNotifier>()),
267 vpn_list_(base::MakeUnique<VpnList>()), 267 vpn_list_(base::MakeUnique<VpnList>()),
268 wallpaper_delegate_(delegate_->CreateWallpaperDelegate()), 268 wallpaper_delegate_(delegate_->CreateWallpaperDelegate()),
269 window_cycle_controller_(base::MakeUnique<WindowCycleController>()), 269 window_cycle_controller_(base::MakeUnique<WindowCycleController>()),
270 window_selector_controller_( 270 window_selector_controller_(
271 base::MakeUnique<WindowSelectorController>()) { 271 base::MakeUnique<WindowSelectorController>()) {
272 session_controller_->AddSessionStateObserver(this); 272 session_controller_->AddSessionStateObserver(this);
273 273
274 prefs::mojom::PreferencesManagerPtr pref_manager_ptr; 274 prefs::mojom::PreferencesFactoryPtr pref_factory_ptr;
275 // Can be null in tests. 275 // Can be null in tests.
276 if (!delegate_->GetShellConnector()) 276 if (!delegate_->GetShellConnector())
277 return; 277 return;
278 delegate_->GetShellConnector()->BindInterface(prefs::mojom::kServiceName, 278 delegate_->GetShellConnector()->BindInterface(prefs::mojom::kServiceName,
279 &pref_manager_ptr); 279 &pref_factory_ptr);
280 pref_store_ = new preferences::PrefObserverStore(std::move(pref_manager_ptr)); 280 pref_store_ = new preferences::PrefObserverStore(std::move(pref_factory_ptr));
281 } 281 }
282 282
283 WmShell::~WmShell() { 283 WmShell::~WmShell() {
284 session_controller_->RemoveSessionStateObserver(this); 284 session_controller_->RemoveSessionStateObserver(this);
285 } 285 }
286 286
287 RootWindowController* WmShell::GetPrimaryRootWindowController() { 287 RootWindowController* WmShell::GetPrimaryRootWindowController() {
288 return GetPrimaryRootWindow()->GetRootWindowController(); 288 return GetPrimaryRootWindow()->GetRootWindowController();
289 } 289 }
290 290
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
417 } 417 }
418 418
419 void WmShell::SessionStateChanged(session_manager::SessionState state) { 419 void WmShell::SessionStateChanged(session_manager::SessionState state) {
420 // Create the shelf when a session becomes active. It's safe to do this 420 // Create the shelf when a session becomes active. It's safe to do this
421 // multiple times (e.g. initial login vs. multiprofile add session). 421 // multiple times (e.g. initial login vs. multiprofile add session).
422 if (state == session_manager::SessionState::ACTIVE) 422 if (state == session_manager::SessionState::ACTIVE)
423 CreateShelf(); 423 CreateShelf();
424 } 424 }
425 425
426 } // namespace ash 426 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698