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

Side by Side Diff: ash/shell.cc

Issue 2791903003: Pref service: have Mash and Chrome connect to the right pref stores (Closed)
Patch Set: Update PrefServiceFactoryTest Created 3 years, 8 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/shell.h" 5 #include "ash/shell.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <string> 8 #include <string>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 781 matching lines...) Expand 10 before | Expand all | Expand 10 after
792 const Config config = wm_shell_->GetConfig(); 792 const Config config = wm_shell_->GetConfig();
793 793
794 blocking_pool_ = init_params.blocking_pool; 794 blocking_pool_ = init_params.blocking_pool;
795 795
796 wallpaper_delegate_ = shell_delegate_->CreateWallpaperDelegate(); 796 wallpaper_delegate_ = shell_delegate_->CreateWallpaperDelegate();
797 797
798 // Can be null in tests. 798 // Can be null in tests.
799 if (wm_shell_->IsRunningInMash() && shell_delegate_->GetShellConnector()) { 799 if (wm_shell_->IsRunningInMash() && shell_delegate_->GetShellConnector()) {
800 prefs::ConnectToPrefService( 800 prefs::ConnectToPrefService(
801 shell_delegate_->GetShellConnector(), 801 shell_delegate_->GetShellConnector(),
802 make_scoped_refptr(new PrefRegistrySimple()), 802 make_scoped_refptr(new PrefRegistrySimple()), {},
Bernhard Bauer 2017/04/03 10:37:39 Nit: Add a comment /* already_connected_types = */
tibell 2017/04/04 04:05:59 I instead changed it to spell out the type, since
Bernhard Bauer 2017/04/05 10:04:32 :-/ An alternative might be to add a helper method
tibell 2017/04/06 01:05:52 I'm going to stick with what I have. This code is
803 base::Bind(&Shell::OnPrefServiceInitialized, base::Unretained(this)), 803 base::Bind(&Shell::OnPrefServiceInitialized, base::Unretained(this)),
804 prefs::mojom::kForwarderServiceName); 804 prefs::mojom::kForwarderServiceName);
805 } 805 }
806 806
807 // Some delegates access WmShell during their construction. Create them here 807 // Some delegates access WmShell during their construction. Create them here
808 // instead of the WmShell constructor. 808 // instead of the WmShell constructor.
809 accessibility_delegate_.reset(shell_delegate_->CreateAccessibilityDelegate()); 809 accessibility_delegate_.reset(shell_delegate_->CreateAccessibilityDelegate());
810 palette_delegate_ = shell_delegate_->CreatePaletteDelegate(); 810 palette_delegate_ = shell_delegate_->CreatePaletteDelegate();
811 toast_manager_ = base::MakeUnique<ToastManager>(); 811 toast_manager_ = base::MakeUnique<ToastManager>();
812 812
(...skipping 439 matching lines...) Expand 10 before | Expand all | Expand 10 after
1252 1252
1253 void Shell::OnPrefServiceInitialized( 1253 void Shell::OnPrefServiceInitialized(
1254 std::unique_ptr<::PrefService> pref_service) { 1254 std::unique_ptr<::PrefService> pref_service) {
1255 if (!instance_) 1255 if (!instance_)
1256 return; 1256 return;
1257 DCHECK(pref_service); 1257 DCHECK(pref_service);
1258 pref_service_ = std::move(pref_service); 1258 pref_service_ = std::move(pref_service);
1259 } 1259 }
1260 1260
1261 } // namespace ash 1261 } // namespace ash
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/prefs/active_profile_pref_service.h » ('j') | chrome/browser/prefs/browser_prefs.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698