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

Unified Diff: chrome/browser/ui/ash/app_list/app_list_presenter_service.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
Index: chrome/browser/ui/ash/app_list/app_list_presenter_service.cc
diff --git a/chrome/browser/ui/ash/app_list/app_list_presenter_service.cc b/chrome/browser/ui/ash/app_list/app_list_presenter_service.cc
index 58fef58d52bbc54f5fcd9d1363455a0ee41d8a16..2770d89a23bdc18b8ffbdbbc405e1c2f54fd386c 100644
--- a/chrome/browser/ui/ash/app_list/app_list_presenter_service.cc
+++ b/chrome/browser/ui/ash/app_list/app_list_presenter_service.cc
@@ -5,9 +5,24 @@
#include "chrome/browser/ui/ash/app_list/app_list_presenter_service.h"
#include "chrome/browser/ui/ash/app_list/app_list_service_ash.h"
+#include "chrome/browser/ui/ash/ash_util.h"
+#include "content/public/common/service_manager_connection.h"
+#include "services/service_manager/public/cpp/connector.h"
#include "ui/app_list/presenter/app_list_presenter.h"
-AppListPresenterService::AppListPresenterService() {}
+AppListPresenterService::AppListPresenterService() : binding_(this) {
+ content::ServiceManagerConnection* connection =
+ content::ServiceManagerConnection::GetForProcess();
+ if (connection && connection->GetConnector()) {
+ // Connect to the app list interface in the ash service.
+ app_list::mojom::AppListPtr app_list_ptr;
+ connection->GetConnector()->ConnectToInterface(
+ ash_util::GetAshServiceName(), &app_list_ptr);
+ // Register this object as the app list presenter.
+ app_list_ptr->SetAppListPresenter(binding_.CreateInterfacePtrAndBind());
+ }
+}
+
AppListPresenterService::~AppListPresenterService() {}
void AppListPresenterService::Show(int64_t display_id) {
« no previous file with comments | « chrome/browser/ui/ash/app_list/app_list_presenter_service.h ('k') | chrome/browser/ui/ash/app_list/app_list_service_ash.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698