| 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 identified by |path|. |
| 182 // If |always_create| is true then a new window is created even if a window |
| 183 // 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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 255 | 263 |
| 256 // Creates a new profile asynchronously by calling into the profile's | 264 // Creates a new profile asynchronously by calling into the profile's |
| 257 // asynchronous profile creation method. Virtual so that unittests can return | 265 // asynchronous profile creation method. Virtual so that unittests can return |
| 258 // a TestingProfile instead of the Profile's result. | 266 // a TestingProfile instead of the Profile's result. |
| 259 virtual Profile* CreateProfileAsyncHelper(const base::FilePath& path, | 267 virtual Profile* CreateProfileAsyncHelper(const base::FilePath& path, |
| 260 Delegate* delegate); | 268 Delegate* delegate); |
| 261 | 269 |
| 262 private: | 270 private: |
| 263 friend class TestingProfileManager; | 271 friend class TestingProfileManager; |
| 264 FRIEND_TEST_ALL_PREFIXES(ProfileManagerBrowserTest, DeleteAllProfiles); | 272 FRIEND_TEST_ALL_PREFIXES(ProfileManagerBrowserTest, DeleteAllProfiles); |
| 273 FRIEND_TEST_ALL_PREFIXES(ProfileManagerBrowserTest, SwitchToProfile); |
| 265 | 274 |
| 266 // This struct contains information about profiles which are being loaded or | 275 // This struct contains information about profiles which are being loaded or |
| 267 // were loaded. | 276 // were loaded. |
| 268 struct ProfileInfo { | 277 struct ProfileInfo { |
| 269 ProfileInfo(Profile* profile, bool created); | 278 ProfileInfo(Profile* profile, bool created); |
| 270 | 279 |
| 271 ~ProfileInfo(); | 280 ~ProfileInfo(); |
| 272 | 281 |
| 273 scoped_ptr<Profile> profile; | 282 scoped_ptr<Profile> profile; |
| 274 // Whether profile has been fully loaded (created and initialized). | 283 // Whether profile has been fully loaded (created and initialized). |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 401 class ProfileManagerWithoutInit : public ProfileManager { | 410 class ProfileManagerWithoutInit : public ProfileManager { |
| 402 public: | 411 public: |
| 403 explicit ProfileManagerWithoutInit(const base::FilePath& user_data_dir); | 412 explicit ProfileManagerWithoutInit(const base::FilePath& user_data_dir); |
| 404 | 413 |
| 405 protected: | 414 protected: |
| 406 virtual void DoFinalInitForServices(Profile*, bool) OVERRIDE {} | 415 virtual void DoFinalInitForServices(Profile*, bool) OVERRIDE {} |
| 407 virtual void DoFinalInitLogging(Profile*) OVERRIDE {} | 416 virtual void DoFinalInitLogging(Profile*) OVERRIDE {} |
| 408 }; | 417 }; |
| 409 | 418 |
| 410 #endif // CHROME_BROWSER_PROFILES_PROFILE_MANAGER_H_ | 419 #endif // CHROME_BROWSER_PROFILES_PROFILE_MANAGER_H_ |
| OLD | NEW |