diff options
Diffstat (limited to 'chrome/browser/extensions/test_extension_system.cc')
-rw-r--r-- | chrome/browser/extensions/test_extension_system.cc | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/chrome/browser/extensions/test_extension_system.cc b/chrome/browser/extensions/test_extension_system.cc index f1641e0..5cb9046 100644 --- a/chrome/browser/extensions/test_extension_system.cc +++ b/chrome/browser/extensions/test_extension_system.cc @@ -11,6 +11,8 @@ #include "chrome/browser/extensions/extension_info_map.h" #include "chrome/browser/extensions/extension_pref_value_map.h" #include "chrome/browser/extensions/extension_pref_value_map_factory.h" +#include "chrome/browser/extensions/extension_prefs.h" +#include "chrome/browser/extensions/extension_prefs_factory.h" #include "chrome/browser/extensions/extension_process_manager.h" #include "chrome/browser/extensions/extension_service.h" #include "chrome/browser/extensions/extension_system.h" @@ -62,37 +64,39 @@ ExtensionPrefs* TestExtensionSystem::CreateExtensionPrefs( command_line && command_line->HasSwitch(switches::kDisableExtensions); // Note that the GetPrefs() creates a TestingPrefService, therefore - // the extension controlled pref values set in extension_prefs_ + // the extension controlled pref values set in ExtensionPrefs // are not reflected in the pref service. One would need to // inject a new ExtensionPrefStore(extension_pref_value_map, false). - extension_prefs_ = ExtensionPrefs::Create( + return ExtensionPrefs::Create( profile_->GetPrefs(), install_directory, ExtensionPrefValueMapFactory::GetForProfile(profile_), extensions_disabled); - return extension_prefs_.get(); } ExtensionService* TestExtensionSystem::CreateExtensionService( const CommandLine* command_line, const base::FilePath& install_directory, bool autoupdate_enabled) { - if (!extension_prefs_) - CreateExtensionPrefs(command_line, install_directory); + if (!ExtensionPrefs::Get(profile_)) { + ExtensionPrefsFactory::GetInstance()->SetInstanceForTesting( + profile_, + CreateExtensionPrefs(command_line, install_directory)); + } state_store_.reset(new StateStore(profile_, new TestingValueStore())); shell_window_geometry_cache_.reset( - new ShellWindowGeometryCache(profile_, extension_prefs_.get())); - blacklist_.reset(new Blacklist(extension_prefs_.get())); + new ShellWindowGeometryCache(profile_, ExtensionPrefs::Get(profile_))); + blacklist_.reset(new Blacklist(ExtensionPrefs::Get(profile_))); standard_management_policy_provider_.reset( - new StandardManagementPolicyProvider(extension_prefs_.get())); + new StandardManagementPolicyProvider(ExtensionPrefs::Get(profile_))); management_policy_.reset(new ManagementPolicy()); management_policy_->RegisterProvider( standard_management_policy_provider_.get()); extension_service_.reset(new ExtensionService(profile_, command_line, install_directory, - extension_prefs_.get(), + ExtensionPrefs::Get(profile_), blacklist_.get(), autoupdate_enabled, true)); @@ -128,10 +132,6 @@ StateStore* TestExtensionSystem::rules_store() { return state_store_.get(); } -ExtensionPrefs* TestExtensionSystem::extension_prefs() { - return extension_prefs_.get(); -} - ShellWindowGeometryCache* TestExtensionSystem::shell_window_geometry_cache() { return shell_window_geometry_cache_.get(); } |