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

Unified Diff: chrome/browser/extensions/api/omnibox/omnibox_api.cc

Issue 11232066: Remove GetExtensionEventRouter from Profile. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rerebase Created 8 years, 2 months 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 0837bf0bc5f8248c6a33444c41747e1f0d698ef8..fd225442d3c8c94ae98355bc69860143087b2c16 100644
--- a/chrome/browser/extensions/api/omnibox/omnibox_api.cc
+++ b/chrome/browser/extensions/api/omnibox/omnibox_api.cc
@@ -52,24 +52,26 @@ const char kDescriptionStylesLength[] = "length";
void ExtensionOmniboxEventRouter::OnInputStarted(
Profile* profile, const std::string& extension_id) {
scoped_ptr<ListValue> event_args(new ListValue());
- profile->GetExtensionEventRouter()->DispatchEventToExtension(extension_id,
- events::kOnInputStarted, event_args.Pass(), profile, GURL());
+ extensions::ExtensionSystem::Get(profile)->event_router()->
+ DispatchEventToExtension(extension_id, events::kOnInputStarted,
+ event_args.Pass(), profile, GURL());
}
// static
bool ExtensionOmniboxEventRouter::OnInputChanged(
Profile* profile, const std::string& extension_id,
const std::string& input, int suggest_id) {
- if (!profile->GetExtensionEventRouter()->ExtensionHasEventListener(
- extension_id, events::kOnInputChanged))
+ if (!extensions::ExtensionSystem::Get(profile)->event_router()->
+ ExtensionHasEventListener(extension_id, events::kOnInputChanged))
return false;
scoped_ptr<ListValue> args(new ListValue());
args->Set(0, Value::CreateStringValue(input));
args->Set(1, Value::CreateIntegerValue(suggest_id));
- profile->GetExtensionEventRouter()->DispatchEventToExtension(
- extension_id, events::kOnInputChanged, args.Pass(), profile, GURL());
+ extensions::ExtensionSystem::Get(profile)->event_router()->
+ DispatchEventToExtension(extension_id, events::kOnInputChanged,
+ args.Pass(), profile, GURL());
return true;
}
@@ -90,8 +92,9 @@ void ExtensionOmniboxEventRouter::OnInputEntered(
scoped_ptr<ListValue> args(new ListValue());
args->Set(0, Value::CreateStringValue(input));
- profile->GetExtensionEventRouter()->DispatchEventToExtension(
- extension_id, events::kOnInputEntered, args.Pass(), profile, GURL());
+ extensions::ExtensionSystem::Get(profile)->event_router()->
+ DispatchEventToExtension(extension_id, events::kOnInputEntered,
+ args.Pass(), profile, GURL());
content::NotificationService::current()->Notify(
chrome::NOTIFICATION_EXTENSION_OMNIBOX_INPUT_ENTERED,
@@ -103,8 +106,9 @@ void ExtensionOmniboxEventRouter::OnInputEntered(
void ExtensionOmniboxEventRouter::OnInputCancelled(
Profile* profile, const std::string& extension_id) {
scoped_ptr<ListValue> args(new ListValue());
- profile->GetExtensionEventRouter()->DispatchEventToExtension(
- extension_id, events::kOnInputCancelled, args.Pass(), profile, GURL());
+ extensions::ExtensionSystem::Get(profile)->event_router()->
+ DispatchEventToExtension(extension_id, events::kOnInputCancelled,
+ args.Pass(), profile, GURL());
}
bool OmniboxSendSuggestionsFunction::RunImpl() {

Powered by Google App Engine
This is Rietveld 408576698