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

Side by Side Diff: ash/mus/app_list_presenter_mus.cc

Issue 2509853002: Convert //mash to define service names in mojom (Closed)
Patch Set: . Created 4 years, 1 month 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
« no previous file with comments | « ash/mus/app_launch_unittest.cc ('k') | ash/mus/keyboard_ui_mus.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "ash/mus/app_list_presenter_mus.h" 5 #include "ash/mus/app_list_presenter_mus.h"
6 6
7 #include "content/public/common/service_names.mojom.h"
7 #include "services/service_manager/public/cpp/connector.h" 8 #include "services/service_manager/public/cpp/connector.h"
8 9
9 namespace ash { 10 namespace ash {
10 11
11 namespace { 12 namespace {
12 13
13 bool HasConnection(app_list::mojom::AppListPresenterPtr* interface_ptr) { 14 bool HasConnection(app_list::mojom::AppListPresenterPtr* interface_ptr) {
14 return interface_ptr->is_bound() && !interface_ptr->encountered_error(); 15 return interface_ptr->is_bound() && !interface_ptr->encountered_error();
15 } 16 }
16 17
(...skipping 27 matching lines...) Expand all
44 // TODO(mfomitchev): we have GetTargetVisibility() in mojom, but this 45 // TODO(mfomitchev): we have GetTargetVisibility() in mojom, but this
45 // shouldn't be a synchronous method. We should go through the call sites and 46 // shouldn't be a synchronous method. We should go through the call sites and
46 // either teach them to use a callback, or perhaps use a visibility observer. 47 // either teach them to use a callback, or perhaps use a visibility observer.
47 // NOTIMPLEMENTED(); 48 // NOTIMPLEMENTED();
48 return false; 49 return false;
49 } 50 }
50 51
51 void AppListPresenterMus::ConnectIfNeeded() { 52 void AppListPresenterMus::ConnectIfNeeded() {
52 if (!connector_ || HasConnection(&presenter_)) 53 if (!connector_ || HasConnection(&presenter_))
53 return; 54 return;
54 connector_->ConnectToInterface("content_browser", &presenter_); 55 connector_->ConnectToInterface(content::mojom::kBrowserServiceName,
56 &presenter_);
55 CHECK(HasConnection(&presenter_)) 57 CHECK(HasConnection(&presenter_))
56 << "Could not connect to app_list::mojom::AppListPresenter."; 58 << "Could not connect to app_list::mojom::AppListPresenter.";
57 } 59 }
58 60
59 } // namespace ash 61 } // namespace ash
OLDNEW
« no previous file with comments | « ash/mus/app_launch_unittest.cc ('k') | ash/mus/keyboard_ui_mus.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698