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