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

Unified Diff: chrome/browser/extensions/api/omnibox/omnibox_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/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..1b4b2e0561fff7052af4d4c7e8e4160ea228e8bb 100644
--- a/chrome/browser/extensions/api/omnibox/omnibox_api.cc
+++ b/chrome/browser/extensions/api/omnibox/omnibox_api.cc
@@ -45,10 +45,11 @@ 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<Event> event(new Event(
+ events::kOnInputStarted, make_scoped_ptr(new ListValue())));
+ event->restrict_to_profile = profile;
+ ExtensionSystem::Get(profile)->event_router()->
+ DispatchEventToExtension(extension_id, event.Pass());
}
// static
@@ -63,9 +64,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 +89,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,
@@ -100,10 +103,11 @@ void ExtensionOmniboxEventRouter::OnInputEntered(
// static
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, make_scoped_ptr(new ListValue())));
+ event->restrict_to_profile = profile;
+ ExtensionSystem::Get(profile)->event_router()->
+ DispatchEventToExtension(extension_id, event.Pass());
}
bool OmniboxSendSuggestionsFunction::RunImpl() {

Powered by Google App Engine
This is Rietveld 408576698