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 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
183 bool start_deferred_task_runners); | 183 bool start_deferred_task_runners); |
184 | 184 |
185 const base::FilePath& user_data_dir() const { return user_data_dir_; } | 185 const base::FilePath& user_data_dir() const { return user_data_dir_; } |
186 | 186 |
187 // For ChromeOS, determines if the user has logged in to a real profile. | 187 // For ChromeOS, determines if the user has logged in to a real profile. |
188 bool IsLoggedIn() const { return logged_in_; } | 188 bool IsLoggedIn() const { return logged_in_; } |
189 | 189 |
190 // content::NotificationObserver implementation. | 190 // content::NotificationObserver implementation. |
191 virtual void Observe(int type, | 191 virtual void Observe(int type, |
192 const content::NotificationSource& source, | 192 const content::NotificationSource& source, |
193 const content::NotificationDetails& details) OVERRIDE; | 193 const content::NotificationDetails& details) override; |
194 | 194 |
195 // Profile::Delegate implementation: | 195 // Profile::Delegate implementation: |
196 virtual void OnProfileCreated(Profile* profile, | 196 virtual void OnProfileCreated(Profile* profile, |
197 bool success, | 197 bool success, |
198 bool is_new_profile) OVERRIDE; | 198 bool is_new_profile) override; |
199 | 199 |
200 protected: | 200 protected: |
201 // Does final initial actions. | 201 // Does final initial actions. |
202 virtual void DoFinalInit(Profile* profile, bool go_off_the_record); | 202 virtual void DoFinalInit(Profile* profile, bool go_off_the_record); |
203 virtual void DoFinalInitForServices(Profile* profile, bool go_off_the_record); | 203 virtual void DoFinalInitForServices(Profile* profile, bool go_off_the_record); |
204 virtual void DoFinalInitLogging(Profile* profile); | 204 virtual void DoFinalInitLogging(Profile* profile); |
205 | 205 |
206 // Creates a new profile by calling into the profile's profile creation | 206 // Creates a new profile by calling into the profile's profile creation |
207 // method. Virtual so that unittests can return a TestingProfile instead | 207 // method. Virtual so that unittests can return a TestingProfile instead |
208 // of the Profile's result. | 208 // of the Profile's result. |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
283 // restored after crash there's another preference that is taken into account. | 283 // restored after crash there's another preference that is taken into account. |
284 // See kLastActiveUser in UserManagerBase. | 284 // See kLastActiveUser in UserManagerBase. |
285 void UpdateLastUser(Profile* last_active); | 285 void UpdateLastUser(Profile* last_active); |
286 | 286 |
287 class BrowserListObserver : public chrome::BrowserListObserver { | 287 class BrowserListObserver : public chrome::BrowserListObserver { |
288 public: | 288 public: |
289 explicit BrowserListObserver(ProfileManager* manager); | 289 explicit BrowserListObserver(ProfileManager* manager); |
290 virtual ~BrowserListObserver(); | 290 virtual ~BrowserListObserver(); |
291 | 291 |
292 // chrome::BrowserListObserver implementation. | 292 // chrome::BrowserListObserver implementation. |
293 virtual void OnBrowserAdded(Browser* browser) OVERRIDE; | 293 virtual void OnBrowserAdded(Browser* browser) override; |
294 virtual void OnBrowserRemoved(Browser* browser) OVERRIDE; | 294 virtual void OnBrowserRemoved(Browser* browser) override; |
295 virtual void OnBrowserSetLastActive(Browser* browser) OVERRIDE; | 295 virtual void OnBrowserSetLastActive(Browser* browser) override; |
296 | 296 |
297 private: | 297 private: |
298 ProfileManager* profile_manager_; | 298 ProfileManager* profile_manager_; |
299 DISALLOW_COPY_AND_ASSIGN(BrowserListObserver); | 299 DISALLOW_COPY_AND_ASSIGN(BrowserListObserver); |
300 }; | 300 }; |
301 #endif // !defined(OS_ANDROID) && !defined(OS_IOS) | 301 #endif // !defined(OS_ANDROID) && !defined(OS_IOS) |
302 | 302 |
303 #if defined(OS_MACOSX) | 303 #if defined(OS_MACOSX) |
304 // If the |loaded_profile| has been loaded successfully (according to | 304 // If the |loaded_profile| has been loaded successfully (according to |
305 // |status|) and isn't already scheduled for deletion, then finishes adding | 305 // |status|) and isn't already scheduled for deletion, then finishes adding |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
352 DISALLOW_COPY_AND_ASSIGN(ProfileManager); | 352 DISALLOW_COPY_AND_ASSIGN(ProfileManager); |
353 }; | 353 }; |
354 | 354 |
355 // Same as the ProfileManager, but doesn't initialize some services of the | 355 // Same as the ProfileManager, but doesn't initialize some services of the |
356 // profile. This one is useful in unittests. | 356 // profile. This one is useful in unittests. |
357 class ProfileManagerWithoutInit : public ProfileManager { | 357 class ProfileManagerWithoutInit : public ProfileManager { |
358 public: | 358 public: |
359 explicit ProfileManagerWithoutInit(const base::FilePath& user_data_dir); | 359 explicit ProfileManagerWithoutInit(const base::FilePath& user_data_dir); |
360 | 360 |
361 protected: | 361 protected: |
362 virtual void DoFinalInitForServices(Profile*, bool) OVERRIDE {} | 362 virtual void DoFinalInitForServices(Profile*, bool) override {} |
363 virtual void DoFinalInitLogging(Profile*) OVERRIDE {} | 363 virtual void DoFinalInitLogging(Profile*) override {} |
364 }; | 364 }; |
365 | 365 |
366 #endif // CHROME_BROWSER_PROFILES_PROFILE_MANAGER_H_ | 366 #endif // CHROME_BROWSER_PROFILES_PROFILE_MANAGER_H_ |
OLD | NEW |