| 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/browser_process.h" |
| 19 #include "chrome/browser/content_settings/host_content_settings_map.h" | 19 #include "chrome/browser/content_settings/host_content_settings_map.h" |
| 20 #include "chrome/browser/custom_handlers/protocol_handler_registry.h" | 20 #include "chrome/browser/custom_handlers/protocol_handler_registry.h" |
| 21 #include "chrome/browser/extensions/extension_pref_value_map.h" | 21 #include "chrome/browser/extensions/extension_pref_value_map.h" |
| 22 #include "chrome/browser/extensions/extension_service.h" | 22 #include "chrome/browser/extensions/extension_service.h" |
| 23 #include "chrome/browser/extensions/extension_settings.h" |
| 23 #include "chrome/browser/extensions/extension_special_storage_policy.h" | 24 #include "chrome/browser/extensions/extension_special_storage_policy.h" |
| 24 #include "chrome/browser/favicon/favicon_service.h" | 25 #include "chrome/browser/favicon/favicon_service.h" |
| 25 #include "chrome/browser/geolocation/geolocation_content_settings_map.h" | 26 #include "chrome/browser/geolocation/geolocation_content_settings_map.h" |
| 26 #include "chrome/browser/history/history.h" | 27 #include "chrome/browser/history/history.h" |
| 27 #include "chrome/browser/history/history_backend.h" | 28 #include "chrome/browser/history/history_backend.h" |
| 28 #include "chrome/browser/history/top_sites.h" | 29 #include "chrome/browser/history/top_sites.h" |
| 29 #include "chrome/browser/net/gaia/token_service.h" | 30 #include "chrome/browser/net/gaia/token_service.h" |
| 30 #include "chrome/browser/net/pref_proxy_config_service.h" | 31 #include "chrome/browser/net/pref_proxy_config_service.h" |
| 31 #include "chrome/browser/notifications/desktop_notification_service.h" | 32 #include "chrome/browser/notifications/desktop_notification_service.h" |
| 32 #include "chrome/browser/notifications/desktop_notification_service_factory.h" | 33 #include "chrome/browser/notifications/desktop_notification_service_factory.h" |
| (...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 331 | 332 |
| 332 extension_pref_value_map_.reset(new ExtensionPrefValueMap); | 333 extension_pref_value_map_.reset(new ExtensionPrefValueMap); |
| 333 // Note that the GetPrefs() creates a TestingPrefService, therefore | 334 // Note that the GetPrefs() creates a TestingPrefService, therefore |
| 334 // the extension controlled pref values set in extension_prefs_ | 335 // the extension controlled pref values set in extension_prefs_ |
| 335 // are not reflected in the pref service. One would need to | 336 // are not reflected in the pref service. One would need to |
| 336 // inject a new ExtensionPrefStore(extension_pref_value_map_.get(), false). | 337 // inject a new ExtensionPrefStore(extension_pref_value_map_.get(), false). |
| 337 extension_prefs_.reset( | 338 extension_prefs_.reset( |
| 338 new ExtensionPrefs(GetPrefs(), | 339 new ExtensionPrefs(GetPrefs(), |
| 339 install_directory, | 340 install_directory, |
| 340 extension_pref_value_map_.get())); | 341 extension_pref_value_map_.get())); |
| 342 extension_settings_.reset(new ExtensionSettings(install_directory)); |
| 341 extension_service_.reset(new ExtensionService(this, | 343 extension_service_.reset(new ExtensionService(this, |
| 342 command_line, | 344 command_line, |
| 343 install_directory, | 345 install_directory, |
| 344 extension_prefs_.get(), | 346 extension_prefs_.get(), |
| 347 extension_settings_.get(), |
| 345 autoupdate_enabled, | 348 autoupdate_enabled, |
| 346 true)); | 349 true)); |
| 347 return extension_service_.get(); | 350 return extension_service_.get(); |
| 348 } | 351 } |
| 349 | 352 |
| 350 FilePath TestingProfile::GetPath() { | 353 FilePath TestingProfile::GetPath() { |
| 351 DCHECK(temp_dir_.IsValid()); // TODO(phajdan.jr): do it better. | 354 DCHECK(temp_dir_.IsValid()); // TODO(phajdan.jr): do it better. |
| 352 return temp_dir_.path(); | 355 return temp_dir_.path(); |
| 353 } | 356 } |
| 354 | 357 |
| (...skipping 437 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 792 } | 795 } |
| 793 | 796 |
| 794 DerivedTestingProfile::DerivedTestingProfile(Profile* profile) | 797 DerivedTestingProfile::DerivedTestingProfile(Profile* profile) |
| 795 : original_profile_(profile) {} | 798 : original_profile_(profile) {} |
| 796 | 799 |
| 797 DerivedTestingProfile::~DerivedTestingProfile() {} | 800 DerivedTestingProfile::~DerivedTestingProfile() {} |
| 798 | 801 |
| 799 ProfileId DerivedTestingProfile::GetRuntimeId() { | 802 ProfileId DerivedTestingProfile::GetRuntimeId() { |
| 800 return original_profile_->GetRuntimeId(); | 803 return original_profile_->GetRuntimeId(); |
| 801 } | 804 } |
| OLD | NEW |