| OLD | NEW |
| 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 "services/service_manager/public/cpp/connector.h" | 7 #include "services/service_manager/public/cpp/connector.h" |
| 8 | 8 |
| 9 namespace ash { | 9 namespace ash { |
| 10 | 10 |
| 11 namespace { | 11 namespace { |
| 12 | 12 |
| 13 bool HasConnection(app_list::mojom::AppListPresenterPtr* interface_ptr) { | 13 bool HasConnection(app_list::mojom::AppListPresenterPtr* interface_ptr) { |
| 14 return interface_ptr->is_bound() && !interface_ptr->encountered_error(); | 14 return interface_ptr->is_bound() && !interface_ptr->encountered_error(); |
| 15 } | 15 } |
| 16 | 16 |
| 17 } // namespace | 17 } // namespace |
| 18 | 18 |
| 19 AppListPresenterMus::AppListPresenterMus(::shell::Connector* connector) | 19 AppListPresenterMus::AppListPresenterMus(service_manager::Connector* connector) |
| 20 : connector_(connector) {} | 20 : connector_(connector) {} |
| 21 | 21 |
| 22 AppListPresenterMus::~AppListPresenterMus() {} | 22 AppListPresenterMus::~AppListPresenterMus() {} |
| 23 | 23 |
| 24 void AppListPresenterMus::Show(int64_t display_id) { | 24 void AppListPresenterMus::Show(int64_t display_id) { |
| 25 ConnectIfNeeded(); | 25 ConnectIfNeeded(); |
| 26 presenter_->Show(display_id); | 26 presenter_->Show(display_id); |
| 27 } | 27 } |
| 28 | 28 |
| 29 void AppListPresenterMus::Dismiss() { | 29 void AppListPresenterMus::Dismiss() { |
| (...skipping 20 matching lines...) Expand all Loading... |
| 50 | 50 |
| 51 void AppListPresenterMus::ConnectIfNeeded() { | 51 void AppListPresenterMus::ConnectIfNeeded() { |
| 52 if (!connector_ || HasConnection(&presenter_)) | 52 if (!connector_ || HasConnection(&presenter_)) |
| 53 return; | 53 return; |
| 54 connector_->ConnectToInterface("service:content_browser", &presenter_); | 54 connector_->ConnectToInterface("service:content_browser", &presenter_); |
| 55 CHECK(HasConnection(&presenter_)) | 55 CHECK(HasConnection(&presenter_)) |
| 56 << "Could not connect to app_list::mojom::AppListPresenter."; | 56 << "Could not connect to app_list::mojom::AppListPresenter."; |
| 57 } | 57 } |
| 58 | 58 |
| 59 } // namespace ash | 59 } // namespace ash |
| OLD | NEW |