| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #include "chrome/browser/profile.h" | 5 #include "chrome/browser/profile.h" |
| 6 | 6 |
| 7 #include "app/resource_bundle.h" | 7 #include "app/resource_bundle.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/file_path.h" | 9 #include "base/file_path.h" |
| 10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
| 11 #include "base/path_service.h" | 11 #include "base/path_service.h" |
| 12 #include "base/scoped_ptr.h" | 12 #include "base/scoped_ptr.h" |
| 13 #include "base/string_util.h" | 13 #include "base/string_util.h" |
| 14 #include "chrome/browser/background_contents_service.h" | 14 #include "chrome/browser/background_contents_service.h" |
| 15 #include "chrome/browser/browser_list.h" | 15 #include "chrome/browser/browser_list.h" |
| 16 #include "chrome/browser/browser_process.h" | 16 #include "chrome/browser/browser_process.h" |
| 17 #include "chrome/browser/chrome_blob_storage_context.h" | 17 #include "chrome/browser/chrome_blob_storage_context.h" |
| 18 #include "chrome/browser/chrome_thread.h" | 18 #include "chrome/browser/chrome_thread.h" |
| 19 #include "chrome/browser/download/download_manager.h" | 19 #include "chrome/browser/download/download_manager.h" |
| 20 #include "chrome/browser/file_system/file_system_host_context.h" | |
| 21 #include "chrome/browser/find_bar_state.h" | 20 #include "chrome/browser/find_bar_state.h" |
| 22 #include "chrome/browser/in_process_webkit/webkit_context.h" | 21 #include "chrome/browser/in_process_webkit/webkit_context.h" |
| 23 #include "chrome/browser/net/chrome_url_request_context.h" | 22 #include "chrome/browser/net/chrome_url_request_context.h" |
| 24 #include "chrome/browser/notifications/desktop_notification_service.h" | 23 #include "chrome/browser/notifications/desktop_notification_service.h" |
| 25 #include "chrome/browser/ssl/ssl_host_state.h" | 24 #include "chrome/browser/ssl/ssl_host_state.h" |
| 26 #include "chrome/browser/sync/profile_sync_service.h" | 25 #include "chrome/browser/sync/profile_sync_service.h" |
| 27 #include "chrome/browser/themes/browser_theme_provider.h" | 26 #include "chrome/browser/themes/browser_theme_provider.h" |
| 28 #include "chrome/common/chrome_constants.h" | 27 #include "chrome/common/chrome_constants.h" |
| 29 #include "chrome/common/chrome_paths.h" | 28 #include "chrome/common/chrome_paths.h" |
| 30 #include "chrome/common/chrome_switches.h" | 29 #include "chrome/common/chrome_switches.h" |
| (...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 308 } | 307 } |
| 309 | 308 |
| 310 virtual bool HasCreatedDownloadManager() const { | 309 virtual bool HasCreatedDownloadManager() const { |
| 311 return (download_manager_.get() != NULL); | 310 return (download_manager_.get() != NULL); |
| 312 } | 311 } |
| 313 | 312 |
| 314 virtual PersonalDataManager* GetPersonalDataManager() { | 313 virtual PersonalDataManager* GetPersonalDataManager() { |
| 315 return NULL; | 314 return NULL; |
| 316 } | 315 } |
| 317 | 316 |
| 318 virtual FileSystemHostContext* GetFileSystemHostContext() { | |
| 319 if (!file_system_host_context_) | |
| 320 file_system_host_context_ = new FileSystemHostContext( | |
| 321 GetPath(), IsOffTheRecord()); | |
| 322 DCHECK(file_system_host_context_.get()); | |
| 323 return file_system_host_context_.get(); | |
| 324 } | |
| 325 | |
| 326 virtual void InitThemes() { | 317 virtual void InitThemes() { |
| 327 profile_->InitThemes(); | 318 profile_->InitThemes(); |
| 328 } | 319 } |
| 329 | 320 |
| 330 virtual void SetTheme(Extension* extension) { | 321 virtual void SetTheme(Extension* extension) { |
| 331 profile_->SetTheme(extension); | 322 profile_->SetTheme(extension); |
| 332 } | 323 } |
| 333 | 324 |
| 334 virtual void SetNativeTheme() { | 325 virtual void SetNativeTheme() { |
| 335 profile_->SetNativeTheme(); | 326 profile_->SetNativeTheme(); |
| (...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 583 // Should be used only on the file thread. | 574 // Should be used only on the file thread. |
| 584 scoped_refptr<webkit_database::DatabaseTracker> db_tracker_; | 575 scoped_refptr<webkit_database::DatabaseTracker> db_tracker_; |
| 585 | 576 |
| 586 FilePath last_selected_directory_; | 577 FilePath last_selected_directory_; |
| 587 | 578 |
| 588 // Tracks all BackgroundContents running under this profile. | 579 // Tracks all BackgroundContents running under this profile. |
| 589 scoped_ptr<BackgroundContentsService> background_contents_service_; | 580 scoped_ptr<BackgroundContentsService> background_contents_service_; |
| 590 | 581 |
| 591 scoped_refptr<ChromeBlobStorageContext> blob_storage_context_; | 582 scoped_refptr<ChromeBlobStorageContext> blob_storage_context_; |
| 592 | 583 |
| 593 // The file_system context for this profile. | |
| 594 scoped_refptr<FileSystemHostContext> file_system_host_context_; | |
| 595 | |
| 596 DISALLOW_COPY_AND_ASSIGN(OffTheRecordProfileImpl); | 584 DISALLOW_COPY_AND_ASSIGN(OffTheRecordProfileImpl); |
| 597 }; | 585 }; |
| 598 | 586 |
| 599 Profile *Profile::CreateOffTheRecordProfile() { | 587 Profile *Profile::CreateOffTheRecordProfile() { |
| 600 return new OffTheRecordProfileImpl(this); | 588 return new OffTheRecordProfileImpl(this); |
| 601 } | 589 } |
| OLD | NEW |