| Index: ash/common/wm_shell.cc
|
| diff --git a/ash/common/wm_shell.cc b/ash/common/wm_shell.cc
|
| index 0ef8c86b88330f965d3ad0dc1a03741e9ace4c68..27f22d2c8ceec393cf11f568d543069e64fd9744 100644
|
| --- a/ash/common/wm_shell.cc
|
| +++ b/ash/common/wm_shell.cc
|
| @@ -46,6 +46,10 @@
|
| #include "base/bind.h"
|
| #include "base/logging.h"
|
| #include "base/memory/ptr_util.h"
|
| +#include "services/catalog/public/interfaces/constants.mojom.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_presenter.h"
|
| #include "ui/display/display.h"
|
| #include "ui/views/focus/focus_manager_factory.h"
|
| @@ -120,6 +124,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 +275,11 @@ WmShell::WmShell(std::unique_ptr<ShellDelegate> shell_delegate)
|
| keyboard_brightness_control_delegate_.reset(new KeyboardBrightnessController);
|
| vpn_list_ = base::MakeUnique<VpnList>();
|
| #endif
|
| + delegate_->GetShellConnector()->ConnectToInterface(
|
| + catalog::mojom::kServiceName, &catalog_);
|
| + catalog_->GetEntriesProvidingCapability(
|
| + prefs::mojom::kServiceName,
|
| + base::Bind(&WmShell::OnGotCatalogEntries, base::Unretained(this)));
|
| }
|
|
|
| WmShell::~WmShell() {}
|
| @@ -411,4 +423,15 @@ void WmShell::SetAcceleratorController(
|
| accelerator_controller_ = std::move(accelerator_controller);
|
| }
|
|
|
| +void WmShell::OnGotCatalogEntries(
|
| + std::vector<catalog::mojom::EntryPtr> entries) {
|
| + DCHECK(!entries.empty());
|
| + // TODO(jonross): Update this if we end up with more than one
|
| + // PreferencesManager service.
|
| + prefs::mojom::PreferencesManagerPtr pref_manager_ptr;
|
| + delegate_->GetShellConnector()->ConnectToInterface((*entries.begin())->name,
|
| + &pref_manager_ptr);
|
| + pref_store_ = new preferences::PrefObserverStore(std::move(pref_manager_ptr));
|
| +}
|
| +
|
| } // namespace ash
|
|
|