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_IMPL_H_ | 7 #ifndef CHROME_BROWSER_PROFILES_PROFILE_IMPL_H_ |
8 #define CHROME_BROWSER_PROFILES_PROFILE_IMPL_H_ | 8 #define CHROME_BROWSER_PROFILES_PROFILE_IMPL_H_ |
9 | 9 |
10 #include <string> | 10 #include <string> |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 const base::Closure& completion) override; | 130 const base::Closure& completion) override; |
131 GURL GetHomePage() override; | 131 GURL GetHomePage() override; |
132 bool WasCreatedByVersionOrLater(const std::string& version) override; | 132 bool WasCreatedByVersionOrLater(const std::string& version) override; |
133 void SetExitType(ExitType exit_type) override; | 133 void SetExitType(ExitType exit_type) override; |
134 ExitType GetLastSessionExitType() override; | 134 ExitType GetLastSessionExitType() override; |
135 | 135 |
136 #if defined(OS_CHROMEOS) | 136 #if defined(OS_CHROMEOS) |
137 void ChangeAppLocale(const std::string& locale, AppLocaleChangedVia) override; | 137 void ChangeAppLocale(const std::string& locale, AppLocaleChangedVia) override; |
138 void OnLogin() override; | 138 void OnLogin() override; |
139 void InitChromeOSPreferences() override; | 139 void InitChromeOSPreferences() override; |
| 140 void SetOnPrefsLoadedHook( |
| 141 const base::Callback<void(Profile*, const base::Closure&)>& callback) |
| 142 override; |
140 #endif // defined(OS_CHROMEOS) | 143 #endif // defined(OS_CHROMEOS) |
141 | 144 |
142 PrefProxyConfigTracker* GetProxyConfigTracker() override; | 145 PrefProxyConfigTracker* GetProxyConfigTracker() override; |
143 | 146 |
144 private: | 147 private: |
145 #if defined(OS_CHROMEOS) | 148 #if defined(OS_CHROMEOS) |
146 friend class chromeos::KioskTest; | 149 friend class chromeos::KioskTest; |
147 friend class chromeos::SupervisedUserTestBase; | 150 friend class chromeos::SupervisedUserTestBase; |
148 #endif | 151 #endif |
149 friend class Profile; | 152 friend class Profile; |
150 FRIEND_TEST_ALL_PREFIXES(StartupBrowserCreatorTest, | 153 FRIEND_TEST_ALL_PREFIXES(StartupBrowserCreatorTest, |
151 ProfilesLaunchedAfterCrash); | 154 ProfilesLaunchedAfterCrash); |
152 FRIEND_TEST_ALL_PREFIXES(ProfileBrowserTest, DISABLED_ProfileReadmeCreated); | 155 FRIEND_TEST_ALL_PREFIXES(ProfileBrowserTest, DISABLED_ProfileReadmeCreated); |
153 FRIEND_TEST_ALL_PREFIXES(ProfileBrowserTest, | 156 FRIEND_TEST_ALL_PREFIXES(ProfileBrowserTest, |
154 ProfileDeletedBeforeReadmeCreated); | 157 ProfileDeletedBeforeReadmeCreated); |
155 | 158 |
156 // Delay, in milliseconds, before README file is created for a new profile. | 159 // Delay, in milliseconds, before README file is created for a new profile. |
157 // This is non-const for testing purposes. | 160 // This is non-const for testing purposes. |
158 static int create_readme_delay_ms; | 161 static int create_readme_delay_ms; |
159 | 162 |
160 ProfileImpl(const base::FilePath& path, | 163 ProfileImpl(const base::FilePath& path, |
161 Delegate* delegate, | 164 Delegate* delegate, |
162 CreateMode create_mode, | 165 CreateMode create_mode, |
163 base::SequencedTaskRunner* sequenced_task_runner); | 166 base::SequencedTaskRunner* sequenced_task_runner); |
164 | 167 |
165 // Does final initialization. Should be called after prefs were loaded. | 168 // Does final initialization. Should be called after prefs were loaded. |
166 void DoFinalInit(); | 169 void DoFinalInit(); |
167 | 170 |
| 171 // Check |success|, |on_prefs_loaded_hook_| and proceed to OnPrefsLoadedImpl. |
| 172 void OnPrefsLoaded(bool success); |
| 173 |
168 // Does final prefs initialization and calls Init(). | 174 // Does final prefs initialization and calls Init(). |
169 void OnPrefsLoaded(bool success); | 175 void OnPrefsLoadedImpl(); |
170 | 176 |
171 #if defined(ENABLE_SESSION_SERVICE) | 177 #if defined(ENABLE_SESSION_SERVICE) |
172 void StopCreateSessionServiceTimer(); | 178 void StopCreateSessionServiceTimer(); |
173 | 179 |
174 void EnsureSessionServiceCreated(); | 180 void EnsureSessionServiceCreated(); |
175 #endif | 181 #endif |
176 | 182 |
177 | 183 |
178 void EnsureRequestContextCreated() { | 184 void EnsureRequestContextCreated() { |
179 GetRequestContext(); | 185 GetRequestContext(); |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
252 #if defined(OS_CHROMEOS) | 258 #if defined(OS_CHROMEOS) |
253 scoped_ptr<chromeos::Preferences> chromeos_preferences_; | 259 scoped_ptr<chromeos::Preferences> chromeos_preferences_; |
254 | 260 |
255 scoped_ptr<chromeos::LocaleChangeGuard> locale_change_guard_; | 261 scoped_ptr<chromeos::LocaleChangeGuard> locale_change_guard_; |
256 | 262 |
257 bool is_login_profile_; | 263 bool is_login_profile_; |
258 #endif | 264 #endif |
259 | 265 |
260 scoped_ptr<PrefProxyConfigTracker> pref_proxy_config_tracker_; | 266 scoped_ptr<PrefProxyConfigTracker> pref_proxy_config_tracker_; |
261 | 267 |
| 268 Profile::Delegate* delegate_; |
| 269 |
| 270 chrome_browser_net::Predictor* predictor_; |
| 271 |
| 272 #if defined(OS_CHROMEOS) |
| 273 // Hook to interrupt profile initialization flow (see |
| 274 // Profile::SetOnPrefsLoadedHook). |
| 275 base::Callback<void(Profile*, const base::Closure&)> on_prefs_loaded_hook_; |
| 276 #endif |
| 277 |
262 // STOP!!!! DO NOT ADD ANY MORE ITEMS HERE!!!! | 278 // STOP!!!! DO NOT ADD ANY MORE ITEMS HERE!!!! |
263 // | 279 // |
264 // Instead, make your Service/Manager/whatever object you're hanging off the | 280 // Instead, make your Service/Manager/whatever object you're hanging off the |
265 // Profile use our new BrowserContextKeyedServiceFactory system instead. | 281 // Profile use our new BrowserContextKeyedServiceFactory system instead. |
266 // You can find the design document here: | 282 // You can find the design document here: |
267 // | 283 // |
268 // https://sites.google.com/a/chromium.org/dev/developers/design-documents/p
rofile-architecture | 284 // https://sites.google.com/a/chromium.org/dev/developers/design-documents/p
rofile-architecture |
269 // | 285 // |
270 // and you can read the raw headers here: | 286 // and you can read the raw headers here: |
271 // | 287 // |
272 // components/keyed_service/content/browser_context_dependency_manager.* | 288 // components/keyed_service/content/browser_context_dependency_manager.* |
273 // components/keyed_service/core/keyed_service.h | 289 // components/keyed_service/core/keyed_service.h |
274 // components/keyed_service/content/browser_context_keyed_service_factory.* | 290 // components/keyed_service/content/browser_context_keyed_service_factory.* |
275 | 291 |
276 Profile::Delegate* delegate_; | |
277 | |
278 chrome_browser_net::Predictor* predictor_; | |
279 | |
280 DISALLOW_COPY_AND_ASSIGN(ProfileImpl); | 292 DISALLOW_COPY_AND_ASSIGN(ProfileImpl); |
281 }; | 293 }; |
282 | 294 |
283 #endif // CHROME_BROWSER_PROFILES_PROFILE_IMPL_H_ | 295 #endif // CHROME_BROWSER_PROFILES_PROFILE_IMPL_H_ |
OLD | NEW |