| 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" | |
| 22 #include "chrome/browser/extensions/extension_service.h" | 21 #include "chrome/browser/extensions/extension_service.h" |
| 23 #include "chrome/browser/extensions/extension_special_storage_policy.h" | 22 #include "chrome/browser/extensions/extension_special_storage_policy.h" |
| 24 #include "chrome/browser/extensions/extension_system.h" | 23 #include "chrome/browser/extensions/extension_system.h" |
| 25 #include "chrome/browser/extensions/extension_system_factory.h" | 24 #include "chrome/browser/extensions/extension_system_factory.h" |
| 26 #include "chrome/browser/extensions/test_extension_system.h" | 25 #include "chrome/browser/extensions/test_extension_system.h" |
| 27 #include "chrome/browser/favicon/favicon_service.h" | 26 #include "chrome/browser/favicon/favicon_service.h" |
| 28 #include "chrome/browser/geolocation/chrome_geolocation_permission_context.h" | 27 #include "chrome/browser/geolocation/chrome_geolocation_permission_context.h" |
| 29 #include "chrome/browser/history/history.h" | 28 #include "chrome/browser/history/history.h" |
| 30 #include "chrome/browser/history/history_backend.h" | 29 #include "chrome/browser/history/history_backend.h" |
| 31 #include "chrome/browser/history/history_service_factory.h" | 30 #include "chrome/browser/history/history_service_factory.h" |
| (...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 351 HistoryServiceFactory::GetForProfileIfExists(this).get(); | 350 HistoryServiceFactory::GetForProfileIfExists(this).get(); |
| 352 if (history_service) { | 351 if (history_service) { |
| 353 history_service->history_backend_->bookmark_service_ = | 352 history_service->history_backend_->bookmark_service_ = |
| 354 bookmark_service; | 353 bookmark_service; |
| 355 history_service->history_backend_->expirer_.bookmark_service_ = | 354 history_service->history_backend_->expirer_.bookmark_service_ = |
| 356 bookmark_service; | 355 bookmark_service; |
| 357 } | 356 } |
| 358 } | 357 } |
| 359 | 358 |
| 360 void TestingProfile::CreateProtocolHandlerRegistry() { | 359 void TestingProfile::CreateProtocolHandlerRegistry() { |
| 361 protocol_handler_registry_ = new ProtocolHandlerRegistry(this, | 360 CreateProtocolHandlerRegistry( |
| 362 new ProtocolHandlerRegistry::Delegate()); | 361 new ProtocolHandlerRegistry::Delegate()); |
| 363 } | 362 } |
| 364 | 363 |
| 364 void TestingProfile::CreateProtocolHandlerRegistry( |
| 365 ProtocolHandlerRegistry::Delegate* delegate) { |
| 366 protocol_handler_registry_ = new ProtocolHandlerRegistry(this, delegate); |
| 367 } |
| 368 |
| 365 static scoped_refptr<RefcountedProfileKeyedService> BuildWebDataService( | 369 static scoped_refptr<RefcountedProfileKeyedService> BuildWebDataService( |
| 366 Profile* profile) { | 370 Profile* profile) { |
| 367 WebDataService* web_data_service = new WebDataService(); | 371 WebDataService* web_data_service = new WebDataService(); |
| 368 if (web_data_service) | 372 if (web_data_service) |
| 369 web_data_service->Init(profile->GetPath()); | 373 web_data_service->Init(profile->GetPath()); |
| 370 return web_data_service; | 374 return web_data_service; |
| 371 } | 375 } |
| 372 | 376 |
| 373 void TestingProfile::CreateWebDataService() { | 377 void TestingProfile::CreateWebDataService() { |
| 374 WebDataServiceFactory::GetInstance()->SetTestingFactory( | 378 WebDataServiceFactory::GetInstance()->SetTestingFactory( |
| (...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 715 } | 719 } |
| 716 | 720 |
| 717 bool TestingProfile::WasCreatedByVersionOrLater(const std::string& version) { | 721 bool TestingProfile::WasCreatedByVersionOrLater(const std::string& version) { |
| 718 return true; | 722 return true; |
| 719 } | 723 } |
| 720 | 724 |
| 721 base::Callback<ChromeURLDataManagerBackend*(void)> | 725 base::Callback<ChromeURLDataManagerBackend*(void)> |
| 722 TestingProfile::GetChromeURLDataManagerBackendGetter() const { | 726 TestingProfile::GetChromeURLDataManagerBackendGetter() const { |
| 723 return base::Callback<ChromeURLDataManagerBackend*(void)>(); | 727 return base::Callback<ChromeURLDataManagerBackend*(void)>(); |
| 724 } | 728 } |
| OLD | NEW |