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

Unified Diff: ash/mus/app_list_presenter_mus.cc

Issue 2567523002: mash: Have chrome set itself as the app list presenter. (Closed)
Patch Set: Address comments, 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/mus/app_list_presenter_mus.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/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..86d2cacb247ccfb4091ecd610dd66e5cdcc6b960 100644
--- a/ash/mus/app_list_presenter_mus.cc
+++ b/ash/mus/app_list_presenter_mus.cc
@@ -4,37 +4,34 @@
#include "ash/mus/app_list_presenter_mus.h"
-#include "content/public/common/service_names.mojom.h"
-#include "services/service_manager/public/cpp/connector.h"
+#include "ash/common/wm_shell.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);
+ app_list::mojom::AppListPresenter* app_list_presenter =
+ WmShell::Get()->app_list()->GetAppListPresenter();
+ if (app_list_presenter)
+ app_list_presenter->Show(display_id);
}
void AppListPresenterMus::Dismiss() {
- ConnectIfNeeded();
- presenter_->Dismiss();
+ app_list::mojom::AppListPresenter* app_list_presenter =
+ WmShell::Get()->app_list()->GetAppListPresenter();
+ if (app_list_presenter)
+ app_list_presenter->Dismiss();
}
void AppListPresenterMus::ToggleAppList(int64_t display_id) {
- ConnectIfNeeded();
- presenter_->ToggleAppList(display_id);
+ app_list::mojom::AppListPresenter* app_list_presenter =
+ WmShell::Get()->app_list()->GetAppListPresenter();
+ if (app_list_presenter)
+ app_list_presenter->ToggleAppList(display_id);
}
bool AppListPresenterMus::IsVisible() const {
@@ -49,13 +46,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
« no previous file with comments | « ash/mus/app_list_presenter_mus.h ('k') | ash/mus/manifest.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698