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

Unified Diff: chrome/renderer/resources/extension_process_bindings.js

Issue 2078021: First pass at experimental omnibox API. There are plenty of rough edges and (Closed)
Patch Set: no prefer_keyword Created 10 years, 7 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/renderer/resources/extension_process_bindings.js
diff --git a/chrome/renderer/resources/extension_process_bindings.js b/chrome/renderer/resources/extension_process_bindings.js
index c3d6a33a27acc9bb3aa6c585ae5d18414b4613a5..fe393baa98b752ff455c88598948728ecce0546f 100644
--- a/chrome/renderer/resources/extension_process_bindings.js
+++ b/chrome/renderer/resources/extension_process_bindings.js
@@ -305,6 +305,21 @@ var chrome = chrome || {};
});
}
+ function setupOmniboxEvents(extensionId) {
+ chrome.experimental.omnibox.onInputEntered =
+ new chrome.Event("experimental.omnibox.onInputEntered/" + extensionId);
+
+ chrome.experimental.omnibox.onInputChanged =
+ new chrome.Event("experimental.omnibox.onInputChanged/" + extensionId);
+ chrome.experimental.omnibox.onInputChanged.dispatch =
+ function(text, requestId) {
+ var suggestCallback = function(suggestions) {
+ chrome.experimental.omnibox.sendSuggestions(requestId, suggestions);
+ }
+ chrome.Event.prototype.dispatch.apply(this, [text, suggestCallback]);
+ };
+ }
+
chromeHidden.onLoad.addListener(function (extensionId) {
chrome.initExtension(extensionId, false);
@@ -636,6 +651,7 @@ var chrome = chrome || {};
setupToolstripEvents(GetRenderViewId());
setupPopupEvents(GetRenderViewId());
setupHiddenContextMenuEvent(extensionId);
+ setupOmniboxEvents(extensionId);
});
if (!chrome.experimental)
« no previous file with comments | « chrome/renderer/resources/extension_apitest.js ('k') | chrome/renderer/resources/renderer_extension_bindings.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698