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

Unified Diff: chrome/browser/extensions/extension_message_service.cc

Issue 2807033: Add support for omnibox.onInputStarted and onInputCancelled. (Closed)
Patch Set: fix Stop Created 10 years, 6 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/extension_message_service.cc
diff --git a/chrome/browser/extensions/extension_message_service.cc b/chrome/browser/extensions/extension_message_service.cc
index 2c7f693eb2f4d2e64b05582d7c12ace681624ea2..979437a7ce536a6f82c16a50462d4302dba2d12d 100644
--- a/chrome/browser/extensions/extension_message_service.cc
+++ b/chrome/browser/extensions/extension_message_service.cc
@@ -114,6 +114,14 @@ const char ExtensionMessageService::kDispatchOnMessage[] =
const char ExtensionMessageService::kDispatchEvent[] =
"Event.dispatchJSON";
+// static
+std::string ExtensionMessageService::GetPerExtensionEventName(
+ const std::string& event_name, const std::string& extension_id) {
+ // This should match the method we use in extension_process_binding.js when
+ // setting up the corresponding chrome.Event object.
+ return event_name + "/" + extension_id;
+}
+
ExtensionMessageService::ExtensionMessageService(Profile* profile)
: profile_(profile),
extension_devtools_manager_(NULL),
@@ -485,6 +493,14 @@ void ExtensionMessageService::DispatchEventToRenderers(
}
}
+void ExtensionMessageService::DispatchEventToExtension(
+ const std::string& extension_id,
+ const std::string& event_name, const std::string& event_args,
+ bool has_incognito_data, const GURL& event_url) {
+ DispatchEventToRenderers(GetPerExtensionEventName(event_name, extension_id),
+ event_args, has_incognito_data, event_url);
+}
+
void ExtensionMessageService::Observe(NotificationType type,
const NotificationSource& source,
const NotificationDetails& details) {
« no previous file with comments | « chrome/browser/extensions/extension_message_service.h ('k') | chrome/browser/extensions/extension_omnibox_api.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698