OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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_PROFILE_H_ | 7 #ifndef CHROME_BROWSER_PROFILE_H_ |
8 #define CHROME_BROWSER_PROFILE_H_ | 8 #define CHROME_BROWSER_PROFILE_H_ |
9 | 9 |
10 #include <set> | 10 #include <set> |
(...skipping 13 matching lines...) Expand all Loading... |
24 class ForceTLSState; | 24 class ForceTLSState; |
25 } | 25 } |
26 class BookmarkModel; | 26 class BookmarkModel; |
27 class ChromeURLRequestContext; | 27 class ChromeURLRequestContext; |
28 class DownloadManager; | 28 class DownloadManager; |
29 class Extension; | 29 class Extension; |
30 class ExtensionProcessManager; | 30 class ExtensionProcessManager; |
31 class ExtensionsService; | 31 class ExtensionsService; |
32 class HistoryService; | 32 class HistoryService; |
33 class NavigationController; | 33 class NavigationController; |
34 class PasswordStore; | |
35 class PrefService; | 34 class PrefService; |
36 class SessionService; | 35 class SessionService; |
37 class SpellChecker; | 36 class SpellChecker; |
38 class SSLHostState; | 37 class SSLHostState; |
39 class SQLitePersistentCookieStore; | 38 class SQLitePersistentCookieStore; |
40 class TabRestoreService; | 39 class TabRestoreService; |
41 class TemplateURLFetcher; | 40 class TemplateURLFetcher; |
42 class TemplateURLModel; | 41 class TemplateURLModel; |
43 class BrowserThemeProvider; | 42 class BrowserThemeProvider; |
44 class URLRequestContext; | 43 class URLRequestContext; |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
151 virtual HistoryService* GetHistoryService(ServiceAccessType access) = 0; | 150 virtual HistoryService* GetHistoryService(ServiceAccessType access) = 0; |
152 | 151 |
153 // Returns the WebDataService for this profile. This is owned by | 152 // Returns the WebDataService for this profile. This is owned by |
154 // the Profile. Callers that outlive the life of this profile need to be | 153 // the Profile. Callers that outlive the life of this profile need to be |
155 // sure they refcount the returned value. | 154 // sure they refcount the returned value. |
156 // | 155 // |
157 // |access| defines what the caller plans to do with the service. See | 156 // |access| defines what the caller plans to do with the service. See |
158 // the ServiceAccessType definition above. | 157 // the ServiceAccessType definition above. |
159 virtual WebDataService* GetWebDataService(ServiceAccessType access) = 0; | 158 virtual WebDataService* GetWebDataService(ServiceAccessType access) = 0; |
160 | 159 |
161 // Returns the PasswordStore for this profile. This is owned by the Profile. | |
162 virtual PasswordStore* GetPasswordStore(ServiceAccessType access) = 0; | |
163 | |
164 // Retrieves a pointer to the PrefService that manages the preferences | 160 // Retrieves a pointer to the PrefService that manages the preferences |
165 // for this user profile. The PrefService is lazily created the first | 161 // for this user profile. The PrefService is lazily created the first |
166 // time that this method is called. | 162 // time that this method is called. |
167 virtual PrefService* GetPrefs() = 0; | 163 virtual PrefService* GetPrefs() = 0; |
168 | 164 |
169 // Returns the TemplateURLModel for this profile. This is owned by the | 165 // Returns the TemplateURLModel for this profile. This is owned by the |
170 // the Profile. | 166 // the Profile. |
171 virtual TemplateURLModel* GetTemplateURLModel() = 0; | 167 virtual TemplateURLModel* GetTemplateURLModel() = 0; |
172 | 168 |
173 // Returns the TemplateURLFetcher for this profile. This is owned by the | 169 // Returns the TemplateURLFetcher for this profile. This is owned by the |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
311 virtual void DestroyOffTheRecordProfile(); | 307 virtual void DestroyOffTheRecordProfile(); |
312 virtual Profile* GetOriginalProfile(); | 308 virtual Profile* GetOriginalProfile(); |
313 virtual VisitedLinkMaster* GetVisitedLinkMaster(); | 309 virtual VisitedLinkMaster* GetVisitedLinkMaster(); |
314 virtual UserScriptMaster* GetUserScriptMaster(); | 310 virtual UserScriptMaster* GetUserScriptMaster(); |
315 virtual SSLHostState* GetSSLHostState(); | 311 virtual SSLHostState* GetSSLHostState(); |
316 virtual net::ForceTLSState* GetForceTLSState(); | 312 virtual net::ForceTLSState* GetForceTLSState(); |
317 virtual ExtensionsService* GetExtensionsService(); | 313 virtual ExtensionsService* GetExtensionsService(); |
318 virtual ExtensionProcessManager* GetExtensionProcessManager(); | 314 virtual ExtensionProcessManager* GetExtensionProcessManager(); |
319 virtual HistoryService* GetHistoryService(ServiceAccessType sat); | 315 virtual HistoryService* GetHistoryService(ServiceAccessType sat); |
320 virtual WebDataService* GetWebDataService(ServiceAccessType sat); | 316 virtual WebDataService* GetWebDataService(ServiceAccessType sat); |
321 virtual PasswordStore* GetPasswordStore(ServiceAccessType sat); | |
322 virtual PrefService* GetPrefs(); | 317 virtual PrefService* GetPrefs(); |
323 virtual TemplateURLModel* GetTemplateURLModel(); | 318 virtual TemplateURLModel* GetTemplateURLModel(); |
324 virtual TemplateURLFetcher* GetTemplateURLFetcher(); | 319 virtual TemplateURLFetcher* GetTemplateURLFetcher(); |
325 virtual DownloadManager* GetDownloadManager(); | 320 virtual DownloadManager* GetDownloadManager(); |
326 virtual void InitThemes(); | 321 virtual void InitThemes(); |
327 virtual void SetTheme(Extension* extension); | 322 virtual void SetTheme(Extension* extension); |
328 virtual void ClearTheme(); | 323 virtual void ClearTheme(); |
329 virtual ThemeProvider* GetThemeProvider(); | 324 virtual ThemeProvider* GetThemeProvider(); |
330 virtual bool HasCreatedDownloadManager() const; | 325 virtual bool HasCreatedDownloadManager() const; |
331 virtual URLRequestContext* GetRequestContext(); | 326 virtual URLRequestContext* GetRequestContext(); |
(...skipping 25 matching lines...) Expand all Loading... |
357 const NotificationDetails& details); | 352 const NotificationDetails& details); |
358 | 353 |
359 private: | 354 private: |
360 friend class Profile; | 355 friend class Profile; |
361 | 356 |
362 explicit ProfileImpl(const FilePath& path); | 357 explicit ProfileImpl(const FilePath& path); |
363 | 358 |
364 void CreateWebDataService(); | 359 void CreateWebDataService(); |
365 FilePath GetPrefFilePath(); | 360 FilePath GetPrefFilePath(); |
366 | 361 |
367 void CreatePasswordStore(); | |
368 | |
369 void StopCreateSessionServiceTimer(); | 362 void StopCreateSessionServiceTimer(); |
370 | 363 |
371 void EnsureSessionServiceCreated() { | 364 void EnsureSessionServiceCreated() { |
372 GetSessionService(); | 365 GetSessionService(); |
373 } | 366 } |
374 | 367 |
375 // Initializes the spellchecker. If the spellchecker already exsts, then | 368 // Initializes the spellchecker. If the spellchecker already exsts, then |
376 // it is released, and initialized again. This model makes sure that | 369 // it is released, and initialized again. This model makes sure that |
377 // spellchecker language can be changed without restarting the browser. | 370 // spellchecker language can be changed without restarting the browser. |
378 // NOTE: This is being currently called in the UI thread, which is OK as long | 371 // NOTE: This is being currently called in the UI thread, which is OK as long |
(...skipping 22 matching lines...) Expand all Loading... |
401 | 394 |
402 ChromeURLRequestContext* request_context_; | 395 ChromeURLRequestContext* request_context_; |
403 | 396 |
404 ChromeURLRequestContext* media_request_context_; | 397 ChromeURLRequestContext* media_request_context_; |
405 | 398 |
406 ChromeURLRequestContext* extensions_request_context_; | 399 ChromeURLRequestContext* extensions_request_context_; |
407 | 400 |
408 scoped_refptr<DownloadManager> download_manager_; | 401 scoped_refptr<DownloadManager> download_manager_; |
409 scoped_refptr<HistoryService> history_service_; | 402 scoped_refptr<HistoryService> history_service_; |
410 scoped_refptr<WebDataService> web_data_service_; | 403 scoped_refptr<WebDataService> web_data_service_; |
411 scoped_refptr<PasswordStore> password_store_; | |
412 scoped_refptr<SessionService> session_service_; | 404 scoped_refptr<SessionService> session_service_; |
413 scoped_refptr<BrowserThemeProvider> theme_provider_; | 405 scoped_refptr<BrowserThemeProvider> theme_provider_; |
414 bool history_service_created_; | 406 bool history_service_created_; |
415 bool created_web_data_service_; | 407 bool created_web_data_service_; |
416 bool created_password_store_; | |
417 bool created_download_manager_; | 408 bool created_download_manager_; |
418 bool created_theme_provider_; | 409 bool created_theme_provider_; |
419 // Whether or not the last session exited cleanly. This is set only once. | 410 // Whether or not the last session exited cleanly. This is set only once. |
420 bool last_session_exited_cleanly_; | 411 bool last_session_exited_cleanly_; |
421 | 412 |
422 base::OneShotTimer<ProfileImpl> create_session_service_timer_; | 413 base::OneShotTimer<ProfileImpl> create_session_service_timer_; |
423 | 414 |
424 scoped_ptr<OffTheRecordProfileImpl> off_the_record_profile_; | 415 scoped_ptr<OffTheRecordProfileImpl> off_the_record_profile_; |
425 | 416 |
426 // See GetStartTime for details. | 417 // See GetStartTime for details. |
(...skipping 26 matching lines...) Expand all Loading... |
453 #endif | 444 #endif |
454 | 445 |
455 // This struct is used to pass the spellchecker object through the notification | 446 // This struct is used to pass the spellchecker object through the notification |
456 // NOTIFY_SPELLCHECKER_REINITIALIZED. This is used as the details for the | 447 // NOTIFY_SPELLCHECKER_REINITIALIZED. This is used as the details for the |
457 // notification service. | 448 // notification service. |
458 struct SpellcheckerReinitializedDetails { | 449 struct SpellcheckerReinitializedDetails { |
459 scoped_refptr<SpellChecker> spellchecker; | 450 scoped_refptr<SpellChecker> spellchecker; |
460 }; | 451 }; |
461 | 452 |
462 #endif // CHROME_BROWSER_PROFILE_H_ | 453 #endif // CHROME_BROWSER_PROFILE_H_ |
OLD | NEW |