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

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

Issue 2635093002: Switch Preferences to use Factory (Closed)
Patch Set: Missed test 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 275 matching lines...) Expand 10 before | Expand all | Expand 10 after
286 shutdown_controller_(base::MakeUnique<ShutdownController>()), 286 shutdown_controller_(base::MakeUnique<ShutdownController>()),
287 system_tray_controller_(base::MakeUnique<SystemTrayController>()), 287 system_tray_controller_(base::MakeUnique<SystemTrayController>()),
288 system_tray_notifier_(base::MakeUnique<SystemTrayNotifier>()), 288 system_tray_notifier_(base::MakeUnique<SystemTrayNotifier>()),
289 vpn_list_(base::MakeUnique<VpnList>()), 289 vpn_list_(base::MakeUnique<VpnList>()),
290 wallpaper_delegate_(delegate_->CreateWallpaperDelegate()), 290 wallpaper_delegate_(delegate_->CreateWallpaperDelegate()),
291 window_cycle_controller_(base::MakeUnique<WindowCycleController>()), 291 window_cycle_controller_(base::MakeUnique<WindowCycleController>()),
292 window_selector_controller_( 292 window_selector_controller_(
293 base::MakeUnique<WindowSelectorController>()) { 293 base::MakeUnique<WindowSelectorController>()) {
294 session_controller_->AddSessionStateObserver(this); 294 session_controller_->AddSessionStateObserver(this);
295 295
296 prefs::mojom::PreferencesManagerPtr pref_manager_ptr; 296 prefs::mojom::PreferencesFactoryPtr pref_factory_ptr;
297 // Can be null in tests. 297 // Can be null in tests.
298 if (!delegate_->GetShellConnector()) 298 if (!delegate_->GetShellConnector())
299 return; 299 return;
300 delegate_->GetShellConnector()->BindInterface(prefs::mojom::kServiceName, 300 delegate_->GetShellConnector()->BindInterface(prefs::mojom::kServiceName,
301 &pref_manager_ptr); 301 &pref_factory_ptr);
302 pref_store_ = new preferences::PrefObserverStore(std::move(pref_manager_ptr)); 302 pref_store_ = new preferences::PrefObserverStore(std::move(pref_factory_ptr));
303 } 303 }
304 304
305 RootWindowController* WmShell::GetPrimaryRootWindowController() { 305 RootWindowController* WmShell::GetPrimaryRootWindowController() {
306 return GetPrimaryRootWindow()->GetRootWindowController(); 306 return GetPrimaryRootWindow()->GetRootWindowController();
307 } 307 }
308 308
309 WmWindow* WmShell::GetRootWindowForNewWindows() { 309 WmWindow* WmShell::GetRootWindowForNewWindows() {
310 if (scoped_root_window_for_new_windows_) 310 if (scoped_root_window_for_new_windows_)
311 return scoped_root_window_for_new_windows_; 311 return scoped_root_window_for_new_windows_;
312 return root_window_for_new_windows_; 312 return root_window_for_new_windows_;
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
455 455
456 void WmShell::OnAttemptToReactivateWindow(aura::Window* request_active, 456 void WmShell::OnAttemptToReactivateWindow(aura::Window* request_active,
457 aura::Window* actual_active) { 457 aura::Window* actual_active) {
458 for (auto& observer : activation_observers_) { 458 for (auto& observer : activation_observers_) {
459 observer.OnAttemptToReactivateWindow(WmWindow::Get(request_active), 459 observer.OnAttemptToReactivateWindow(WmWindow::Get(request_active),
460 WmWindow::Get(actual_active)); 460 WmWindow::Get(actual_active));
461 } 461 }
462 } 462 }
463 463
464 } // namespace ash 464 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698