| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 CHROME_BROWSER_UI_ASH_APP_LIST_APP_LIST_SERVICE_ASH_H_ | 5 #ifndef CHROME_BROWSER_UI_ASH_APP_LIST_APP_LIST_SERVICE_ASH_H_ |
| 6 #define CHROME_BROWSER_UI_ASH_APP_LIST_APP_LIST_SERVICE_ASH_H_ | 6 #define CHROME_BROWSER_UI_ASH_APP_LIST_APP_LIST_SERVICE_ASH_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "chrome/browser/ui/app_list/app_list_service_impl.h" | 10 #include "chrome/browser/ui/app_list/app_list_service_impl.h" |
| 11 #include "ui/app_list/app_list_model.h" | 11 #include "ui/app_list/app_list_model.h" |
| 12 | 12 |
| 13 namespace app_list { |
| 14 class AppListController; |
| 15 } |
| 16 |
| 13 class AppListControllerDelegateAsh; | 17 class AppListControllerDelegateAsh; |
| 18 class AppListShowerAsh; |
| 14 | 19 |
| 15 namespace base { | 20 namespace base { |
| 16 template <typename T> struct DefaultSingletonTraits; | 21 template <typename T> struct DefaultSingletonTraits; |
| 17 } | 22 } |
| 18 | 23 |
| 19 // AppListServiceAsh wraps functionality in ChromeLauncherController and the Ash | 24 // AppListServiceAsh wraps functionality in ChromeLauncherController and the Ash |
| 20 // Shell for showing and hiding the app list on the Ash desktop. | 25 // Shell for showing and hiding the app list on the Ash desktop. |
| 21 class AppListServiceAsh : public AppListServiceImpl { | 26 class AppListServiceAsh : public AppListServiceImpl { |
| 22 public: | 27 public: |
| 23 static AppListServiceAsh* GetInstance(); | 28 static AppListServiceAsh* GetInstance(); |
| 24 | 29 |
| 30 app_list::AppListController* GetAppListController(); |
| 31 |
| 25 // AppListService overrides: | 32 // AppListService overrides: |
| 26 void Init(Profile* initial_profile) override; | 33 void Init(Profile* initial_profile) override; |
| 27 | 34 |
| 28 // ProfileInfoCacheObserver overrides: | 35 // ProfileInfoCacheObserver overrides: |
| 29 // On ChromeOS this should never happen. On other platforms, there is always a | 36 // On ChromeOS this should never happen. On other platforms, there is always a |
| 30 // Non-ash AppListService that is responsible for handling this. | 37 // Non-ash AppListService that is responsible for handling this. |
| 31 // TODO(calamity): Ash shouldn't observe the ProfileInfoCache at all. | 38 // TODO(calamity): Ash shouldn't observe the ProfileInfoCache at all. |
| 32 void OnProfileWillBeRemoved(const base::FilePath& profile_path) override; | 39 void OnProfileWillBeRemoved(const base::FilePath& profile_path) override; |
| 33 | 40 |
| 34 private: | 41 private: |
| 35 friend struct base::DefaultSingletonTraits<AppListServiceAsh>; | 42 friend struct base::DefaultSingletonTraits<AppListServiceAsh>; |
| 36 | 43 |
| 37 AppListServiceAsh(); | 44 AppListServiceAsh(); |
| 38 ~AppListServiceAsh() override; | 45 ~AppListServiceAsh() override; |
| 39 | 46 |
| 47 void SetViewDelegateForShower(); |
| 48 |
| 40 // Shows the app list if it isn't already showing and Switches to |state|, | 49 // Shows the app list if it isn't already showing and Switches to |state|, |
| 41 // unless it is |INVALID_STATE| (in which case, opens on the default state). | 50 // unless it is |INVALID_STATE| (in which case, opens on the default state). |
| 42 void ShowAndSwitchToState(app_list::AppListModel::State state); | 51 void ShowAndSwitchToState(app_list::AppListModel::State state); |
| 43 | 52 |
| 44 // AppListService overrides: | 53 // AppListService overrides: |
| 45 base::FilePath GetProfilePath(const base::FilePath& user_data_dir) override; | 54 base::FilePath GetProfilePath(const base::FilePath& user_data_dir) override; |
| 46 void ShowForProfile(Profile* default_profile) override; | 55 void ShowForProfile(Profile* default_profile) override; |
| 47 void ShowForAppInstall(Profile* profile, | 56 void ShowForAppInstall(Profile* profile, |
| 48 const std::string& extension_id, | 57 const std::string& extension_id, |
| 49 bool start_discovery_tracking) override; | 58 bool start_discovery_tracking) override; |
| 50 void ShowForCustomLauncherPage(Profile* profile) override; | 59 void ShowForCustomLauncherPage(Profile* profile) override; |
| 51 void HideCustomLauncherPage() override; | 60 void HideCustomLauncherPage() override; |
| 52 bool IsAppListVisible() const override; | 61 bool IsAppListVisible() const override; |
| 53 void DismissAppList() override; | 62 void DismissAppList() override; |
| 54 void EnableAppList(Profile* initial_profile, | 63 void EnableAppList(Profile* initial_profile, |
| 55 AppListEnableSource enable_source) override; | 64 AppListEnableSource enable_source) override; |
| 56 gfx::NativeWindow GetAppListWindow() override; | 65 gfx::NativeWindow GetAppListWindow() override; |
| 57 Profile* GetCurrentAppListProfile() override; | 66 Profile* GetCurrentAppListProfile() override; |
| 58 AppListControllerDelegate* GetControllerDelegate() override; | 67 AppListControllerDelegate* GetControllerDelegate() override; |
| 59 | 68 |
| 60 // ApplistServiceImpl overrides: | 69 // ApplistServiceImpl overrides: |
| 61 void CreateForProfile(Profile* default_profile) override; | 70 void CreateForProfile(Profile* default_profile) override; |
| 62 void DestroyAppList() override; | 71 void DestroyAppList() override; |
| 63 | 72 |
| 73 scoped_ptr<AppListShowerAsh> app_list_shower_; |
| 64 scoped_ptr<AppListControllerDelegateAsh> controller_delegate_; | 74 scoped_ptr<AppListControllerDelegateAsh> controller_delegate_; |
| 65 | 75 |
| 66 DISALLOW_COPY_AND_ASSIGN(AppListServiceAsh); | 76 DISALLOW_COPY_AND_ASSIGN(AppListServiceAsh); |
| 67 }; | 77 }; |
| 68 | 78 |
| 69 #endif // CHROME_BROWSER_UI_ASH_APP_LIST_APP_LIST_SERVICE_ASH_H_ | 79 #endif // CHROME_BROWSER_UI_ASH_APP_LIST_APP_LIST_SERVICE_ASH_H_ |
| OLD | NEW |