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

Unified Diff: chrome/browser/extensions/api/app_runtime/app_runtime_api.cc

Issue 11440004: Remove deprecated extension EventRouter APIs. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: compile Created 8 years 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 fa7d5f3684c2336e7beae39c9e9a12fe8f71fb81..4f22f3d61119de1abc90e449d77d6ba882931fc9 100644
--- a/chrome/browser/extensions/api/app_runtime/app_runtime_api.cc
+++ b/chrome/browser/extensions/api/app_runtime/app_runtime_api.cc
@@ -19,6 +19,8 @@
#include "googleurl/src/gurl.h"
#include "webkit/glue/web_intent_data.h"
+namespace extensions {
+
namespace {
const char kIntentIdKey[] = "intentId";
@@ -42,16 +44,15 @@ void DispatchOnLaunchedEventImpl(const std::string& extension_id,
// ignored (but an app that doesn't listen for the onLaunched event doesn't
// make sense anyway).
system->event_router()->AddLazyEventListener(kOnLaunchedEvent, extension_id);
- system->event_router()->DispatchEventToExtension(
- extension_id, kOnLaunchedEvent, args.Pass(), profile, GURL());
+ scoped_ptr<Event> event(new Event(kOnLaunchedEvent, args.Pass()));
+ event->restrict_to_profile = profile;
+ system->event_router()->DispatchEventToExtension(extension_id, event.Pass());
system->event_router()->RemoveLazyEventListener(kOnLaunchedEvent,
extension_id);
}
} // anonymous namespace
-namespace extensions {
-
// static.
void AppEventRouter::DispatchOnLaunchedEvent(
Profile* profile, const Extension* extension) {
@@ -63,9 +64,10 @@ void AppEventRouter::DispatchOnLaunchedEvent(
void AppEventRouter::DispatchOnRestartedEvent(
Profile* profile, const Extension* extension) {
scoped_ptr<ListValue> arguments(new ListValue());
+ scoped_ptr<Event> event(new Event(kOnRestartedEvent, arguments.Pass()));
+ event->restrict_to_profile = profile;
extensions::ExtensionSystem::Get(profile)->event_router()->
- DispatchEventToExtension(extension->id(), kOnRestartedEvent,
- arguments.Pass(), profile, GURL());
+ DispatchEventToExtension(extension->id(), event.Pass());
}
// static.
« no previous file with comments | « chrome/browser/extensions/api/api_resource_event_notifier.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