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 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
268 private: | 268 private: |
269 DISALLOW_COPY_AND_ASSIGN(ProfileInfo); | 269 DISALLOW_COPY_AND_ASSIGN(ProfileInfo); |
270 }; | 270 }; |
271 | 271 |
272 // Adds a pre-existing Profile object to the set managed by this | 272 // Adds a pre-existing Profile object to the set managed by this |
273 // ProfileManager. This ProfileManager takes ownership of the Profile. | 273 // ProfileManager. This ProfileManager takes ownership of the Profile. |
274 // The Profile should not already be managed by this ProfileManager. | 274 // The Profile should not already be managed by this ProfileManager. |
275 // Returns true if the profile was added, false otherwise. | 275 // Returns true if the profile was added, false otherwise. |
276 bool AddProfile(Profile* profile); | 276 bool AddProfile(Profile* profile); |
277 | 277 |
278 // Schedules the profile at the given path to be deleted on shutdown. | |
279 void FinishDeletingProfile(const base::FilePath& profile_dir); | |
280 | |
278 // Registers profile with given info. Returns pointer to created ProfileInfo | 281 // Registers profile with given info. Returns pointer to created ProfileInfo |
279 // entry. | 282 // entry. |
280 ProfileInfo* RegisterProfile(Profile* profile, bool created); | 283 ProfileInfo* RegisterProfile(Profile* profile, bool created); |
281 | 284 |
282 // Returns ProfileInfo associated with given |path|, registred earlier with | 285 // Returns ProfileInfo associated with given |path|, registred earlier with |
283 // RegisterProfile. | 286 // RegisterProfile. |
284 ProfileInfo* GetProfileInfoByPath(const base::FilePath& path) const; | 287 ProfileInfo* GetProfileInfoByPath(const base::FilePath& path) const; |
285 | 288 |
286 typedef std::pair<base::FilePath, string16> ProfilePathAndName; | 289 typedef std::pair<base::FilePath, string16> ProfilePathAndName; |
287 typedef std::vector<ProfilePathAndName> ProfilePathAndNames; | 290 typedef std::vector<ProfilePathAndName> ProfilePathAndNames; |
(...skipping 17 matching lines...) Expand all Loading... | |
305 // count. | 308 // count. |
306 // Lack of side effects: | 309 // Lack of side effects: |
307 // This function doesn't actually create the directory or touch the file | 310 // This function doesn't actually create the directory or touch the file |
308 // system. | 311 // system. |
309 base::FilePath GenerateNextProfileDirectoryPath(); | 312 base::FilePath GenerateNextProfileDirectoryPath(); |
310 | 313 |
311 void RunCallbacks(const std::vector<CreateCallback>& callbacks, | 314 void RunCallbacks(const std::vector<CreateCallback>& callbacks, |
312 Profile* profile, | 315 Profile* profile, |
313 Profile::CreateStatus status); | 316 Profile::CreateStatus status); |
314 | 317 |
318 void OnNewActiveProfileLoaded(const base::FilePath& profile_dir, | |
Alexei Svitkine (slow)
2013/06/05 20:00:52
Document the params in a comment.
noms (inactive)
2013/06/11 19:32:17
Done.
| |
319 const std::string last_non_managed_profile, | |
320 chrome::HostDesktopType desktop_type, | |
321 Profile* profile, | |
322 Profile::CreateStatus status); | |
323 | |
315 content::NotificationRegistrar registrar_; | 324 content::NotificationRegistrar registrar_; |
316 | 325 |
317 // The path to the user data directory (DIR_USER_DATA). | 326 // The path to the user data directory (DIR_USER_DATA). |
318 const base::FilePath user_data_dir_; | 327 const base::FilePath user_data_dir_; |
319 | 328 |
320 // Indicates that a user has logged in and that the profile specified | 329 // Indicates that a user has logged in and that the profile specified |
321 // in the --login-profile command line argument should be used as the | 330 // in the --login-profile command line argument should be used as the |
322 // default. | 331 // default. |
323 bool logged_in_; | 332 bool logged_in_; |
324 | 333 |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
373 class ProfileManagerWithoutInit : public ProfileManager { | 382 class ProfileManagerWithoutInit : public ProfileManager { |
374 public: | 383 public: |
375 explicit ProfileManagerWithoutInit(const base::FilePath& user_data_dir); | 384 explicit ProfileManagerWithoutInit(const base::FilePath& user_data_dir); |
376 | 385 |
377 protected: | 386 protected: |
378 virtual void DoFinalInitForServices(Profile*, bool) OVERRIDE {} | 387 virtual void DoFinalInitForServices(Profile*, bool) OVERRIDE {} |
379 virtual void DoFinalInitLogging(Profile*) OVERRIDE {} | 388 virtual void DoFinalInitLogging(Profile*) OVERRIDE {} |
380 }; | 389 }; |
381 | 390 |
382 #endif // CHROME_BROWSER_PROFILES_PROFILE_MANAGER_H_ | 391 #endif // CHROME_BROWSER_PROFILES_PROFILE_MANAGER_H_ |
OLD | NEW |