| 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 #ifndef ASH_MUS_APP_LIST_PRESENTER_MUS_H_ | 5 #ifndef ASH_MUS_APP_LIST_PRESENTER_MUS_H_ |
| 6 #define ASH_MUS_APP_LIST_PRESENTER_MUS_H_ | 6 #define ASH_MUS_APP_LIST_PRESENTER_MUS_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "ui/app_list/presenter/app_list_presenter.h" | 9 #include "ui/app_list/presenter/app_list_presenter.h" |
| 10 #include "ui/app_list/presenter/app_list_presenter.mojom.h" | |
| 11 | |
| 12 namespace service_manager { | |
| 13 class Connector; | |
| 14 } | |
| 15 | 10 |
| 16 namespace ash { | 11 namespace ash { |
| 17 | 12 |
| 18 // Mus+ash implementation of the AppListPresenter interface for mash, which | 13 // Mus+ash implementation of the AppListPresenter interface for mash, which |
| 19 // talks to the app list service in chrome. | 14 // talks to the app list presenter service in chrome. |
| 20 class AppListPresenterMus : public app_list::AppListPresenter { | 15 class AppListPresenterMus : public app_list::AppListPresenter { |
| 21 public: | 16 public: |
| 22 explicit AppListPresenterMus(service_manager::Connector* connector); | 17 AppListPresenterMus(); |
| 23 ~AppListPresenterMus() override; | 18 ~AppListPresenterMus() override; |
| 24 | 19 |
| 25 // app_list::AppListPresenter: | 20 // app_list::AppListPresenter: |
| 26 void Show(int64_t display_id) override; | 21 void Show(int64_t display_id) override; |
| 27 void Dismiss() override; | 22 void Dismiss() override; |
| 28 void ToggleAppList(int64_t display_id) override; | 23 void ToggleAppList(int64_t display_id) override; |
| 29 bool IsVisible() const override; | 24 bool IsVisible() const override; |
| 30 bool GetTargetVisibility() const override; | 25 bool GetTargetVisibility() const override; |
| 31 | 26 |
| 32 private: | 27 private: |
| 33 // Connect to the app list service in chrome if the connection hasn't | |
| 34 // been established or has an error. | |
| 35 void ConnectIfNeeded(); | |
| 36 | |
| 37 service_manager::Connector* connector_; | |
| 38 app_list::mojom::AppListPresenterPtr presenter_; | |
| 39 | |
| 40 DISALLOW_COPY_AND_ASSIGN(AppListPresenterMus); | 28 DISALLOW_COPY_AND_ASSIGN(AppListPresenterMus); |
| 41 }; | 29 }; |
| 42 | 30 |
| 43 } // namespace ash | 31 } // namespace ash |
| 44 | 32 |
| 45 #endif // ASH_MUS_APP_LIST_PRESENTER_MUS_H_ | 33 #endif // ASH_MUS_APP_LIST_PRESENTER_MUS_H_ |
| OLD | NEW |