| 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 gathers state related to a single user profile. | 5 // This class gathers state related to a single user profile. |
| 6 | 6 |
| 7 #ifndef CHROME_BROWSER_PROFILES_PROFILE_H_ | 7 #ifndef CHROME_BROWSER_PROFILES_PROFILE_H_ |
| 8 #define CHROME_BROWSER_PROFILES_PROFILE_H_ | 8 #define CHROME_BROWSER_PROFILES_PROFILE_H_ |
| 9 | 9 |
| 10 #include <string> | 10 #include <string> |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 | 122 |
| 123 Profile(); | 123 Profile(); |
| 124 ~Profile() override; | 124 ~Profile() override; |
| 125 | 125 |
| 126 // Profile prefs are registered as soon as the prefs are loaded for the first | 126 // Profile prefs are registered as soon as the prefs are loaded for the first |
| 127 // time. | 127 // time. |
| 128 static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry); | 128 static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry); |
| 129 | 129 |
| 130 // Create a new profile given a path. If |create_mode| is | 130 // Create a new profile given a path. If |create_mode| is |
| 131 // CREATE_MODE_ASYNCHRONOUS then the profile is initialized asynchronously. | 131 // CREATE_MODE_ASYNCHRONOUS then the profile is initialized asynchronously. |
| 132 // Can return null if |create_mode| is CREATE_MODE_SYNCHRONOUS and the |
| 133 // creation of the profile directory fails. |
| 132 static Profile* CreateProfile(const base::FilePath& path, | 134 static Profile* CreateProfile(const base::FilePath& path, |
| 133 Delegate* delegate, | 135 Delegate* delegate, |
| 134 CreateMode create_mode); | 136 CreateMode create_mode); |
| 135 | 137 |
| 136 // Returns the profile corresponding to the given browser context. | 138 // Returns the profile corresponding to the given browser context. |
| 137 static Profile* FromBrowserContext(content::BrowserContext* browser_context); | 139 static Profile* FromBrowserContext(content::BrowserContext* browser_context); |
| 138 | 140 |
| 139 // Returns the profile corresponding to the given WebUI. | 141 // Returns the profile corresponding to the given WebUI. |
| 140 static Profile* FromWebUI(content::WebUI* web_ui); | 142 static Profile* FromWebUI(content::WebUI* web_ui); |
| 141 | 143 |
| (...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 373 | 375 |
| 374 DISALLOW_COPY_AND_ASSIGN(Profile); | 376 DISALLOW_COPY_AND_ASSIGN(Profile); |
| 375 }; | 377 }; |
| 376 | 378 |
| 377 // The comparator for profile pointers as key in a map. | 379 // The comparator for profile pointers as key in a map. |
| 378 struct ProfileCompare { | 380 struct ProfileCompare { |
| 379 bool operator()(Profile* a, Profile* b) const; | 381 bool operator()(Profile* a, Profile* b) const; |
| 380 }; | 382 }; |
| 381 | 383 |
| 382 #endif // CHROME_BROWSER_PROFILES_PROFILE_H_ | 384 #endif // CHROME_BROWSER_PROFILES_PROFILE_H_ |
| OLD | NEW |