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

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

Issue 238633009: cleanup: Use EventRouter instead of ExtensionSystem::Get->event_router() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix compile error for chromeos build. Created 6 years, 8 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 2e0a43d90561e507aa53fd9d4387a4a76d1562e9..6ae1b53ad413188f29d3e065876d3647cbacd1a0 100644
--- a/chrome/browser/extensions/api/omnibox/omnibox_api.cc
+++ b/chrome/browser/extensions/api/omnibox/omnibox_api.cc
@@ -24,7 +24,6 @@
#include "extensions/browser/extension_prefs.h"
#include "extensions/browser/extension_prefs_factory.h"
#include "extensions/browser/extension_registry.h"
-#include "extensions/browser/extension_system.h"
#include "extensions/browser/extension_system_provider.h"
#include "extensions/browser/extensions_browser_client.h"
#include "extensions/common/extension.h"
@@ -103,16 +102,17 @@ void ExtensionOmniboxEventRouter::OnInputStarted(
omnibox::OnInputStarted::kEventName,
make_scoped_ptr(new base::ListValue())));
event->restrict_to_browser_context = profile;
- ExtensionSystem::Get(profile)->event_router()->
- DispatchEventToExtension(extension_id, event.Pass());
+ EventRouter::Get(profile)
+ ->DispatchEventToExtension(extension_id, event.Pass());
}
// static
bool ExtensionOmniboxEventRouter::OnInputChanged(
Profile* profile, const std::string& extension_id,
const std::string& input, int suggest_id) {
- if (!ExtensionSystem::Get(profile)->event_router()->ExtensionHasEventListener(
- extension_id, omnibox::OnInputChanged::kEventName))
+ EventRouter* event_router = EventRouter::Get(profile);
+ if (!event_router->ExtensionHasEventListener(
+ extension_id, omnibox::OnInputChanged::kEventName))
return false;
scoped_ptr<base::ListValue> args(new base::ListValue());
@@ -122,8 +122,7 @@ bool ExtensionOmniboxEventRouter::OnInputChanged(
scoped_ptr<Event> event(new Event(omnibox::OnInputChanged::kEventName,
args.Pass()));
event->restrict_to_browser_context = profile;
- ExtensionSystem::Get(profile)->event_router()->
- DispatchEventToExtension(extension_id, event.Pass());
+ event_router->DispatchEventToExtension(extension_id, event.Pass());
return true;
}
@@ -155,8 +154,8 @@ void ExtensionOmniboxEventRouter::OnInputEntered(
scoped_ptr<Event> event(new Event(omnibox::OnInputEntered::kEventName,
args.Pass()));
event->restrict_to_browser_context = profile;
- ExtensionSystem::Get(profile)->event_router()->
- DispatchEventToExtension(extension_id, event.Pass());
+ EventRouter::Get(profile)
+ ->DispatchEventToExtension(extension_id, event.Pass());
content::NotificationService::current()->Notify(
chrome::NOTIFICATION_EXTENSION_OMNIBOX_INPUT_ENTERED,
@@ -171,8 +170,8 @@ void ExtensionOmniboxEventRouter::OnInputCancelled(
omnibox::OnInputCancelled::kEventName,
make_scoped_ptr(new base::ListValue())));
event->restrict_to_browser_context = profile;
- ExtensionSystem::Get(profile)->event_router()->
- DispatchEventToExtension(extension_id, event.Pass());
+ EventRouter::Get(profile)
+ ->DispatchEventToExtension(extension_id, event.Pass());
}
OmniboxAPI::OmniboxAPI(content::BrowserContext* context)

Powered by Google App Engine
This is Rietveld 408576698