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

Side by Side Diff: chrome/browser/ui/ash/app_list/app_list_presenter_service.cc

Issue 2718043002: Replace more hardcoded "ash" strings with ash::mojom::kServiceName (Closed)
Patch Set: Remove ash_util includes that are no longer needed. Created 3 years, 9 months 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/ash/app_list/app_list_presenter_service.h" 5 #include "chrome/browser/ui/ash/app_list/app_list_presenter_service.h"
6 6
7 #include "ash/public/interfaces/constants.mojom.h"
7 #include "chrome/browser/ui/ash/app_list/app_list_service_ash.h" 8 #include "chrome/browser/ui/ash/app_list/app_list_service_ash.h"
8 #include "chrome/browser/ui/ash/ash_util.h"
9 #include "content/public/common/service_manager_connection.h" 9 #include "content/public/common/service_manager_connection.h"
10 #include "services/service_manager/public/cpp/connector.h" 10 #include "services/service_manager/public/cpp/connector.h"
11 #include "ui/app_list/presenter/app_list_presenter_impl.h" 11 #include "ui/app_list/presenter/app_list_presenter_impl.h"
12 12
13 AppListPresenterService::AppListPresenterService() : binding_(this) { 13 AppListPresenterService::AppListPresenterService() : binding_(this) {
14 content::ServiceManagerConnection* connection = 14 content::ServiceManagerConnection* connection =
15 content::ServiceManagerConnection::GetForProcess(); 15 content::ServiceManagerConnection::GetForProcess();
16 if (connection && connection->GetConnector()) { 16 if (connection && connection->GetConnector()) {
17 // Connect to the app list interface in the ash service. 17 // Connect to the app list interface in the ash service.
18 app_list::mojom::AppListPtr app_list_ptr; 18 app_list::mojom::AppListPtr app_list_ptr;
19 connection->GetConnector()->BindInterface(ash_util::GetAshServiceName(), 19 connection->GetConnector()->BindInterface(ash::mojom::kServiceName,
20 &app_list_ptr); 20 &app_list_ptr);
21 // Register this object as the app list presenter. 21 // Register this object as the app list presenter.
22 app_list_ptr->SetAppListPresenter(binding_.CreateInterfacePtrAndBind()); 22 app_list_ptr->SetAppListPresenter(binding_.CreateInterfacePtrAndBind());
23 // Pass the interface pointer to the presenter to report visibility changes. 23 // Pass the interface pointer to the presenter to report visibility changes.
24 GetPresenter()->SetAppList(std::move(app_list_ptr)); 24 GetPresenter()->SetAppList(std::move(app_list_ptr));
25 } 25 }
26 } 26 }
27 27
28 AppListPresenterService::~AppListPresenterService() {} 28 AppListPresenterService::~AppListPresenterService() {}
29 29
30 void AppListPresenterService::Show(int64_t display_id) { 30 void AppListPresenterService::Show(int64_t display_id) {
31 GetPresenter()->Show(display_id); 31 GetPresenter()->Show(display_id);
32 } 32 }
33 33
34 void AppListPresenterService::Dismiss() { 34 void AppListPresenterService::Dismiss() {
35 GetPresenter()->Dismiss(); 35 GetPresenter()->Dismiss();
36 } 36 }
37 37
38 void AppListPresenterService::ToggleAppList(int64_t display_id) { 38 void AppListPresenterService::ToggleAppList(int64_t display_id) {
39 GetPresenter()->ToggleAppList(display_id); 39 GetPresenter()->ToggleAppList(display_id);
40 } 40 }
41 41
42 app_list::AppListPresenterImpl* AppListPresenterService::GetPresenter() { 42 app_list::AppListPresenterImpl* AppListPresenterService::GetPresenter() {
43 return AppListServiceAsh::GetInstance()->GetAppListPresenter(); 43 return AppListServiceAsh::GetInstance()->GetAppListPresenter();
44 } 44 }
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/settings/shutdown_policy_forwarder.cc ('k') | chrome/browser/ui/ash/ash_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698