| 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 331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 363 HistoryServiceFactory::GetForProfileWithoutCreating(this).get(); | 362 HistoryServiceFactory::GetForProfileWithoutCreating(this).get(); |
| 364 if (history_service) { | 363 if (history_service) { |
| 365 history_service->history_backend_->bookmark_service_ = | 364 history_service->history_backend_->bookmark_service_ = |
| 366 bookmark_service; | 365 bookmark_service; |
| 367 history_service->history_backend_->expirer_.bookmark_service_ = | 366 history_service->history_backend_->expirer_.bookmark_service_ = |
| 368 bookmark_service; | 367 bookmark_service; |
| 369 } | 368 } |
| 370 } | 369 } |
| 371 | 370 |
| 372 void TestingProfile::CreateProtocolHandlerRegistry() { | 371 void TestingProfile::CreateProtocolHandlerRegistry() { |
| 373 protocol_handler_registry_ = new ProtocolHandlerRegistry(this, | 372 CreateProtocolHandlerRegistry( |
| 374 new ProtocolHandlerRegistry::Delegate()); | 373 new ProtocolHandlerRegistry::Delegate()); |
| 375 } | 374 } |
| 376 | 375 |
| 376 void TestingProfile::CreateProtocolHandlerRegistry( |
| 377 ProtocolHandlerRegistry::Delegate* delegate) { |
| 378 protocol_handler_registry_ = new ProtocolHandlerRegistry(this, delegate); |
| 379 } |
| 380 |
| 377 static scoped_refptr<RefcountedProfileKeyedService> BuildWebDataService( | 381 static scoped_refptr<RefcountedProfileKeyedService> BuildWebDataService( |
| 378 Profile* profile) { | 382 Profile* profile) { |
| 379 WebDataService* web_data_service = new WebDataService(); | 383 WebDataService* web_data_service = new WebDataService(); |
| 380 if (web_data_service) | 384 if (web_data_service) |
| 381 web_data_service->Init(profile->GetPath()); | 385 web_data_service->Init(profile->GetPath()); |
| 382 return web_data_service; | 386 return web_data_service; |
| 383 } | 387 } |
| 384 | 388 |
| 385 void TestingProfile::CreateWebDataService() { | 389 void TestingProfile::CreateWebDataService() { |
| 386 WebDataServiceFactory::GetInstance()->SetTestingFactory( | 390 WebDataServiceFactory::GetInstance()->SetTestingFactory( |
| (...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 735 } | 739 } |
| 736 | 740 |
| 737 bool TestingProfile::WasCreatedByVersionOrLater(const std::string& version) { | 741 bool TestingProfile::WasCreatedByVersionOrLater(const std::string& version) { |
| 738 return true; | 742 return true; |
| 739 } | 743 } |
| 740 | 744 |
| 741 base::Callback<ChromeURLDataManagerBackend*(void)> | 745 base::Callback<ChromeURLDataManagerBackend*(void)> |
| 742 TestingProfile::GetChromeURLDataManagerBackendGetter() const { | 746 TestingProfile::GetChromeURLDataManagerBackendGetter() const { |
| 743 return base::Callback<ChromeURLDataManagerBackend*(void)>(); | 747 return base::Callback<ChromeURLDataManagerBackend*(void)>(); |
| 744 } | 748 } |
| OLD | NEW |