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

Unified Diff: ash/common/wm_shell.cc

Issue 2474653003: PreferencesManager (Closed)
Patch Set: Update PreferencesManager to account for base::Value API change Created 4 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/common/wm_shell.h ('k') | ash/mus/manifest.json » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/common/wm_shell.cc
diff --git a/ash/common/wm_shell.cc b/ash/common/wm_shell.cc
index 0bd31c79726c93aee3144a0d5907229ba092c74d..5e80f334739f90acb3d4de097dd902cdba180bc5 100644
--- a/ash/common/wm_shell.cc
+++ b/ash/common/wm_shell.cc
@@ -48,6 +48,9 @@
#include "base/bind.h"
#include "base/logging.h"
#include "base/memory/ptr_util.h"
+#include "services/preferences/public/cpp/pref_observer_store.h"
+#include "services/preferences/public/interfaces/preferences.mojom.h"
+#include "services/service_manager/public/cpp/connector.h"
#include "ui/app_list/presenter/app_list.h"
#include "ui/app_list/presenter/app_list_presenter.h"
#include "ui/display/display.h"
@@ -122,6 +125,9 @@ void WmShell::Shutdown() {
// Balances the Install() in Initialize().
views::FocusManagerFactory::Install(nullptr);
+
+ // Removes itself as an observer of |pref_store_|.
+ shelf_controller_.reset();
}
ShelfModel* WmShell::shelf_model() {
@@ -268,6 +274,14 @@ WmShell::WmShell(std::unique_ptr<ShellDelegate> shell_delegate)
vpn_list_ = base::MakeUnique<VpnList>();
#endif
session_controller_->AddSessionStateObserver(this);
+
+ prefs::mojom::PreferencesManagerPtr pref_manager_ptr;
+ // Can be null in tests.
+ if (!delegate_->GetShellConnector())
+ return;
+ delegate_->GetShellConnector()->ConnectToInterface(prefs::mojom::kServiceName,
+ &pref_manager_ptr);
+ pref_store_ = new preferences::PrefObserverStore(std::move(pref_manager_ptr));
}
WmShell::~WmShell() {
« no previous file with comments | « ash/common/wm_shell.h ('k') | ash/mus/manifest.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698