| 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 "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/run_loop.h" | 14 #include "base/run_loop.h" |
| 15 #include "base/string_number_conversions.h" | 15 #include "base/string_number_conversions.h" |
| 16 #include "chrome/browser/autocomplete/autocomplete_classifier.h" | 16 #include "chrome/browser/autocomplete/autocomplete_classifier.h" |
| 17 #include "chrome/browser/bookmarks/bookmark_model.h" | 17 #include "chrome/browser/bookmarks/bookmark_model.h" |
| 18 #include "chrome/browser/bookmarks/bookmark_model_factory.h" | 18 #include "chrome/browser/bookmarks/bookmark_model_factory.h" |
| 19 #include "chrome/browser/browser_process.h" | 19 #include "chrome/browser/browser_process.h" |
| 20 #include "chrome/browser/content_settings/host_content_settings_map.h" | 20 #include "chrome/browser/content_settings/host_content_settings_map.h" |
| 21 #include "chrome/browser/custom_handlers/protocol_handler_registry.h" | 21 #include "chrome/browser/custom_handlers/protocol_handler_registry.h" |
| 22 #include "chrome/browser/extensions/extension_service.h" | 22 #include "chrome/browser/extensions/extension_service.h" |
| 23 #include "chrome/browser/extensions/extension_special_storage_policy.h" | 23 #include "chrome/browser/extensions/extension_special_storage_policy.h" |
| 24 #include "chrome/browser/extensions/extension_system.h" | 24 #include "chrome/browser/extensions/extension_system.h" |
| 25 #include "chrome/browser/extensions/extension_system_factory.h" | 25 #include "chrome/browser/extensions/extension_system_factory.h" |
| 26 #include "chrome/browser/extensions/test_extension_system.h" | 26 #include "chrome/browser/extensions/test_extension_system.h" |
| 27 #include "chrome/browser/favicon/favicon_service.h" | 27 #include "chrome/browser/favicon/favicon_service.h" |
| 28 #include "chrome/browser/geolocation/chrome_geolocation_permission_context.h" | 28 #include "chrome/browser/geolocation/chrome_geolocation_permission_context.h" |
| 29 #include "chrome/browser/history/shortcuts_backend.h" |
| 30 #include "chrome/browser/history/shortcuts_backend_factory.h" |
| 29 #include "chrome/browser/history/history.h" | 31 #include "chrome/browser/history/history.h" |
| 30 #include "chrome/browser/history/history_backend.h" | 32 #include "chrome/browser/history/history_backend.h" |
| 31 #include "chrome/browser/history/history_service_factory.h" | 33 #include "chrome/browser/history/history_service_factory.h" |
| 32 #include "chrome/browser/history/top_sites.h" | 34 #include "chrome/browser/history/top_sites.h" |
| 33 #include "chrome/browser/net/proxy_service_factory.h" | 35 #include "chrome/browser/net/proxy_service_factory.h" |
| 34 #include "chrome/browser/notifications/desktop_notification_service.h" | 36 #include "chrome/browser/notifications/desktop_notification_service.h" |
| 35 #include "chrome/browser/notifications/desktop_notification_service_factory.h" | 37 #include "chrome/browser/notifications/desktop_notification_service_factory.h" |
| 36 #include "chrome/browser/prefs/browser_prefs.h" | 38 #include "chrome/browser/prefs/browser_prefs.h" |
| 37 #include "chrome/browser/prefs/testing_pref_store.h" | 39 #include "chrome/browser/prefs/testing_pref_store.h" |
| 38 #include "chrome/browser/prerender/prerender_manager.h" | 40 #include "chrome/browser/prerender/prerender_manager.h" |
| (...skipping 458 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 497 #if defined(ENABLE_CONFIGURATION_POLICY) | 499 #if defined(ENABLE_CONFIGURATION_POLICY) |
| 498 policy::PolicyServiceImpl::Providers providers; | 500 policy::PolicyServiceImpl::Providers providers; |
| 499 policy_service_.reset(new policy::PolicyServiceImpl(providers)); | 501 policy_service_.reset(new policy::PolicyServiceImpl(providers)); |
| 500 #else | 502 #else |
| 501 policy_service_.reset(new policy::PolicyServiceStub()); | 503 policy_service_.reset(new policy::PolicyServiceStub()); |
| 502 #endif | 504 #endif |
| 503 } | 505 } |
| 504 return policy_service_.get(); | 506 return policy_service_.get(); |
| 505 } | 507 } |
| 506 | 508 |
| 507 history::ShortcutsBackend* TestingProfile::GetShortcutsBackend() { | |
| 508 return NULL; | |
| 509 } | |
| 510 | |
| 511 void TestingProfile::SetPrefService(PrefService* prefs) { | 509 void TestingProfile::SetPrefService(PrefService* prefs) { |
| 512 #if defined(ENABLE_PROTECTOR_SERVICE) | 510 #if defined(ENABLE_PROTECTOR_SERVICE) |
| 513 // ProtectorService binds itself very closely to the PrefService at the moment | 511 // ProtectorService binds itself very closely to the PrefService at the moment |
| 514 // of Profile creation and watches pref changes to update their backup. | 512 // of Profile creation and watches pref changes to update their backup. |
| 515 // For tests that replace the PrefService after TestingProfile creation, | 513 // For tests that replace the PrefService after TestingProfile creation, |
| 516 // ProtectorService is disabled to prevent further invalid memory accesses. | 514 // ProtectorService is disabled to prevent further invalid memory accesses. |
| 517 protector::ProtectorServiceFactory::GetInstance()-> | 515 protector::ProtectorServiceFactory::GetInstance()-> |
| 518 SetTestingFactory(this, NULL); | 516 SetTestingFactory(this, NULL); |
| 519 #endif | 517 #endif |
| 520 prefs_.reset(prefs); | 518 prefs_.reset(prefs); |
| (...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 715 } | 713 } |
| 716 | 714 |
| 717 bool TestingProfile::WasCreatedByVersionOrLater(const std::string& version) { | 715 bool TestingProfile::WasCreatedByVersionOrLater(const std::string& version) { |
| 718 return true; | 716 return true; |
| 719 } | 717 } |
| 720 | 718 |
| 721 base::Callback<ChromeURLDataManagerBackend*(void)> | 719 base::Callback<ChromeURLDataManagerBackend*(void)> |
| 722 TestingProfile::GetChromeURLDataManagerBackendGetter() const { | 720 TestingProfile::GetChromeURLDataManagerBackendGetter() const { |
| 723 return base::Callback<ChromeURLDataManagerBackend*(void)>(); | 721 return base::Callback<ChromeURLDataManagerBackend*(void)>(); |
| 724 } | 722 } |
| OLD | NEW |