Index: chrome/browser/extensions/api/omnibox/omnibox_api.cc |
diff --git a/chrome/browser/extensions/api/omnibox/omnibox_api.cc b/chrome/browser/extensions/api/omnibox/omnibox_api.cc |
index 153fc279841b7524da2687975c5f757fe4b1f3c0..f56818d290d9e2bf0f510139b6c1937eca61a0c1 100644 |
--- a/chrome/browser/extensions/api/omnibox/omnibox_api.cc |
+++ b/chrome/browser/extensions/api/omnibox/omnibox_api.cc |
@@ -45,10 +45,12 @@ const char kDescriptionStylesLength[] = "length"; |
// static |
void ExtensionOmniboxEventRouter::OnInputStarted( |
Profile* profile, const std::string& extension_id) { |
- scoped_ptr<ListValue> event_args(new ListValue()); |
- extensions::ExtensionSystem::Get(profile)->event_router()-> |
- DispatchEventToExtension(extension_id, events::kOnInputStarted, |
- event_args.Pass(), profile, GURL()); |
+ scoped_ptr<ListValue> args(new ListValue()); |
+ scoped_ptr<Event> event(new Event( |
+ events::kOnInputStarted, args.Pass())); |
Yoyo Zhou
2012/12/05 22:28:32
I think you can inline the args (and make_scoped_p
Matt Perry
2012/12/05 22:53:53
Done.
|
+ event->restrict_to_profile = profile; |
+ ExtensionSystem::Get(profile)->event_router()-> |
+ DispatchEventToExtension(extension_id, event.Pass()); |
} |
// static |
@@ -63,9 +65,10 @@ bool ExtensionOmniboxEventRouter::OnInputChanged( |
args->Set(0, Value::CreateStringValue(input)); |
args->Set(1, Value::CreateIntegerValue(suggest_id)); |
- extensions::ExtensionSystem::Get(profile)->event_router()-> |
- DispatchEventToExtension(extension_id, events::kOnInputChanged, |
- args.Pass(), profile, GURL()); |
+ scoped_ptr<Event> event(new Event(events::kOnInputChanged, args.Pass())); |
+ event->restrict_to_profile = profile; |
+ ExtensionSystem::Get(profile)->event_router()-> |
+ DispatchEventToExtension(extension_id, event.Pass()); |
return true; |
} |
@@ -87,9 +90,10 @@ void ExtensionOmniboxEventRouter::OnInputEntered( |
scoped_ptr<ListValue> args(new ListValue()); |
args->Set(0, Value::CreateStringValue(input)); |
- extensions::ExtensionSystem::Get(profile)->event_router()-> |
- DispatchEventToExtension(extension_id, events::kOnInputEntered, |
- args.Pass(), profile, GURL()); |
+ scoped_ptr<Event> event(new Event(events::kOnInputEntered, args.Pass())); |
+ event->restrict_to_profile = profile; |
+ ExtensionSystem::Get(profile)->event_router()-> |
+ DispatchEventToExtension(extension_id, event.Pass()); |
content::NotificationService::current()->Notify( |
chrome::NOTIFICATION_EXTENSION_OMNIBOX_INPUT_ENTERED, |
@@ -101,9 +105,10 @@ void ExtensionOmniboxEventRouter::OnInputEntered( |
void ExtensionOmniboxEventRouter::OnInputCancelled( |
Profile* profile, const std::string& extension_id) { |
scoped_ptr<ListValue> args(new ListValue()); |
- extensions::ExtensionSystem::Get(profile)->event_router()-> |
- DispatchEventToExtension(extension_id, events::kOnInputCancelled, |
- args.Pass(), profile, GURL()); |
+ scoped_ptr<Event> event(new Event(events::kOnInputCancelled, args.Pass())); |
+ event->restrict_to_profile = profile; |
+ ExtensionSystem::Get(profile)->event_router()-> |
+ DispatchEventToExtension(extension_id, event.Pass()); |
} |
bool OmniboxSendSuggestionsFunction::RunImpl() { |