| OLD | NEW |
| 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 787 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 798 | 798 |
| 799 void Shell::Init(const ShellInitParams& init_params) { | 799 void Shell::Init(const ShellInitParams& init_params) { |
| 800 const Config config = shell_port_->GetAshConfig(); | 800 const Config config = shell_port_->GetAshConfig(); |
| 801 | 801 |
| 802 blocking_pool_ = init_params.blocking_pool; | 802 blocking_pool_ = init_params.blocking_pool; |
| 803 | 803 |
| 804 wallpaper_delegate_ = shell_delegate_->CreateWallpaperDelegate(); | 804 wallpaper_delegate_ = shell_delegate_->CreateWallpaperDelegate(); |
| 805 | 805 |
| 806 // Can be null in tests. | 806 // Can be null in tests. |
| 807 if (config == Config::MASH && shell_delegate_->GetShellConnector()) { | 807 if (config == Config::MASH && shell_delegate_->GetShellConnector()) { |
| 808 auto pref_registry = base::MakeShared<PrefRegistrySimple>(); |
| 809 Shell::RegisterPrefs(pref_registry.get()); |
| 808 prefs::ConnectToPrefService( | 810 prefs::ConnectToPrefService( |
| 809 shell_delegate_->GetShellConnector(), | 811 shell_delegate_->GetShellConnector(), std::move(pref_registry), |
| 810 make_scoped_refptr(new PrefRegistrySimple()), | |
| 811 std::vector<PrefValueStore::PrefStoreType>(), | 812 std::vector<PrefValueStore::PrefStoreType>(), |
| 812 base::Bind(&Shell::OnPrefServiceInitialized, base::Unretained(this)), | 813 base::Bind(&Shell::OnPrefServiceInitialized, base::Unretained(this)), |
| 813 prefs::mojom::kForwarderServiceName); | 814 prefs::mojom::kForwarderServiceName); |
| 814 } | 815 } |
| 815 | 816 |
| 816 // Some delegates access ShellPort during their construction. Create them here | 817 // Some delegates access ShellPort during their construction. Create them here |
| 817 // instead of the ShellPort constructor. | 818 // instead of the ShellPort constructor. |
| 818 accessibility_delegate_.reset(shell_delegate_->CreateAccessibilityDelegate()); | 819 accessibility_delegate_.reset(shell_delegate_->CreateAccessibilityDelegate()); |
| 819 palette_delegate_ = shell_delegate_->CreatePaletteDelegate(); | 820 palette_delegate_ = shell_delegate_->CreatePaletteDelegate(); |
| 820 toast_manager_ = base::MakeUnique<ToastManager>(); | 821 toast_manager_ = base::MakeUnique<ToastManager>(); |
| (...skipping 442 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1263 void Shell::OnPrefServiceInitialized( | 1264 void Shell::OnPrefServiceInitialized( |
| 1264 std::unique_ptr<::PrefService> pref_service) { | 1265 std::unique_ptr<::PrefService> pref_service) { |
| 1265 if (!instance_) | 1266 if (!instance_) |
| 1266 return; | 1267 return; |
| 1267 // |pref_service_| is null if can't connect to Chrome (as happens when | 1268 // |pref_service_| is null if can't connect to Chrome (as happens when |
| 1268 // running mash outside of chrome --mash and chrome isn't built). | 1269 // running mash outside of chrome --mash and chrome isn't built). |
| 1269 pref_service_ = std::move(pref_service); | 1270 pref_service_ = std::move(pref_service); |
| 1270 } | 1271 } |
| 1271 | 1272 |
| 1272 } // namespace ash | 1273 } // namespace ash |
| OLD | NEW |