OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 // Explicit asynchronous creation of the profile. |observer| is called | 74 // Explicit asynchronous creation of the profile. |observer| is called |
75 // when profile is created. If profile has already been created, observer | 75 // when profile is created. If profile has already been created, observer |
76 // is called immediately. Should be called on the UI thread. | 76 // is called immediately. Should be called on the UI thread. |
77 void CreateProfileAsync(const FilePath& user_data_dir, | 77 void CreateProfileAsync(const FilePath& user_data_dir, |
78 ProfileManagerObserver* observer); | 78 ProfileManagerObserver* observer); |
79 | 79 |
80 // Initiates default profile creation. If default profile has already been | 80 // Initiates default profile creation. If default profile has already been |
81 // created, observer is called immediately. Should be called on the UI thread. | 81 // created, observer is called immediately. Should be called on the UI thread. |
82 static void CreateDefaultProfileAsync(ProfileManagerObserver* observer); | 82 static void CreateDefaultProfileAsync(ProfileManagerObserver* observer); |
83 | 83 |
84 // Returns the profile with the given |profile_id| or NULL if no such profile | |
85 // exists. | |
86 Profile* GetProfileWithId(ProfileId profile_id); | |
87 | |
88 // Returns true if the profile pointer is known to point to an existing | 84 // Returns true if the profile pointer is known to point to an existing |
89 // profile. | 85 // profile. |
90 bool IsValidProfile(Profile* profile); | 86 bool IsValidProfile(Profile* profile); |
91 | 87 |
92 // Returns the directory where the currently active profile is | 88 // Returns the directory where the currently active profile is |
93 // stored, relative to the user data directory currently in use.. | 89 // stored, relative to the user data directory currently in use.. |
94 FilePath GetCurrentProfileDir(); | 90 FilePath GetCurrentProfileDir(); |
95 | 91 |
96 // Get the Profile last used with this Chrome build. If no signed profile has | 92 // Get the Profile last used with this Chrome build. If no signed profile has |
97 // been stored in Local State, hand back the Default profile. | 93 // been stored in Local State, hand back the Default profile. |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
228 }; | 224 }; |
229 | 225 |
230 // Same as the ProfileManager, but doesn't initialize some services of the | 226 // Same as the ProfileManager, but doesn't initialize some services of the |
231 // profile. This one is useful in unittests. | 227 // profile. This one is useful in unittests. |
232 class ProfileManagerWithoutInit : public ProfileManager { | 228 class ProfileManagerWithoutInit : public ProfileManager { |
233 protected: | 229 protected: |
234 virtual void DoFinalInit(Profile*) {} | 230 virtual void DoFinalInit(Profile*) {} |
235 }; | 231 }; |
236 | 232 |
237 #endif // CHROME_BROWSER_PROFILES_PROFILE_MANAGER_H_ | 233 #endif // CHROME_BROWSER_PROFILES_PROFILE_MANAGER_H_ |
OLD | NEW |