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 // Opens a Browser with the specified profile given by |path|. | |
|
Nikita (slow)
2013/06/14 17:23:15
nit: given > identified
noms (inactive)
2013/06/28 17:31:04
Done.
| |
| 182 // If |always_create| is true then a new window is created | |
| 183 // even if a window for that profile already exists. | |
| 184 static void SwitchToProfile( | |
| 185 const base::FilePath& path, | |
| 186 chrome::HostDesktopType desktop_type, | |
| 187 bool always_create); | |
| 188 | |
| 181 // Profile::Delegate implementation: | 189 // Profile::Delegate implementation: |
| 182 virtual void OnProfileCreated(Profile* profile, | 190 virtual void OnProfileCreated(Profile* profile, |
| 183 bool success, | 191 bool success, |
| 184 bool is_new_profile) OVERRIDE; | 192 bool is_new_profile) OVERRIDE; |
| 185 | 193 |
| 186 // Add or remove a profile launcher to/from the list of launchers waiting for | 194 // 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. | 195 // new profiles to be created from the multi-profile menu. |
| 188 void AddProfileLauncher(NewProfileLauncher* profile_launcher); | 196 void AddProfileLauncher(NewProfileLauncher* profile_launcher); |
| 189 void RemoveProfileLauncher(NewProfileLauncher* profile_launcher); | 197 void RemoveProfileLauncher(NewProfileLauncher* profile_launcher); |
| 190 | 198 |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 254 | 262 |
| 255 // Creates a new profile asynchronously by calling into the profile's | 263 // Creates a new profile asynchronously by calling into the profile's |
| 256 // asynchronous profile creation method. Virtual so that unittests can return | 264 // asynchronous profile creation method. Virtual so that unittests can return |
| 257 // a TestingProfile instead of the Profile's result. | 265 // a TestingProfile instead of the Profile's result. |
| 258 virtual Profile* CreateProfileAsyncHelper(const base::FilePath& path, | 266 virtual Profile* CreateProfileAsyncHelper(const base::FilePath& path, |
| 259 Delegate* delegate); | 267 Delegate* delegate); |
| 260 | 268 |
| 261 private: | 269 private: |
| 262 friend class TestingProfileManager; | 270 friend class TestingProfileManager; |
| 263 FRIEND_TEST_ALL_PREFIXES(ProfileManagerBrowserTest, DeleteAllProfiles); | 271 FRIEND_TEST_ALL_PREFIXES(ProfileManagerBrowserTest, DeleteAllProfiles); |
| 272 FRIEND_TEST_ALL_PREFIXES(ProfileManagerBrowserTest, SwitchToProfile); | |
| 264 | 273 |
| 265 // This struct contains information about profiles which are being loaded or | 274 // This struct contains information about profiles which are being loaded or |
| 266 // were loaded. | 275 // were loaded. |
| 267 struct ProfileInfo { | 276 struct ProfileInfo { |
| 268 ProfileInfo(Profile* profile, bool created); | 277 ProfileInfo(Profile* profile, bool created); |
| 269 | 278 |
| 270 ~ProfileInfo(); | 279 ~ProfileInfo(); |
| 271 | 280 |
| 272 scoped_ptr<Profile> profile; | 281 scoped_ptr<Profile> profile; |
| 273 // Whether profile has been fully loaded (created and initialized). | 282 // 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 { | 395 class ProfileManagerWithoutInit : public ProfileManager { |
| 387 public: | 396 public: |
| 388 explicit ProfileManagerWithoutInit(const base::FilePath& user_data_dir); | 397 explicit ProfileManagerWithoutInit(const base::FilePath& user_data_dir); |
| 389 | 398 |
| 390 protected: | 399 protected: |
| 391 virtual void DoFinalInitForServices(Profile*, bool) OVERRIDE {} | 400 virtual void DoFinalInitForServices(Profile*, bool) OVERRIDE {} |
| 392 virtual void DoFinalInitLogging(Profile*) OVERRIDE {} | 401 virtual void DoFinalInitLogging(Profile*) OVERRIDE {} |
| 393 }; | 402 }; |
| 394 | 403 |
| 395 #endif // CHROME_BROWSER_PROFILES_PROFILE_MANAGER_H_ | 404 #endif // CHROME_BROWSER_PROFILES_PROFILE_MANAGER_H_ |
| OLD | NEW |