Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(809)

Unified Diff: chrome/browser/extensions/settings/settings_test_util.cc

Issue 11232066: Remove GetExtensionEventRouter from Profile. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rerebase Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/settings/settings_test_util.cc
diff --git a/chrome/browser/extensions/settings/settings_test_util.cc b/chrome/browser/extensions/settings/settings_test_util.cc
index a2c17cae2c0669e1982399247e429757dfa3510a..e1f675fb1f39c3efb88815ae6f7b99fb633cfa19 100644
--- a/chrome/browser/extensions/settings/settings_test_util.cc
+++ b/chrome/browser/extensions/settings/settings_test_util.cc
@@ -6,6 +6,7 @@
#include "base/file_path.h"
#include "chrome/common/extensions/extension.h"
+#include "chrome/browser/extensions/extension_system_factory.h"
#include "chrome/browser/extensions/settings/settings_frontend.h"
namespace extensions {
@@ -105,11 +106,28 @@ void MockExtensionService::AddExtensionWithIdAndPermissions(
}
}
+// MockExtensionSystem
+
+MockExtensionSystem::MockExtensionSystem(Profile* profile)
+ : TestExtensionSystem(profile) {}
+MockExtensionSystem::~MockExtensionSystem() {}
+
+EventRouter* MockExtensionSystem::event_router() {
+ if (!event_router_.get())
+ event_router_.reset(new EventRouter(profile_, NULL));
+ return event_router_.get();
+}
+
+ProfileKeyedService* BuildMockExtensionSystem(Profile* profile) {
+ return new MockExtensionSystem(profile);
+}
+
// MockProfile
MockProfile::MockProfile(const FilePath& file_path)
: TestingProfile(file_path) {
- event_router_.reset(new EventRouter(this, NULL));
+ ExtensionSystemFactory::GetInstance()->SetTestingFactoryAndUse(this,
+ &BuildMockExtensionSystem);
}
MockProfile::~MockProfile() {}
@@ -124,10 +142,6 @@ ExtensionService* MockProfile::GetExtensionService() {
return static_cast<ExtensionService*>(as_interface);
}
-EventRouter* MockProfile::GetExtensionEventRouter() {
- return event_router_.get();
-}
-
// ScopedSettingsFactory
ScopedSettingsStorageFactory::ScopedSettingsStorageFactory() {}
« no previous file with comments | « chrome/browser/extensions/settings/settings_test_util.h ('k') | chrome/browser/extensions/test_extension_system.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698