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 <stddef.h> | 10 #include <stddef.h> |
(...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
394 #if !defined(OS_ANDROID) | 394 #if !defined(OS_ANDROID) |
395 BrowserListObserver browser_list_observer_; | 395 BrowserListObserver browser_list_observer_; |
396 #endif // !defined(OS_ANDROID) | 396 #endif // !defined(OS_ANDROID) |
397 | 397 |
398 // Maps profile path to ProfileInfo (if profile has been created). Use | 398 // Maps profile path to ProfileInfo (if profile has been created). Use |
399 // RegisterProfile() to add into this map. This map owns all loaded profile | 399 // RegisterProfile() to add into this map. This map owns all loaded profile |
400 // objects in a running instance of Chrome. | 400 // objects in a running instance of Chrome. |
401 typedef std::map<base::FilePath, linked_ptr<ProfileInfo> > ProfilesInfoMap; | 401 typedef std::map<base::FilePath, linked_ptr<ProfileInfo> > ProfilesInfoMap; |
402 ProfilesInfoMap profiles_info_; | 402 ProfilesInfoMap profiles_info_; |
403 | 403 |
404 // Owns profiles that fails initialization. Like normal profiles, they are not | |
Peter Kasting
2016/06/13 04:43:20
Nit: fail
WC Leung
2016/06/13 08:06:45
Acknowledged.
WC Leung
2016/06/15 13:08:39
Done.
| |
405 // safe to destroy from memory before shutdown. | |
Peter Kasting
2016/06/13 04:43:20
Nit: "...they must not be deleted before shutdown.
WC Leung
2016/06/13 08:06:45
Acknowledged.
WC Leung
2016/06/15 13:08:39
Actually some services (e.g. pref store) that Prof
| |
406 std::vector<std::unique_ptr<Profile>> failed_profiles_; | |
407 | |
404 // Manages the process of creating, deleteing and updating Desktop shortcuts. | 408 // Manages the process of creating, deleteing and updating Desktop shortcuts. |
405 std::unique_ptr<ProfileShortcutManager> profile_shortcut_manager_; | 409 std::unique_ptr<ProfileShortcutManager> profile_shortcut_manager_; |
406 | 410 |
407 // For keeping track of the last active profiles. | 411 // For keeping track of the last active profiles. |
408 std::map<Profile*, int> browser_counts_; | 412 std::map<Profile*, int> browser_counts_; |
409 // On startup we launch the active profiles in the order they became active | 413 // On startup we launch the active profiles in the order they became active |
410 // during the last run. This is why they are kept in a list, not in a set. | 414 // during the last run. This is why they are kept in a list, not in a set. |
411 std::vector<Profile*> active_profiles_; | 415 std::vector<Profile*> active_profiles_; |
412 bool closing_all_browsers_; | 416 bool closing_all_browsers_; |
413 | 417 |
414 DISALLOW_COPY_AND_ASSIGN(ProfileManager); | 418 DISALLOW_COPY_AND_ASSIGN(ProfileManager); |
415 }; | 419 }; |
416 | 420 |
417 // Same as the ProfileManager, but doesn't initialize some services of the | 421 // Same as the ProfileManager, but doesn't initialize some services of the |
418 // profile. This one is useful in unittests. | 422 // profile. This one is useful in unittests. |
419 class ProfileManagerWithoutInit : public ProfileManager { | 423 class ProfileManagerWithoutInit : public ProfileManager { |
420 public: | 424 public: |
421 explicit ProfileManagerWithoutInit(const base::FilePath& user_data_dir); | 425 explicit ProfileManagerWithoutInit(const base::FilePath& user_data_dir); |
422 | 426 |
423 protected: | 427 protected: |
424 void DoFinalInitForServices(Profile*, bool) override {} | 428 void DoFinalInitForServices(Profile*, bool) override {} |
425 void DoFinalInitLogging(Profile*) override {} | 429 void DoFinalInitLogging(Profile*) override {} |
426 }; | 430 }; |
427 | 431 |
428 #endif // CHROME_BROWSER_PROFILES_PROFILE_MANAGER_H_ | 432 #endif // CHROME_BROWSER_PROFILES_PROFILE_MANAGER_H_ |
OLD | NEW |