| 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 "content/public/common/service_names.mojom.h" | 7 #include "content/public/common/service_names.mojom.h" |
| 8 #include "services/service_manager/public/cpp/connector.h" | 8 #include "services/service_manager/public/cpp/connector.h" |
| 9 | 9 |
| 10 namespace ash { | 10 namespace ash { |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 void AppListPresenterMus::Dismiss() { | 30 void AppListPresenterMus::Dismiss() { |
| 31 ConnectIfNeeded(); | 31 ConnectIfNeeded(); |
| 32 presenter_->Dismiss(); | 32 presenter_->Dismiss(); |
| 33 } | 33 } |
| 34 | 34 |
| 35 void AppListPresenterMus::ToggleAppList(int64_t display_id) { | 35 void AppListPresenterMus::ToggleAppList(int64_t display_id) { |
| 36 ConnectIfNeeded(); | 36 ConnectIfNeeded(); |
| 37 presenter_->ToggleAppList(display_id); | 37 presenter_->ToggleAppList(display_id); |
| 38 } | 38 } |
| 39 | 39 |
| 40 bool AppListPresenterMus::IsVisible() const { | 40 bool AppListPresenterMus::IsVisible(int64_t display_id) const { |
| 41 return false; | 41 return false; |
| 42 } | 42 } |
| 43 | 43 |
| 44 bool AppListPresenterMus::GetTargetVisibility() const { | 44 bool AppListPresenterMus::GetTargetVisibility(int64_t display_id) const { |
| 45 // TODO(mfomitchev): we have GetTargetVisibility() in mojom, but this | 45 // TODO(mfomitchev): we have GetTargetVisibility() in mojom, but this |
| 46 // 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 |
| 47 // 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. |
| 48 // NOTIMPLEMENTED(); | 48 // NOTIMPLEMENTED(); |
| 49 return false; | 49 return false; |
| 50 } | 50 } |
| 51 | 51 |
| 52 void AppListPresenterMus::ConnectIfNeeded() { | 52 void AppListPresenterMus::ConnectIfNeeded() { |
| 53 if (!connector_ || HasConnection(&presenter_)) | 53 if (!connector_ || HasConnection(&presenter_)) |
| 54 return; | 54 return; |
| 55 connector_->ConnectToInterface(content::mojom::kBrowserServiceName, | 55 connector_->ConnectToInterface(content::mojom::kBrowserServiceName, |
| 56 &presenter_); | 56 &presenter_); |
| 57 CHECK(HasConnection(&presenter_)) | 57 CHECK(HasConnection(&presenter_)) |
| 58 << "Could not connect to app_list::mojom::AppListPresenter."; | 58 << "Could not connect to app_list::mojom::AppListPresenter."; |
| 59 } | 59 } |
| 60 | 60 |
| 61 } // namespace ash | 61 } // namespace ash |
| OLD | NEW |