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( |