Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_APP_LIST_APP_LIST_SERVICE_IMPL_H_ | 5 #ifndef CHROME_BROWSER_UI_APP_LIST_APP_LIST_SERVICE_IMPL_H_ |
| 6 #define CHROME_BROWSER_UI_APP_LIST_APP_LIST_SERVICE_IMPL_H_ | 6 #define CHROME_BROWSER_UI_APP_LIST_APP_LIST_SERVICE_IMPL_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 10 matching lines...) Expand all Loading... | |
| 21 } | 21 } |
| 22 | 22 |
| 23 // Parts of the AppListService implementation shared between platforms. | 23 // Parts of the AppListService implementation shared between platforms. |
| 24 class AppListServiceImpl : public AppListService, | 24 class AppListServiceImpl : public AppListService, |
| 25 public ProfileInfoCacheObserver { | 25 public ProfileInfoCacheObserver { |
| 26 public: | 26 public: |
| 27 static void RecordAppListLaunch(); | 27 static void RecordAppListLaunch(); |
| 28 static void RecordAppListAppLaunch(); | 28 static void RecordAppListAppLaunch(); |
| 29 static void SendAppListStats(); | 29 static void SendAppListStats(); |
| 30 | 30 |
| 31 // AppListService overrides: | |
| 32 virtual void SetProfilePath(const base::FilePath& profile_path) OVERRIDE; | |
|
koz (OOO until 15th September)
2013/08/08 06:25:02
nit: newline
calamity
2013/08/09 09:10:57
Done.
| |
| 33 // Shows the app list for the profile at the current |profile_path|. If the | |
| 34 // profile has not been loaded, this will load the profile and then show the | |
| 35 // app list. | |
| 36 virtual void Show() OVERRIDE; | |
| 37 | |
| 31 protected: | 38 protected: |
| 32 AppListServiceImpl(); | 39 AppListServiceImpl(); |
| 33 virtual ~AppListServiceImpl(); | 40 virtual ~AppListServiceImpl(); |
| 34 | 41 |
| 35 Profile* profile() const { return profile_; } | 42 Profile* profile() const { return profile_; } |
| 36 void SetProfile(Profile* new_profile); | 43 void SetProfile(Profile* new_profile); |
| 37 void InvalidatePendingProfileLoads(); | 44 void InvalidatePendingProfileLoads(); |
| 38 ProfileLoader& profile_loader() { return profile_loader_; } | 45 ProfileLoader& profile_loader() { return profile_loader_; } |
| 39 const ProfileLoader& profile_loader() const { return profile_loader_; } | 46 const ProfileLoader& profile_loader() const { return profile_loader_; } |
| 40 | 47 |
| 41 // Process command line flags shared between desktop implementations of the | 48 // Process command line flags shared between desktop implementations of the |
| 42 // app list. Currently this allows for enabling or disabling the app list. | 49 // app list. Currently this allows for enabling or disabling the app list. |
| 43 void HandleCommandLineFlags(Profile* initial_profile); | 50 void HandleCommandLineFlags(Profile* initial_profile); |
| 44 | 51 |
| 45 // Create a platform-specific shortcut for the app list. | 52 // Create a platform-specific shortcut for the app list. |
| 46 virtual void CreateShortcut(); | 53 virtual void CreateShortcut(); |
| 47 | 54 |
| 48 // AppListService overrides: | 55 // AppListService overrides: |
| 49 virtual void HandleFirstRun() OVERRIDE; | 56 virtual void HandleFirstRun() OVERRIDE; |
| 50 virtual void Init(Profile* initial_profile) OVERRIDE; | 57 virtual void Init(Profile* initial_profile) OVERRIDE; |
| 51 | 58 |
| 52 // Returns the app list path configured in BrowserProcess::local_state(). | 59 // Returns the app list path configured in BrowserProcess::local_state(). |
| 53 virtual base::FilePath GetProfilePath( | 60 virtual base::FilePath GetProfilePath( |
| 54 const base::FilePath& user_data_dir) OVERRIDE; | 61 const base::FilePath& user_data_dir) OVERRIDE; |
| 55 virtual void SetProfilePath(const base::FilePath& profile_path) OVERRIDE; | |
| 56 virtual void Show() OVERRIDE; | |
| 57 virtual void EnableAppList(Profile* initial_profile) OVERRIDE; | 62 virtual void EnableAppList(Profile* initial_profile) OVERRIDE; |
| 58 virtual AppListControllerDelegate* CreateControllerDelegate() OVERRIDE; | 63 virtual AppListControllerDelegate* CreateControllerDelegate() OVERRIDE; |
| 59 | 64 |
| 60 private: | 65 private: |
| 61 // Loads a profile asynchronously and calls OnProfileLoaded() when done. | 66 // Loads a profile asynchronously and calls OnProfileLoaded() when done. |
| 62 void LoadProfileAsync(const base::FilePath& profile_file_path); | 67 void LoadProfileAsync(const base::FilePath& profile_file_path); |
| 63 | 68 |
| 64 // Callback for asynchronous profile load. | 69 // Callback for asynchronous profile load. |
| 65 void OnProfileLoaded(int profile_load_sequence_id, | 70 void OnProfileLoaded(int profile_load_sequence_id, |
| 66 Profile* profile, | 71 Profile* profile, |
| (...skipping 15 matching lines...) Expand all Loading... | |
| 82 int pending_profile_loads_; | 87 int pending_profile_loads_; |
| 83 | 88 |
| 84 base::WeakPtrFactory<AppListServiceImpl> weak_factory_; | 89 base::WeakPtrFactory<AppListServiceImpl> weak_factory_; |
| 85 | 90 |
| 86 ProfileLoader profile_loader_; | 91 ProfileLoader profile_loader_; |
| 87 | 92 |
| 88 DISALLOW_COPY_AND_ASSIGN(AppListServiceImpl); | 93 DISALLOW_COPY_AND_ASSIGN(AppListServiceImpl); |
| 89 }; | 94 }; |
| 90 | 95 |
| 91 #endif // CHROME_BROWSER_UI_APP_LIST_APP_LIST_SERVICE_IMPL_H_ | 96 #endif // CHROME_BROWSER_UI_APP_LIST_APP_LIST_SERVICE_IMPL_H_ |
| OLD | NEW |