Chromium Code Reviews| 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 scoped_refptr<PrefRegistrySimple> pref_registry = | |
| 809 make_scoped_refptr(new PrefRegistrySimple()); | |
|
Sam McNally
2017/05/15 22:31:09
I think base::MakeShared might be the new preferre
afakhry
2017/05/16 00:26:58
Done.
| |
| 810 Shell::RegisterPrefs(pref_registry.get()); | |
| 808 prefs::ConnectToPrefService( | 811 prefs::ConnectToPrefService( |
| 809 shell_delegate_->GetShellConnector(), | 812 shell_delegate_->GetShellConnector(), pref_registry, |
|
Sam McNally
2017/05/15 22:31:09
std::move(pref_registry)
afakhry
2017/05/16 00:26:58
Done.
| |
| 810 make_scoped_refptr(new PrefRegistrySimple()), | |
| 811 std::vector<PrefValueStore::PrefStoreType>(), | 813 std::vector<PrefValueStore::PrefStoreType>(), |
| 812 base::Bind(&Shell::OnPrefServiceInitialized, base::Unretained(this)), | 814 base::Bind(&Shell::OnPrefServiceInitialized, base::Unretained(this)), |
| 813 prefs::mojom::kForwarderServiceName); | 815 prefs::mojom::kForwarderServiceName); |
| 814 } | 816 } |
| 815 | 817 |
| 816 // Some delegates access ShellPort during their construction. Create them here | 818 // Some delegates access ShellPort during their construction. Create them here |
| 817 // instead of the ShellPort constructor. | 819 // instead of the ShellPort constructor. |
| 818 accessibility_delegate_.reset(shell_delegate_->CreateAccessibilityDelegate()); | 820 accessibility_delegate_.reset(shell_delegate_->CreateAccessibilityDelegate()); |
| 819 palette_delegate_ = shell_delegate_->CreatePaletteDelegate(); | 821 palette_delegate_ = shell_delegate_->CreatePaletteDelegate(); |
| 820 toast_manager_ = base::MakeUnique<ToastManager>(); | 822 toast_manager_ = base::MakeUnique<ToastManager>(); |
| (...skipping 442 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1263 void Shell::OnPrefServiceInitialized( | 1265 void Shell::OnPrefServiceInitialized( |
| 1264 std::unique_ptr<::PrefService> pref_service) { | 1266 std::unique_ptr<::PrefService> pref_service) { |
| 1265 if (!instance_) | 1267 if (!instance_) |
| 1266 return; | 1268 return; |
| 1267 // |pref_service_| is null if can't connect to Chrome (as happens when | 1269 // |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). | 1270 // running mash outside of chrome --mash and chrome isn't built). |
| 1269 pref_service_ = std::move(pref_service); | 1271 pref_service_ = std::move(pref_service); |
| 1270 } | 1272 } |
| 1271 | 1273 |
| 1272 } // namespace ash | 1274 } // namespace ash |
| OLD | NEW |