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 #include "chrome/test/base/testing_profile.h" | 5 #include "chrome/test/base/testing_profile.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
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/files/file_util.h" | 11 #include "base/files/file_util.h" |
12 #include "base/location.h" | 12 #include "base/location.h" |
13 #include "base/macros.h" | 13 #include "base/macros.h" |
14 #include "base/memory/ptr_util.h" | 14 #include "base/memory/ptr_util.h" |
15 #include "base/path_service.h" | 15 #include "base/path_service.h" |
16 #include "base/run_loop.h" | 16 #include "base/run_loop.h" |
17 #include "base/single_thread_task_runner.h" | 17 #include "base/single_thread_task_runner.h" |
18 #include "base/strings/string_number_conversions.h" | 18 #include "base/strings/string_number_conversions.h" |
19 #include "base/threading/thread_restrictions.h" | 19 #include "base/threading/thread_restrictions.h" |
20 #include "base/threading/thread_task_runner_handle.h" | 20 #include "base/threading/thread_task_runner_handle.h" |
21 #include "build/build_config.h" | 21 #include "build/build_config.h" |
22 #include "chrome/browser/autocomplete/in_memory_url_index_factory.h" | 22 #include "chrome/browser/autocomplete/in_memory_url_index_factory.h" |
23 #include "chrome/browser/bookmarks/bookmark_model_factory.h" | 23 #include "chrome/browser/bookmarks/bookmark_model_factory.h" |
24 #include "chrome/browser/bookmarks/chrome_bookmark_client.h" | 24 #include "chrome/browser/bookmarks/chrome_bookmark_client.h" |
25 #include "chrome/browser/bookmarks/managed_bookmark_service_factory.h" | 25 #include "chrome/browser/bookmarks/managed_bookmark_service_factory.h" |
26 #include "chrome/browser/browser_process.h" | 26 #include "chrome/browser/browser_process.h" |
| 27 #include "chrome/browser/browsing_data/chrome_browsing_data_remover_delegate.h" |
| 28 #include "chrome/browser/browsing_data/chrome_browsing_data_remover_delegate_fac
tory.h" |
27 #include "chrome/browser/chrome_notification_types.h" | 29 #include "chrome/browser/chrome_notification_types.h" |
28 #include "chrome/browser/content_settings/host_content_settings_map_factory.h" | 30 #include "chrome/browser/content_settings/host_content_settings_map_factory.h" |
29 #include "chrome/browser/favicon/chrome_fallback_icon_client_factory.h" | 31 #include "chrome/browser/favicon/chrome_fallback_icon_client_factory.h" |
30 #include "chrome/browser/favicon/fallback_icon_service_factory.h" | 32 #include "chrome/browser/favicon/fallback_icon_service_factory.h" |
31 #include "chrome/browser/favicon/favicon_service_factory.h" | 33 #include "chrome/browser/favicon/favicon_service_factory.h" |
32 #include "chrome/browser/history/chrome_history_client.h" | 34 #include "chrome/browser/history/chrome_history_client.h" |
33 #include "chrome/browser/history/history_service_factory.h" | 35 #include "chrome/browser/history/history_service_factory.h" |
34 #include "chrome/browser/history/web_history_service_factory.h" | 36 #include "chrome/browser/history/web_history_service_factory.h" |
35 #include "chrome/browser/net/proxy_service_factory.h" | 37 #include "chrome/browser/net/proxy_service_factory.h" |
36 #include "chrome/browser/policy/profile_policy_connector.h" | 38 #include "chrome/browser/policy/profile_policy_connector.h" |
(...skipping 939 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
976 | 978 |
977 content::PermissionManager* TestingProfile::GetPermissionManager() { | 979 content::PermissionManager* TestingProfile::GetPermissionManager() { |
978 return NULL; | 980 return NULL; |
979 } | 981 } |
980 | 982 |
981 content::BackgroundSyncController* | 983 content::BackgroundSyncController* |
982 TestingProfile::GetBackgroundSyncController() { | 984 TestingProfile::GetBackgroundSyncController() { |
983 return nullptr; | 985 return nullptr; |
984 } | 986 } |
985 | 987 |
| 988 content::BrowsingDataRemoverDelegate* |
| 989 TestingProfile::GetBrowsingDataRemoverDelegate() { |
| 990 // TestingProfile contains a real BrowsingDataRemover from BrowserContext. |
| 991 // Since ChromeBrowsingDataRemoverDelegate is just a Chrome-specific extension |
| 992 // of BrowsingDataRemover, we include it here for consistency. |
| 993 // |
| 994 // This is not a problem, since ChromeBrowsingDataRemoverDelegate mostly |
| 995 // just serves as an interface to deletion mechanisms of various browsing |
| 996 // data backends, which are already mocked if considered too heavy-weight |
| 997 // for TestingProfile. |
| 998 return ChromeBrowsingDataRemoverDelegateFactory::GetForProfile(this); |
| 999 } |
| 1000 |
986 net::URLRequestContextGetter* TestingProfile::CreateRequestContext( | 1001 net::URLRequestContextGetter* TestingProfile::CreateRequestContext( |
987 content::ProtocolHandlerMap* protocol_handlers, | 1002 content::ProtocolHandlerMap* protocol_handlers, |
988 content::URLRequestInterceptorScopedVector request_interceptors) { | 1003 content::URLRequestInterceptorScopedVector request_interceptors) { |
989 return new net::TestURLRequestContextGetter( | 1004 return new net::TestURLRequestContextGetter( |
990 BrowserThread::GetTaskRunnerForThread(BrowserThread::IO)); | 1005 BrowserThread::GetTaskRunnerForThread(BrowserThread::IO)); |
991 } | 1006 } |
992 | 1007 |
993 net::URLRequestContextGetter* | 1008 net::URLRequestContextGetter* |
994 TestingProfile::CreateRequestContextForStoragePartition( | 1009 TestingProfile::CreateRequestContextForStoragePartition( |
995 const base::FilePath& partition_path, | 1010 const base::FilePath& partition_path, |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1099 // Note: Owned by |original_profile|. | 1114 // Note: Owned by |original_profile|. |
1100 return new TestingProfile(path_, delegate_, | 1115 return new TestingProfile(path_, delegate_, |
1101 #if BUILDFLAG(ENABLE_EXTENSIONS) | 1116 #if BUILDFLAG(ENABLE_EXTENSIONS) |
1102 extension_policy_, | 1117 extension_policy_, |
1103 #endif | 1118 #endif |
1104 std::move(pref_service_), original_profile, | 1119 std::move(pref_service_), original_profile, |
1105 guest_session_, supervised_user_id_, | 1120 guest_session_, supervised_user_id_, |
1106 std::move(policy_service_), testing_factories_, | 1121 std::move(policy_service_), testing_factories_, |
1107 profile_name_); | 1122 profile_name_); |
1108 } | 1123 } |
OLD | NEW |