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

Unified Diff: chrome/browser/extensions/api/app_runtime/app_runtime_api.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/api/app_runtime/app_runtime_api.cc
diff --git a/chrome/browser/extensions/api/app_runtime/app_runtime_api.cc b/chrome/browser/extensions/api/app_runtime/app_runtime_api.cc
index ab53aa773184cb7102ec1196f8d8ce330cca84fb..9586ff38db659c84f561da619563c7aa8053ba20 100644
--- a/chrome/browser/extensions/api/app_runtime/app_runtime_api.cc
+++ b/chrome/browser/extensions/api/app_runtime/app_runtime_api.cc
@@ -10,6 +10,7 @@
#include "base/utf_string_conversions.h"
#include "base/values.h"
#include "chrome/browser/extensions/event_router.h"
+#include "chrome/browser/extensions/extension_system.h"
#include "chrome/browser/extensions/web_intent_callbacks.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/common/extensions/extension.h"
@@ -37,16 +38,18 @@ namespace extensions {
void AppEventRouter::DispatchOnLaunchedEvent(
Profile* profile, const Extension* extension) {
scoped_ptr<ListValue> arguments(new ListValue());
- profile->GetExtensionEventRouter()->DispatchEventToExtension(
- extension->id(), kOnLaunchedEvent, arguments.Pass(), NULL, GURL());
+ extensions::ExtensionSystem::Get(profile)->event_router()->
+ DispatchEventToExtension(extension->id(), kOnLaunchedEvent,
+ arguments.Pass(), NULL, GURL());
}
// static.
void AppEventRouter::DispatchOnRestartedEvent(
Profile* profile, const Extension* extension) {
scoped_ptr<ListValue> arguments(new ListValue());
- profile->GetExtensionEventRouter()->DispatchEventToExtension(
- extension->id(), kOnRestartedEvent, arguments.Pass(), NULL, GURL());
+ extensions::ExtensionSystem::Get(profile)->event_router()->
+ DispatchEventToExtension(extension->id(), kOnRestartedEvent,
+ arguments.Pass(), NULL, GURL());
}
// static.
@@ -67,8 +70,9 @@ void AppEventRouter::DispatchOnLaunchedEventWithFileEntry(
// NOTE: This second argument is dropped before being dispatched to the client
// code.
args->Append(intent_data);
- profile->GetExtensionEventRouter()->DispatchEventToExtension(
- extension->id(), kOnLaunchedEvent, args.Pass(), NULL, GURL());
+ extensions::ExtensionSystem::Get(profile)->event_router()->
+ DispatchEventToExtension(extension->id(), kOnLaunchedEvent, args.Pass(),
+ NULL, GURL());
}
// static.
@@ -124,8 +128,9 @@ void AppEventRouter::DispatchOnLaunchedEventWithWebIntent(
int intent_id =
callbacks->RegisterCallback(extension, intents_dispatcher, source);
args->Append(base::Value::CreateIntegerValue(intent_id));
- profile->GetExtensionEventRouter()->DispatchEventToExtension(
- extension->id(), kOnLaunchedEvent, args.Pass(), NULL, GURL());
+ extensions::ExtensionSystem::Get(profile)->event_router()->
+ DispatchEventToExtension(extension->id(), kOnLaunchedEvent, args.Pass(),
+ NULL, GURL());
}
bool AppRuntimePostIntentResponseFunction::RunImpl() {
« no previous file with comments | « chrome/browser/extensions/api/api_function.cc ('k') | chrome/browser/extensions/api/bluetooth/bluetooth_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698