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 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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, a new one will be created in its place, and in |
167 // that case the callback will be called when profile creation is complete. | 167 // that case the callback will be called when profile creation is complete. |
168 void ScheduleProfileForDeletion(const base::FilePath& profile_dir, | 168 void ScheduleProfileForDeletion(const base::FilePath& profile_dir, |
169 const CreateCallback& callback); | 169 const CreateCallback& callback); |
170 | 170 |
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. | 171 // Autoloads profiles if they are running background apps. |
178 void AutoloadProfiles(); | 172 void AutoloadProfiles(); |
179 | 173 |
| 174 // Checks if any ephemeral profiles are left behind (e.g. because of a browser |
| 175 // crash) and schedule them for deletion. |
| 176 void CleanUpEphemeralProfiles(); |
| 177 |
180 // Initializes user prefs of |profile|. This includes profile name and | 178 // Initializes user prefs of |profile|. This includes profile name and |
181 // avatar values. | 179 // avatar values. |
182 void InitProfileUserPrefs(Profile* profile); | 180 void InitProfileUserPrefs(Profile* profile); |
183 | 181 |
184 // Register and add testing profile to the ProfileManager. Use ONLY in tests. | 182 // 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 | 183 // This allows the creation of Profiles outside of the standard creation path |
186 // for testing. If |addToCache|, adds to ProfileInfoCache as well. | 184 // for testing. If |addToCache|, adds to ProfileInfoCache as well. |
187 // If |start_deferred_task_runners|, starts the deferred task runners. | 185 // If |start_deferred_task_runners|, starts the deferred task runners. |
188 // Use ONLY in tests. | 186 // Use ONLY in tests. |
189 void RegisterTestingProfile(Profile* profile, | 187 void RegisterTestingProfile(Profile* profile, |
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
372 class ProfileManagerWithoutInit : public ProfileManager { | 370 class ProfileManagerWithoutInit : public ProfileManager { |
373 public: | 371 public: |
374 explicit ProfileManagerWithoutInit(const base::FilePath& user_data_dir); | 372 explicit ProfileManagerWithoutInit(const base::FilePath& user_data_dir); |
375 | 373 |
376 protected: | 374 protected: |
377 void DoFinalInitForServices(Profile*, bool) override {} | 375 void DoFinalInitForServices(Profile*, bool) override {} |
378 void DoFinalInitLogging(Profile*) override {} | 376 void DoFinalInitLogging(Profile*) override {} |
379 }; | 377 }; |
380 | 378 |
381 #endif // CHROME_BROWSER_PROFILES_PROFILE_MANAGER_H_ | 379 #endif // CHROME_BROWSER_PROFILES_PROFILE_MANAGER_H_ |
OLD | NEW |