summaryrefslogtreecommitdiffstats
path: root/chrome/browser/extensions/extension_omnibox_api.cc
diff options
context:
space:
mode:
authormpcomplete@chromium.org <mpcomplete@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-15 18:22:41 +0000
committermpcomplete@chromium.org <mpcomplete@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-15 18:22:41 +0000
commit2c699655d5ed9cbf296a9389c3efe2a9fe01973e (patch)
tree843da73da9228499bf88063490fba73845740740 /chrome/browser/extensions/extension_omnibox_api.cc
parent731ae5165404c2ccf32af50ac3fda3364d41fbb1 (diff)
downloadchromium_src-2c699655d5ed9cbf296a9389c3efe2a9fe01973e.zip
chromium_src-2c699655d5ed9cbf296a9389c3efe2a9fe01973e.tar.gz
chromium_src-2c699655d5ed9cbf296a9389c3efe2a9fe01973e.tar.bz2
Pull events-related code out of ExtensionMessageService into its own class.
The events code is independent of the messaging code and didn't belong in the same class. This is part 1 of an extension event refactor. See bug for more details. BUG=58214 TEST=covered by tests Review URL: http://codereview.chromium.org/3758005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@62764 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/extensions/extension_omnibox_api.cc')
-rw-r--r--chrome/browser/extensions/extension_omnibox_api.cc14
1 files changed, 7 insertions, 7 deletions
diff --git a/chrome/browser/extensions/extension_omnibox_api.cc b/chrome/browser/extensions/extension_omnibox_api.cc
index 26c91bb..a5da1fb 100644
--- a/chrome/browser/extensions/extension_omnibox_api.cc
+++ b/chrome/browser/extensions/extension_omnibox_api.cc
@@ -7,7 +7,7 @@
#include "base/json/json_writer.h"
#include "base/string_util.h"
#include "base/values.h"
-#include "chrome/browser/extensions/extension_message_service.h"
+#include "chrome/browser/extensions/extension_event_router.h"
#include "chrome/browser/profile.h"
#include "chrome/common/notification_service.h"
@@ -35,7 +35,7 @@ const char kDescriptionStylesOffset[] = "offset";
// static
void ExtensionOmniboxEventRouter::OnInputStarted(
Profile* profile, const std::string& extension_id) {
- profile->GetExtensionMessageService()->DispatchEventToExtension(
+ profile->GetExtensionEventRouter()->DispatchEventToExtension(
extension_id, events::kOnInputStarted, "[]", profile, GURL());
}
@@ -43,9 +43,9 @@ void ExtensionOmniboxEventRouter::OnInputStarted(
bool ExtensionOmniboxEventRouter::OnInputChanged(
Profile* profile, const std::string& extension_id,
const std::string& input, int suggest_id) {
- std::string event_name = ExtensionMessageService::GetPerExtensionEventName(
+ std::string event_name = ExtensionEventRouter::GetPerExtensionEventName(
events::kOnInputChanged, extension_id);
- if (!profile->GetExtensionMessageService()->HasEventListener(event_name))
+ if (!profile->GetExtensionEventRouter()->HasEventListener(event_name))
return false;
ListValue args;
@@ -54,7 +54,7 @@ bool ExtensionOmniboxEventRouter::OnInputChanged(
std::string json_args;
base::JSONWriter::Write(&args, false, &json_args);
- profile->GetExtensionMessageService()->DispatchEventToExtension(
+ profile->GetExtensionEventRouter()->DispatchEventToExtension(
extension_id, events::kOnInputChanged, json_args, profile, GURL());
return true;
}
@@ -70,7 +70,7 @@ void ExtensionOmniboxEventRouter::OnInputEntered(
std::string json_args;
base::JSONWriter::Write(&args, false, &json_args);
- profile->GetExtensionMessageService()->DispatchEventToExtension(
+ profile->GetExtensionEventRouter()->DispatchEventToExtension(
extension_id, events::kOnInputEntered, json_args, profile, GURL());
NotificationService::current()->Notify(
@@ -81,7 +81,7 @@ void ExtensionOmniboxEventRouter::OnInputEntered(
// static
void ExtensionOmniboxEventRouter::OnInputCancelled(
Profile* profile, const std::string& extension_id) {
- profile->GetExtensionMessageService()->DispatchEventToExtension(
+ profile->GetExtensionEventRouter()->DispatchEventToExtension(
extension_id, events::kOnInputCancelled, "[]", profile, GURL());
}