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 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
190 ProfileInfo* RegisterProfile(Profile* profile, bool created); | 190 ProfileInfo* RegisterProfile(Profile* profile, bool created); |
191 | 191 |
192 typedef std::pair<FilePath, string16> ProfilePathAndName; | 192 typedef std::pair<FilePath, string16> ProfilePathAndName; |
193 typedef std::vector<ProfilePathAndName> ProfilePathAndNames; | 193 typedef std::vector<ProfilePathAndName> ProfilePathAndNames; |
194 ProfilePathAndNames GetSortedProfilesFromDirectoryMap(); | 194 ProfilePathAndNames GetSortedProfilesFromDirectoryMap(); |
195 | 195 |
196 static bool CompareProfilePathAndName( | 196 static bool CompareProfilePathAndName( |
197 const ProfileManager::ProfilePathAndName& pair1, | 197 const ProfileManager::ProfilePathAndName& pair1, |
198 const ProfileManager::ProfilePathAndName& pair2); | 198 const ProfileManager::ProfilePathAndName& pair2); |
199 | 199 |
| 200 // Adds |profile| to the profile info cache if it's not already there. |
| 201 void AddProfileToCache(Profile* profile); |
| 202 |
200 NotificationRegistrar registrar_; | 203 NotificationRegistrar registrar_; |
201 | 204 |
202 // Indicates that a user has logged in and that the profile specified | 205 // Indicates that a user has logged in and that the profile specified |
203 // in the --login-profile command line argument should be used as the | 206 // in the --login-profile command line argument should be used as the |
204 // default. | 207 // default. |
205 bool logged_in_; | 208 bool logged_in_; |
206 | 209 |
207 // Maps profile path to ProfileInfo (if profile has been created). Use | 210 // Maps profile path to ProfileInfo (if profile has been created). Use |
208 // RegisterProfile() to add into this map. | 211 // RegisterProfile() to add into this map. |
209 typedef std::map<FilePath, linked_ptr<ProfileInfo> > ProfilesInfoMap; | 212 typedef std::map<FilePath, linked_ptr<ProfileInfo> > ProfilesInfoMap; |
210 ProfilesInfoMap profiles_info_; | 213 ProfilesInfoMap profiles_info_; |
211 | 214 |
212 // Object to cache various information about profiles. | 215 // Object to cache various information about profiles. |
213 scoped_ptr<ProfileInfoCache> profile_info_cache_; | 216 scoped_ptr<ProfileInfoCache> profile_info_cache_; |
214 | 217 |
215 DISALLOW_COPY_AND_ASSIGN(ProfileManager); | 218 DISALLOW_COPY_AND_ASSIGN(ProfileManager); |
216 }; | 219 }; |
217 | 220 |
218 // Same as the ProfileManager, but doesn't initialize some services of the | 221 // Same as the ProfileManager, but doesn't initialize some services of the |
219 // profile. This one is useful in unittests. | 222 // profile. This one is useful in unittests. |
220 class ProfileManagerWithoutInit : public ProfileManager { | 223 class ProfileManagerWithoutInit : public ProfileManager { |
221 protected: | 224 protected: |
222 virtual void DoFinalInit(Profile*) {} | 225 virtual void DoFinalInit(Profile*) {} |
223 }; | 226 }; |
224 | 227 |
225 #endif // CHROME_BROWSER_PROFILES_PROFILE_MANAGER_H_ | 228 #endif // CHROME_BROWSER_PROFILES_PROFILE_MANAGER_H_ |
OLD | NEW |