Chromium Code Reviews| Index: ash/mus/app_list_presenter_mus.cc |
| diff --git a/ash/mus/app_list_presenter_mus.cc b/ash/mus/app_list_presenter_mus.cc |
| index 9bb13fbf99566f98d53ea2570efc2e76cac3fbe8..29769fbeacc7a2d231e3927b7aa31588fcf6df30 100644 |
| --- a/ash/mus/app_list_presenter_mus.cc |
| +++ b/ash/mus/app_list_presenter_mus.cc |
| @@ -2,39 +2,31 @@ |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| +#include "ash/common/wm_shell.h" |
| #include "ash/mus/app_list_presenter_mus.h" |
|
James Cook
2016/12/10 00:50:08
nit: goes at top of file
msw
2016/12/10 01:08:12
Done.
|
| - |
| -#include "content/public/common/service_names.mojom.h" |
| -#include "services/service_manager/public/cpp/connector.h" |
| +#include "ui/app_list/presenter/app_list.h" |
| namespace ash { |
| -namespace { |
| - |
| -bool HasConnection(app_list::mojom::AppListPresenterPtr* interface_ptr) { |
| - return interface_ptr->is_bound() && !interface_ptr->encountered_error(); |
| -} |
| - |
| -} // namespace |
| - |
| -AppListPresenterMus::AppListPresenterMus(service_manager::Connector* connector) |
| - : connector_(connector) {} |
| +AppListPresenterMus::AppListPresenterMus() {} |
| AppListPresenterMus::~AppListPresenterMus() {} |
| void AppListPresenterMus::Show(int64_t display_id) { |
| - ConnectIfNeeded(); |
| - presenter_->Show(display_id); |
| + if (WmShell::Get()->app_list()->GetAppListPresenter()) |
|
James Cook
2016/12/10 00:50:08
nit: cache either the result of WmShell::Get() or
msw
2016/12/10 01:08:12
Done.
|
| + WmShell::Get()->app_list()->GetAppListPresenter()->Show(display_id); |
| } |
| void AppListPresenterMus::Dismiss() { |
| - ConnectIfNeeded(); |
| - presenter_->Dismiss(); |
| + if (WmShell::Get()->app_list()->GetAppListPresenter()) |
| + WmShell::Get()->app_list()->GetAppListPresenter()->Dismiss(); |
| } |
| void AppListPresenterMus::ToggleAppList(int64_t display_id) { |
| - ConnectIfNeeded(); |
| - presenter_->ToggleAppList(display_id); |
| + if (WmShell::Get()->app_list()->GetAppListPresenter()) { |
| + WmShell::Get()->app_list()->GetAppListPresenter()->ToggleAppList( |
| + display_id); |
| + } |
| } |
| bool AppListPresenterMus::IsVisible() const { |
| @@ -49,13 +41,4 @@ bool AppListPresenterMus::GetTargetVisibility() const { |
| return false; |
| } |
| -void AppListPresenterMus::ConnectIfNeeded() { |
| - if (!connector_ || HasConnection(&presenter_)) |
| - return; |
| - connector_->ConnectToInterface(content::mojom::kBrowserServiceName, |
| - &presenter_); |
| - CHECK(HasConnection(&presenter_)) |
| - << "Could not connect to app_list::mojom::AppListPresenter."; |
| -} |
| - |
| } // namespace ash |