| 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 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 // Same as instance method but provides the default user_data_dir as well. | 111 // Same as instance method but provides the default user_data_dir as well. |
| 112 static Profile* GetLastUsedProfile(); | 112 static Profile* GetLastUsedProfile(); |
| 113 | 113 |
| 114 // Returns created profiles. Note, profiles order is NOT guaranteed to be | 114 // Returns created profiles. Note, profiles order is NOT guaranteed to be |
| 115 // related with the creation order. | 115 // related with the creation order. |
| 116 std::vector<Profile*> GetLoadedProfiles() const; | 116 std::vector<Profile*> GetLoadedProfiles() const; |
| 117 | 117 |
| 118 // content::NotificationObserver implementation. | 118 // content::NotificationObserver implementation. |
| 119 virtual void Observe(int type, | 119 virtual void Observe(int type, |
| 120 const content::NotificationSource& source, | 120 const content::NotificationSource& source, |
| 121 const content::NotificationDetails& details); | 121 const content::NotificationDetails& details) OVERRIDE; |
| 122 | 122 |
| 123 // BrowserList::Observer implementation. | 123 // BrowserList::Observer implementation. |
| 124 virtual void OnBrowserAdded(const Browser* browser); | 124 virtual void OnBrowserAdded(const Browser* browser) OVERRIDE; |
| 125 virtual void OnBrowserRemoved(const Browser* browser); | 125 virtual void OnBrowserRemoved(const Browser* browser) OVERRIDE; |
| 126 virtual void OnBrowserSetLastActive(const Browser* browser); | 126 virtual void OnBrowserSetLastActive(const Browser* browser) OVERRIDE; |
| 127 | 127 |
| 128 // Indicate that an import process will run for the next created Profile. | 128 // Indicate that an import process will run for the next created Profile. |
| 129 void SetWillImport(); | 129 void SetWillImport(); |
| 130 bool will_import() { return will_import_; } | 130 bool will_import() { return will_import_; } |
| 131 | 131 |
| 132 // Indicate that the import process for |profile| has completed. | 132 // Indicate that the import process for |profile| has completed. |
| 133 void OnImportFinished(Profile* profile); | 133 void OnImportFinished(Profile* profile); |
| 134 | 134 |
| 135 // ------------------ static utility functions ------------------- | 135 // ------------------ static utility functions ------------------- |
| 136 | 136 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 149 // Opens a new window with the given profile. This launches a new browser for | 149 // Opens a new window with the given profile. This launches a new browser for |
| 150 // the profile or activates an existing one; it is the static equivalent of | 150 // the profile or activates an existing one; it is the static equivalent of |
| 151 // the instance method Browser::NewWindow(), used for the creation of a | 151 // the instance method Browser::NewWindow(), used for the creation of a |
| 152 // Window from the multi-profile dropdown menu. | 152 // Window from the multi-profile dropdown menu. |
| 153 static void NewWindowWithProfile( | 153 static void NewWindowWithProfile( |
| 154 Profile* profile, | 154 Profile* profile, |
| 155 BrowserInit::IsProcessStartup process_startup, | 155 BrowserInit::IsProcessStartup process_startup, |
| 156 BrowserInit::IsFirstRun is_first_run); | 156 BrowserInit::IsFirstRun is_first_run); |
| 157 | 157 |
| 158 // Profile::Delegate implementation: | 158 // Profile::Delegate implementation: |
| 159 virtual void OnProfileCreated(Profile* profile, bool success); | 159 virtual void OnProfileCreated(Profile* profile, bool success) OVERRIDE; |
| 160 | 160 |
| 161 // Add or remove a profile launcher to/from the list of launchers waiting for | 161 // Add or remove a profile launcher to/from the list of launchers waiting for |
| 162 // new profiles to be created from the multi-profile menu. | 162 // new profiles to be created from the multi-profile menu. |
| 163 void AddProfileLauncher(NewProfileLauncher* profile_launcher); | 163 void AddProfileLauncher(NewProfileLauncher* profile_launcher); |
| 164 void RemoveProfileLauncher(NewProfileLauncher* profile_launcher); | 164 void RemoveProfileLauncher(NewProfileLauncher* profile_launcher); |
| 165 | 165 |
| 166 // Creates a new profile in the next available multiprofile directory. | 166 // Creates a new profile in the next available multiprofile directory. |
| 167 // Directories are named "profile_1", "profile_2", etc., in sequence of | 167 // Directories are named "profile_1", "profile_2", etc., in sequence of |
| 168 // creation. (Because directories can be removed, however, it may be the case | 168 // creation. (Because directories can be removed, however, it may be the case |
| 169 // that at some point the list of numbered profiles is not continuous.) | 169 // that at some point the list of numbered profiles is not continuous.) |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 285 class ProfileManagerWithoutInit : public ProfileManager { | 285 class ProfileManagerWithoutInit : public ProfileManager { |
| 286 public: | 286 public: |
| 287 explicit ProfileManagerWithoutInit(const FilePath& user_data_dir); | 287 explicit ProfileManagerWithoutInit(const FilePath& user_data_dir); |
| 288 | 288 |
| 289 protected: | 289 protected: |
| 290 virtual void DoFinalInitForServices(Profile*, bool) OVERRIDE {} | 290 virtual void DoFinalInitForServices(Profile*, bool) OVERRIDE {} |
| 291 virtual void DoFinalInitLogging(Profile*) OVERRIDE {} | 291 virtual void DoFinalInitLogging(Profile*) OVERRIDE {} |
| 292 }; | 292 }; |
| 293 | 293 |
| 294 #endif // CHROME_BROWSER_PROFILES_PROFILE_MANAGER_H_ | 294 #endif // CHROME_BROWSER_PROFILES_PROFILE_MANAGER_H_ |
| OLD | NEW |