OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 // This class keeps track of the currently-active profiles in the runtime. | 5 // This class keeps track of the currently-active profiles in the runtime. |
6 | 6 |
7 #ifndef CHROME_BROWSER_PROFILES_PROFILE_MANAGER_H_ | 7 #ifndef CHROME_BROWSER_PROFILES_PROFILE_MANAGER_H_ |
8 #define CHROME_BROWSER_PROFILES_PROFILE_MANAGER_H_ | 8 #define CHROME_BROWSER_PROFILES_PROFILE_MANAGER_H_ |
9 | 9 |
10 #include <list> | 10 #include <list> |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 | 156 |
157 // Returns a ProfileInfoCache object which can be used to get information | 157 // Returns a ProfileInfoCache object which can be used to get information |
158 // about profiles without having to load them from disk. | 158 // about profiles without having to load them from disk. |
159 ProfileInfoCache& GetProfileInfoCache(); | 159 ProfileInfoCache& GetProfileInfoCache(); |
160 | 160 |
161 // Returns a ProfileShortcut Manager that enables the caller to create | 161 // Returns a ProfileShortcut Manager that enables the caller to create |
162 // profile specfic desktop shortcuts. | 162 // profile specfic desktop shortcuts. |
163 ProfileShortcutManager* profile_shortcut_manager(); | 163 ProfileShortcutManager* profile_shortcut_manager(); |
164 | 164 |
165 // Schedules the profile at the given path to be deleted on shutdown. If we're | 165 // Schedules the profile at the given path to be deleted on shutdown. If we're |
166 // deleting the last profile, a new one will be created in its place, and in | 166 // deleting the last profile and |suppress_profile_creation| is false, a new |
167 // that case the callback will be called when profile creation is complete. | 167 // one will be created in its place, and the callback will be called when |
| 168 // profile creation is complete. |
168 void ScheduleProfileForDeletion(const base::FilePath& profile_dir, | 169 void ScheduleProfileForDeletion(const base::FilePath& profile_dir, |
| 170 bool suppress_profile_creation, |
169 const CreateCallback& callback); | 171 const CreateCallback& callback); |
170 | 172 |
171 // Called on start-up if there are any stale ephemeral profiles to be deleted. | |
172 // This can be the case if the browser has crashed and the clean-up code had | |
173 // no chance to run then. | |
174 static void CleanUpStaleProfiles( | |
175 const std::vector<base::FilePath>& profile_paths); | |
176 | |
177 // Autoloads profiles if they are running background apps. | 173 // Autoloads profiles if they are running background apps. |
178 void AutoloadProfiles(); | 174 void AutoloadProfiles(); |
179 | 175 |
180 // Initializes user prefs of |profile|. This includes profile name and | 176 // Initializes user prefs of |profile|. This includes profile name and |
181 // avatar values. | 177 // avatar values. |
182 void InitProfileUserPrefs(Profile* profile); | 178 void InitProfileUserPrefs(Profile* profile); |
183 | 179 |
184 // Register and add testing profile to the ProfileManager. Use ONLY in tests. | 180 // Register and add testing profile to the ProfileManager. Use ONLY in tests. |
185 // This allows the creation of Profiles outside of the standard creation path | 181 // This allows the creation of Profiles outside of the standard creation path |
186 // for testing. If |addToCache|, adds to ProfileInfoCache as well. | 182 // for testing. If |addToCache|, adds to ProfileInfoCache as well. |
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
372 class ProfileManagerWithoutInit : public ProfileManager { | 368 class ProfileManagerWithoutInit : public ProfileManager { |
373 public: | 369 public: |
374 explicit ProfileManagerWithoutInit(const base::FilePath& user_data_dir); | 370 explicit ProfileManagerWithoutInit(const base::FilePath& user_data_dir); |
375 | 371 |
376 protected: | 372 protected: |
377 void DoFinalInitForServices(Profile*, bool) override {} | 373 void DoFinalInitForServices(Profile*, bool) override {} |
378 void DoFinalInitLogging(Profile*) override {} | 374 void DoFinalInitLogging(Profile*) override {} |
379 }; | 375 }; |
380 | 376 |
381 #endif // CHROME_BROWSER_PROFILES_PROFILE_MANAGER_H_ | 377 #endif // CHROME_BROWSER_PROFILES_PROFILE_MANAGER_H_ |
OLD | NEW |