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

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

Issue 2617883002: Add a new BindInterface() method to Connector. (Closed)
Patch Set: . 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
« no previous file with comments | « no previous file | ash/mus/accelerators/accelerator_controller_delegate_mus.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/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 257 matching lines...) Expand 10 before | Expand all | Expand 10 after
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::PreferencesManagerPtr pref_manager_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()->ConnectToInterface(prefs::mojom::kServiceName, 278 delegate_->GetShellConnector()->BindInterface(prefs::mojom::kServiceName,
279 &pref_manager_ptr); 279 &pref_manager_ptr);
280 pref_store_ = new preferences::PrefObserverStore(std::move(pref_manager_ptr)); 280 pref_store_ = new preferences::PrefObserverStore(std::move(pref_manager_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 WmRootWindowController* WmShell::GetPrimaryRootWindowController() { 287 WmRootWindowController* WmShell::GetPrimaryRootWindowController() {
288 return GetPrimaryRootWindow()->GetRootWindowController(); 288 return GetPrimaryRootWindow()->GetRootWindowController();
289 } 289 }
(...skipping 127 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
« no previous file with comments | « no previous file | ash/mus/accelerators/accelerator_controller_delegate_mus.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698