OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/test/testing_profile.h" | 5 #include "chrome/test/testing_profile.h" |
6 | 6 |
7 #include "build/build_config.h" | 7 #include "build/build_config.h" |
8 | 8 |
9 #include "base/base_paths.h" | 9 #include "base/base_paths.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
11 #include "base/file_util.h" | 11 #include "base/file_util.h" |
12 #include "base/message_loop_proxy.h" | 12 #include "base/message_loop_proxy.h" |
13 #include "base/path_service.h" | 13 #include "base/path_service.h" |
14 #include "base/string_number_conversions.h" | 14 #include "base/string_number_conversions.h" |
15 #include "chrome/browser/autocomplete/autocomplete_classifier.h" | 15 #include "chrome/browser/autocomplete/autocomplete_classifier.h" |
16 #include "chrome/browser/background_contents_service_factory.h" | 16 #include "chrome/browser/background_contents_service_factory.h" |
17 #include "chrome/browser/bookmarks/bookmark_model.h" | 17 #include "chrome/browser/bookmarks/bookmark_model.h" |
| 18 #include "chrome/browser/browser_process.h" |
18 #include "chrome/browser/content_settings/host_content_settings_map.h" | 19 #include "chrome/browser/content_settings/host_content_settings_map.h" |
19 #include "chrome/browser/custom_handlers/protocol_handler_registry.h" | 20 #include "chrome/browser/custom_handlers/protocol_handler_registry.h" |
20 #include "chrome/browser/extensions/extension_pref_value_map.h" | 21 #include "chrome/browser/extensions/extension_pref_value_map.h" |
21 #include "chrome/browser/extensions/extension_service.h" | 22 #include "chrome/browser/extensions/extension_service.h" |
22 #include "chrome/browser/extensions/extension_special_storage_policy.h" | 23 #include "chrome/browser/extensions/extension_special_storage_policy.h" |
23 #include "chrome/browser/favicon/favicon_service.h" | 24 #include "chrome/browser/favicon/favicon_service.h" |
24 #include "chrome/browser/geolocation/geolocation_content_settings_map.h" | 25 #include "chrome/browser/geolocation/geolocation_content_settings_map.h" |
25 #include "chrome/browser/history/history.h" | 26 #include "chrome/browser/history/history.h" |
26 #include "chrome/browser/history/history_backend.h" | 27 #include "chrome/browser/history/history_backend.h" |
27 #include "chrome/browser/history/top_sites.h" | 28 #include "chrome/browser/history/top_sites.h" |
(...skipping 717 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
745 | 746 |
746 ChromeURLDataManager* TestingProfile::GetChromeURLDataManager() { | 747 ChromeURLDataManager* TestingProfile::GetChromeURLDataManager() { |
747 if (!chrome_url_data_manager_.get()) | 748 if (!chrome_url_data_manager_.get()) |
748 chrome_url_data_manager_.reset(new ChromeURLDataManager(this)); | 749 chrome_url_data_manager_.reset(new ChromeURLDataManager(this)); |
749 return chrome_url_data_manager_.get(); | 750 return chrome_url_data_manager_.get(); |
750 } | 751 } |
751 | 752 |
752 prerender::PrerenderManager* TestingProfile::GetPrerenderManager() { | 753 prerender::PrerenderManager* TestingProfile::GetPrerenderManager() { |
753 if (!prerender::PrerenderManager::IsPrerenderingPossible()) | 754 if (!prerender::PrerenderManager::IsPrerenderingPossible()) |
754 return NULL; | 755 return NULL; |
755 if (!prerender_manager_.get()) | 756 if (!prerender_manager_.get()) { |
756 prerender_manager_.reset(new prerender::PrerenderManager(this)); | 757 prerender_manager_.reset(new prerender::PrerenderManager( |
| 758 this, g_browser_process->prerender_tracker())); |
| 759 } |
757 return prerender_manager_.get(); | 760 return prerender_manager_.get(); |
758 } | 761 } |
759 | 762 |
760 PrefService* TestingProfile::GetOffTheRecordPrefs() { | 763 PrefService* TestingProfile::GetOffTheRecordPrefs() { |
761 return NULL; | 764 return NULL; |
762 } | 765 } |
763 | 766 |
764 quota::SpecialStoragePolicy* TestingProfile::GetSpecialStoragePolicy() { | 767 quota::SpecialStoragePolicy* TestingProfile::GetSpecialStoragePolicy() { |
765 return GetExtensionSpecialStoragePolicy(); | 768 return GetExtensionSpecialStoragePolicy(); |
766 } | 769 } |
767 | 770 |
768 void TestingProfile::DestroyWebDataService() { | 771 void TestingProfile::DestroyWebDataService() { |
769 if (!web_data_service_.get()) | 772 if (!web_data_service_.get()) |
770 return; | 773 return; |
771 | 774 |
772 web_data_service_->Shutdown(); | 775 web_data_service_->Shutdown(); |
773 } | 776 } |
774 | 777 |
775 DerivedTestingProfile::DerivedTestingProfile(Profile* profile) | 778 DerivedTestingProfile::DerivedTestingProfile(Profile* profile) |
776 : original_profile_(profile) {} | 779 : original_profile_(profile) {} |
777 | 780 |
778 DerivedTestingProfile::~DerivedTestingProfile() {} | 781 DerivedTestingProfile::~DerivedTestingProfile() {} |
779 | 782 |
780 ProfileId DerivedTestingProfile::GetRuntimeId() { | 783 ProfileId DerivedTestingProfile::GetRuntimeId() { |
781 return original_profile_->GetRuntimeId(); | 784 return original_profile_->GetRuntimeId(); |
782 } | 785 } |
OLD | NEW |