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

Unified Diff: chrome/browser/extensions/api/api_resource_event_notifier.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/api_resource_event_notifier.cc
diff --git a/chrome/browser/extensions/api/api_resource_event_notifier.cc b/chrome/browser/extensions/api/api_resource_event_notifier.cc
index 17b7144908d79fc02d47233ad33d8f1cc02de52f..a65f0b3a758c00c6404d9458bfde6946821ec4b1 100644
--- a/chrome/browser/extensions/api/api_resource_event_notifier.cc
+++ b/chrome/browser/extensions/api/api_resource_event_notifier.cc
@@ -43,23 +43,25 @@ std::string ApiResourceEventNotifier::ApiResourceEventTypeToString(
ApiResourceEventNotifier::~ApiResourceEventNotifier() {}
-void ApiResourceEventNotifier::DispatchEvent(const std::string &extension,
- DictionaryValue* event) {
+void ApiResourceEventNotifier::DispatchEvent(
+ const std::string& event_name, DictionaryValue* args) {
BrowserThread::PostTask(
BrowserThread::UI, FROM_HERE,
base::Bind(
- &ApiResourceEventNotifier::DispatchEventOnUIThread, this, extension,
- event));
+ &ApiResourceEventNotifier::DispatchEventOnUIThread, this,
+ event_name, args));
}
void ApiResourceEventNotifier::DispatchEventOnUIThread(
- const std::string &extension, DictionaryValue* event) {
+ const std::string& event_name, DictionaryValue* args) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
scoped_ptr<ListValue> arguments(new ListValue());
- arguments->Set(0, event);
- router_->DispatchEventToExtension(src_extension_id_, extension,
- arguments.Pass(), profile_, src_url_);
+ arguments->Set(0, args);
+ scoped_ptr<Event> event(new Event(event_name, arguments.Pass()));
+ event->restrict_to_profile = profile_;
+ event->event_url = src_url_;
+ router_->DispatchEventToExtension(src_extension_id_, event.Pass());
}
DictionaryValue* ApiResourceEventNotifier::CreateApiResourceEvent(

Powered by Google App Engine
This is Rietveld 408576698