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 #pragma once | 9 #pragma once |
10 | 10 |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 #endif | 47 #endif |
48 | 48 |
49 // Physically remove deleted profile directories from disk. | 49 // Physically remove deleted profile directories from disk. |
50 static void NukeDeletedProfilesFromDisk(); | 50 static void NukeDeletedProfilesFromDisk(); |
51 | 51 |
52 // DEPRECATED: DO NOT USE unless in ChromeOS. | 52 // DEPRECATED: DO NOT USE unless in ChromeOS. |
53 // Returns the default profile. This adds the profile to the | 53 // Returns the default profile. This adds the profile to the |
54 // ProfileManager if it doesn't already exist. This method returns NULL if | 54 // ProfileManager if it doesn't already exist. This method returns NULL if |
55 // the profile doesn't exist and we can't create it. | 55 // the profile doesn't exist and we can't create it. |
56 // The profile used can be overridden by using --login-profile on cros. | 56 // The profile used can be overridden by using --login-profile on cros. |
57 Profile* GetDefaultProfile(const FilePath& user_data_dir); | 57 // Virtual for testing. |
| 58 virtual Profile* GetDefaultProfile(const FilePath& user_data_dir); |
58 | 59 |
59 // DEPRECATED: DO NOT USE unless in ChromeOS. | 60 // DEPRECATED: DO NOT USE unless in ChromeOS. |
60 // Same as instance method but provides the default user_data_dir as well. | 61 // Same as instance method but provides the default user_data_dir as well. |
61 static Profile* GetDefaultProfile(); | 62 static Profile* GetDefaultProfile(); |
62 | 63 |
63 // DEPRECATED: DO NOT USE unless in ChromeOS. | 64 // DEPRECATED: DO NOT USE unless in ChromeOS. |
64 // Same as GetDefaultProfile() but returns OffTheRecord profile | 65 // Same as GetDefaultProfile() but returns OffTheRecord profile |
65 // if guest login. | 66 // if guest login. |
66 static Profile* GetDefaultProfileOrOffTheRecord(); | 67 static Profile* GetDefaultProfileOrOffTheRecord(); |
67 | 68 |
(...skipping 20 matching lines...) Expand all Loading... |
88 // profile. | 89 // profile. |
89 bool IsValidProfile(Profile* profile); | 90 bool IsValidProfile(Profile* profile); |
90 | 91 |
91 // Returns the directory where the first created profile is stored, | 92 // Returns the directory where the first created profile is stored, |
92 // relative to the user data directory currently in use.. | 93 // relative to the user data directory currently in use.. |
93 FilePath GetInitialProfileDir(); | 94 FilePath GetInitialProfileDir(); |
94 | 95 |
95 // Get the Profile last used (the Profile to which owns the most recently | 96 // Get the Profile last used (the Profile to which owns the most recently |
96 // focused window) with this Chrome build. If no signed profile has been | 97 // focused window) with this Chrome build. If no signed profile has been |
97 // stored in Local State, hand back the Default profile. | 98 // stored in Local State, hand back the Default profile. |
98 Profile* GetLastUsedProfile(const FilePath& user_data_dir); | 99 // Virtual for testing. |
| 100 virtual Profile* GetLastUsedProfile(const FilePath& user_data_dir); |
99 | 101 |
100 // Same as instance method but provides the default user_data_dir as well. | 102 // Same as instance method but provides the default user_data_dir as well. |
101 static Profile* GetLastUsedProfile(); | 103 static Profile* GetLastUsedProfile(); |
102 | 104 |
103 // Get the Profiles which are currently open, i.e., have open browsers, or | 105 // Get the Profiles which are currently open, i.e., have open browsers, or |
104 // were open the last time Chrome was running. The Profiles appear in the | 106 // were open the last time Chrome was running. The Profiles appear in the |
105 // order they were opened. The last used profile will be on the list, but its | 107 // order they were opened. The last used profile will be on the list, but its |
106 // index on the list will depend on when it was opened (it is not necessarily | 108 // index on the list will depend on when it was opened (it is not necessarily |
107 // the last one). | 109 // the last one). |
108 std::vector<Profile*> GetLastOpenedProfiles(const FilePath& user_data_dir); | 110 std::vector<Profile*> GetLastOpenedProfiles(const FilePath& user_data_dir); |
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
346 class ProfileManagerWithoutInit : public ProfileManager { | 348 class ProfileManagerWithoutInit : public ProfileManager { |
347 public: | 349 public: |
348 explicit ProfileManagerWithoutInit(const FilePath& user_data_dir); | 350 explicit ProfileManagerWithoutInit(const FilePath& user_data_dir); |
349 | 351 |
350 protected: | 352 protected: |
351 virtual void DoFinalInitForServices(Profile*, bool) OVERRIDE {} | 353 virtual void DoFinalInitForServices(Profile*, bool) OVERRIDE {} |
352 virtual void DoFinalInitLogging(Profile*) OVERRIDE {} | 354 virtual void DoFinalInitLogging(Profile*) OVERRIDE {} |
353 }; | 355 }; |
354 | 356 |
355 #endif // CHROME_BROWSER_PROFILES_PROFILE_MANAGER_H_ | 357 #endif // CHROME_BROWSER_PROFILES_PROFILE_MANAGER_H_ |
OLD | NEW |