Chromium Code Reviews| 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 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 171 // that. If activating an exiting window and multiple windows exists then the | 171 // that. If activating an exiting window and multiple windows exists then the |
| 172 // window that was most recently active is activated. This is used for | 172 // window that was most recently active is activated. This is used for |
| 173 // creation of a window from the multi-profile dropdown menu. | 173 // creation of a window from the multi-profile dropdown menu. |
| 174 static void FindOrCreateNewWindowForProfile( | 174 static void FindOrCreateNewWindowForProfile( |
| 175 Profile* profile, | 175 Profile* profile, |
| 176 chrome::startup::IsProcessStartup process_startup, | 176 chrome::startup::IsProcessStartup process_startup, |
| 177 chrome::startup::IsFirstRun is_first_run, | 177 chrome::startup::IsFirstRun is_first_run, |
| 178 chrome::HostDesktopType desktop_type, | 178 chrome::HostDesktopType desktop_type, |
| 179 bool always_create); | 179 bool always_create); |
| 180 | 180 |
| 181 static void SwitchToProfile( | |
|
Nikita (slow)
2013/06/11 18:22:16
Please add method comment.
noms
2013/06/12 20:41:54
Done.
| |
| 182 const base::FilePath& path, | |
| 183 chrome::HostDesktopType desktop_type, | |
| 184 bool always_create); | |
| 185 | |
| 181 // Profile::Delegate implementation: | 186 // Profile::Delegate implementation: |
| 182 virtual void OnProfileCreated(Profile* profile, | 187 virtual void OnProfileCreated(Profile* profile, |
| 183 bool success, | 188 bool success, |
| 184 bool is_new_profile) OVERRIDE; | 189 bool is_new_profile) OVERRIDE; |
| 185 | 190 |
| 186 // Add or remove a profile launcher to/from the list of launchers waiting for | 191 // Add or remove a profile launcher to/from the list of launchers waiting for |
| 187 // new profiles to be created from the multi-profile menu. | 192 // new profiles to be created from the multi-profile menu. |
| 188 void AddProfileLauncher(NewProfileLauncher* profile_launcher); | 193 void AddProfileLauncher(NewProfileLauncher* profile_launcher); |
| 189 void RemoveProfileLauncher(NewProfileLauncher* profile_launcher); | 194 void RemoveProfileLauncher(NewProfileLauncher* profile_launcher); |
| 190 | 195 |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 254 | 259 |
| 255 // Creates a new profile asynchronously by calling into the profile's | 260 // Creates a new profile asynchronously by calling into the profile's |
| 256 // asynchronous profile creation method. Virtual so that unittests can return | 261 // asynchronous profile creation method. Virtual so that unittests can return |
| 257 // a TestingProfile instead of the Profile's result. | 262 // a TestingProfile instead of the Profile's result. |
| 258 virtual Profile* CreateProfileAsyncHelper(const base::FilePath& path, | 263 virtual Profile* CreateProfileAsyncHelper(const base::FilePath& path, |
| 259 Delegate* delegate); | 264 Delegate* delegate); |
| 260 | 265 |
| 261 private: | 266 private: |
| 262 friend class TestingProfileManager; | 267 friend class TestingProfileManager; |
| 263 FRIEND_TEST_ALL_PREFIXES(ProfileManagerBrowserTest, DeleteAllProfiles); | 268 FRIEND_TEST_ALL_PREFIXES(ProfileManagerBrowserTest, DeleteAllProfiles); |
| 269 FRIEND_TEST_ALL_PREFIXES(ProfileManagerBrowserTest, SwitchToProfile); | |
| 264 | 270 |
| 265 // This struct contains information about profiles which are being loaded or | 271 // This struct contains information about profiles which are being loaded or |
| 266 // were loaded. | 272 // were loaded. |
| 267 struct ProfileInfo { | 273 struct ProfileInfo { |
| 268 ProfileInfo(Profile* profile, bool created); | 274 ProfileInfo(Profile* profile, bool created); |
| 269 | 275 |
| 270 ~ProfileInfo(); | 276 ~ProfileInfo(); |
| 271 | 277 |
| 272 scoped_ptr<Profile> profile; | 278 scoped_ptr<Profile> profile; |
| 273 // Whether profile has been fully loaded (created and initialized). | 279 // Whether profile has been fully loaded (created and initialized). |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 386 class ProfileManagerWithoutInit : public ProfileManager { | 392 class ProfileManagerWithoutInit : public ProfileManager { |
| 387 public: | 393 public: |
| 388 explicit ProfileManagerWithoutInit(const base::FilePath& user_data_dir); | 394 explicit ProfileManagerWithoutInit(const base::FilePath& user_data_dir); |
| 389 | 395 |
| 390 protected: | 396 protected: |
| 391 virtual void DoFinalInitForServices(Profile*, bool) OVERRIDE {} | 397 virtual void DoFinalInitForServices(Profile*, bool) OVERRIDE {} |
| 392 virtual void DoFinalInitLogging(Profile*) OVERRIDE {} | 398 virtual void DoFinalInitLogging(Profile*) OVERRIDE {} |
| 393 }; | 399 }; |
| 394 | 400 |
| 395 #endif // CHROME_BROWSER_PROFILES_PROFILE_MANAGER_H_ | 401 #endif // CHROME_BROWSER_PROFILES_PROFILE_MANAGER_H_ |
| OLD | NEW |