Index: chrome/test/base/testing_profile.cc |
diff --git a/chrome/test/base/testing_profile.cc b/chrome/test/base/testing_profile.cc |
index 01304ef76589e5252ac98224705ecf7153b21c38..aa9621853273a3b8f8cf552ece217566342de398 100644 |
--- a/chrome/test/base/testing_profile.cc |
+++ b/chrome/test/base/testing_profile.cc |
@@ -17,9 +17,11 @@ |
#include "chrome/browser/browser_process.h" |
#include "chrome/browser/content_settings/host_content_settings_map.h" |
#include "chrome/browser/custom_handlers/protocol_handler_registry.h" |
-#include "chrome/browser/extensions/extension_pref_value_map.h" |
#include "chrome/browser/extensions/extension_service.h" |
#include "chrome/browser/extensions/extension_special_storage_policy.h" |
+#include "chrome/browser/extensions/extension_system.h" |
+#include "chrome/browser/extensions/extension_system_factory.h" |
+#include "chrome/browser/extensions/test_extension_system.h" |
#include "chrome/browser/favicon/favicon_service.h" |
#include "chrome/browser/geolocation/chrome_geolocation_permission_context.h" |
#include "chrome/browser/history/history.h" |
@@ -208,6 +210,9 @@ TestingProfile::TestingProfile(const FilePath& path, |
void TestingProfile::Init() { |
profile_dependency_manager_->CreateProfileServices(this, true); |
+ ExtensionSystemFactory::GetInstance()->SetTestingFactory( |
+ this, TestExtensionSystem::Build); |
+ |
// Install profile keyed service factory hooks for dummy/test services |
DesktopNotificationServiceFactory::GetInstance()->SetTestingFactory( |
this, CreateTestDesktopNotificationService); |
@@ -398,39 +403,6 @@ void TestingProfile::BlockUntilTemplateURLServiceLoaded() { |
turl_service_load_observer.Wait(); |
} |
-void TestingProfile::CreateExtensionProcessManager() { |
- extension_process_manager_.reset(ExtensionProcessManager::Create(this)); |
-} |
- |
-ExtensionService* TestingProfile::CreateExtensionService( |
- const CommandLine* command_line, |
- const FilePath& install_directory, |
- bool autoupdate_enabled) { |
- // Extension pref store, created for use by |extension_prefs_|. |
- |
- extension_pref_value_map_.reset(new ExtensionPrefValueMap); |
- |
- bool extensions_disabled = |
- command_line && command_line->HasSwitch(switches::kDisableExtensions); |
- |
- // Note that the GetPrefs() creates a TestingPrefService, therefore |
- // the extension controlled pref values set in extension_prefs_ |
- // are not reflected in the pref service. One would need to |
- // inject a new ExtensionPrefStore(extension_pref_value_map_.get(), false). |
- extension_prefs_.reset( |
- new ExtensionPrefs(GetPrefs(), |
- install_directory, |
- extension_pref_value_map_.get())); |
- extension_prefs_->Init(extensions_disabled); |
- extension_service_.reset(new ExtensionService(this, |
- command_line, |
- install_directory, |
- extension_prefs_.get(), |
- autoupdate_enabled, |
- true)); |
- return extension_service_.get(); |
-} |
- |
FilePath TestingProfile::GetPath() { |
return profile_path_; |
} |
@@ -497,27 +469,19 @@ VisitedLinkMaster* TestingProfile::GetVisitedLinkMaster() { |
} |
ExtensionService* TestingProfile::GetExtensionService() { |
- return extension_service_.get(); |
+ return ExtensionSystemFactory::GetForProfile(this)->extension_service(); |
} |
UserScriptMaster* TestingProfile::GetUserScriptMaster() { |
- return NULL; |
-} |
- |
-ExtensionDevToolsManager* TestingProfile::GetExtensionDevToolsManager() { |
- return NULL; |
+ return ExtensionSystemFactory::GetForProfile(this)->user_script_master(); |
} |
ExtensionProcessManager* TestingProfile::GetExtensionProcessManager() { |
- return extension_process_manager_.get(); |
-} |
- |
-ExtensionMessageService* TestingProfile::GetExtensionMessageService() { |
- return NULL; |
+ return ExtensionSystemFactory::GetForProfile(this)->process_manager(); |
} |
ExtensionEventRouter* TestingProfile::GetExtensionEventRouter() { |
- return NULL; |
+ return ExtensionSystemFactory::GetForProfile(this)->event_router(); |
} |
void TestingProfile::SetExtensionSpecialStoragePolicy( |
@@ -637,8 +601,10 @@ net::URLRequestContextGetter* TestingProfile::GetRequestContext() { |
net::URLRequestContextGetter* TestingProfile::GetRequestContextForRenderProcess( |
int renderer_child_id) { |
- if (extension_service_.get()) { |
- const Extension* installed_app = extension_service_-> |
+ ExtensionService* extension_service = |
+ ExtensionSystemFactory::GetForProfile(this)->extension_service(); |
+ if (extension_service) { |
+ const Extension* installed_app = extension_service-> |
GetInstalledAppForRenderer(renderer_child_id); |
if (installed_app != NULL && installed_app->is_storage_isolated()) |
return GetRequestContextForIsolatedApp(installed_app->id()); |
@@ -794,10 +760,6 @@ ChromeBlobStorageContext* TestingProfile::GetBlobStorageContext() { |
return NULL; |
} |
-ExtensionInfoMap* TestingProfile::GetExtensionInfoMap() { |
- return NULL; |
-} |
- |
PromoCounter* TestingProfile::GetInstantPromoCounter() { |
return NULL; |
} |