| 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/sysui/app_list_presenter_mus.h" | 5 #include "ash/sysui/app_list_presenter_mus.h" |
| 6 | 6 |
| 7 #include "services/shell/public/cpp/connector.h" | 7 #include "services/shell/public/cpp/connector.h" |
| 8 | 8 |
| 9 namespace ash { | 9 namespace ash { |
| 10 namespace { | 10 namespace { |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 ConnectIfNeeded(); | 38 ConnectIfNeeded(); |
| 39 presenter_->Dismiss(); | 39 presenter_->Dismiss(); |
| 40 } | 40 } |
| 41 | 41 |
| 42 void AppListPresenterMus::ToggleAppList(int64_t display_id) { | 42 void AppListPresenterMus::ToggleAppList(int64_t display_id) { |
| 43 display_id = GetMusDisplayId(display_id); | 43 display_id = GetMusDisplayId(display_id); |
| 44 ConnectIfNeeded(); | 44 ConnectIfNeeded(); |
| 45 presenter_->ToggleAppList(display_id); | 45 presenter_->ToggleAppList(display_id); |
| 46 } | 46 } |
| 47 | 47 |
| 48 bool AppListPresenterMus::IsVisible() const { |
| 49 return false; |
| 50 } |
| 51 |
| 48 bool AppListPresenterMus::GetTargetVisibility() const { | 52 bool AppListPresenterMus::GetTargetVisibility() const { |
| 49 // TODO(mfomitchev): we have GetTargetVisibility() in mojom, but this | 53 // TODO(mfomitchev): we have GetTargetVisibility() in mojom, but this |
| 50 // shouldn't be a synchronous method. We should go through the call sites and | 54 // shouldn't be a synchronous method. We should go through the call sites and |
| 51 // either teach them to use a callback, or perhaps use a visibility observer. | 55 // either teach them to use a callback, or perhaps use a visibility observer. |
| 52 // NOTIMPLEMENTED(); | 56 // NOTIMPLEMENTED(); |
| 53 return false; | 57 return false; |
| 54 } | 58 } |
| 55 | 59 |
| 56 bool AppListPresenterMus::ConnectIfNeeded() { | 60 bool AppListPresenterMus::ConnectIfNeeded() { |
| 57 if (HasConnection(&presenter_)) | 61 if (HasConnection(&presenter_)) |
| 58 return true; | 62 return true; |
| 59 connector_->ConnectToInterface("exe:chrome", &presenter_); | 63 connector_->ConnectToInterface("exe:chrome", &presenter_); |
| 60 CHECK(HasConnection(&presenter_)) | 64 CHECK(HasConnection(&presenter_)) |
| 61 << "Could not connect to app_list::mojom::AppListPresenter."; | 65 << "Could not connect to app_list::mojom::AppListPresenter."; |
| 62 return true; | 66 return true; |
| 63 } | 67 } |
| 64 | 68 |
| 65 } // namespace ash | 69 } // namespace ash |
| OLD | NEW |