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

Unified Diff: chrome/renderer/resources/extensions/searchbox_api.js

Issue 10809063: Adding Javascript support for the Extended Searchbox API. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Syncing to pickup moved searchbox code. Created 8 years, 4 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/extensions/searchbox_api.js
diff --git a/chrome/renderer/resources/extensions/searchbox_api.js b/chrome/renderer/resources/extensions/searchbox_api.js
index e7fc4e0f8c24e540ded492d17dbd170e6c95d86f..c9d6589a0d2e19656d2a74938ec33b69bd13870b 100644
--- a/chrome/renderer/resources/extensions/searchbox_api.js
+++ b/chrome/renderer/resources/extensions/searchbox_api.js
@@ -15,7 +15,14 @@ if (!chrome.searchBox) {
native function GetY();
native function GetWidth();
native function GetHeight();
+ native function GetAutocompleteResults();
sreeram 2012/08/13 16:37:08 Don't we need all the shadow DOM stuff here?
Shishir 2012/08/13 18:11:12 Done.
+ native function GetKeyCode();
native function SetSuggestions();
+ native function SetSuggestionInline();
+ native function SetAutocompleteResultInline();
+ native function SetSuggestionReplace();
+ native function SetAutocompleteResultReplace();
+ native function SetNonNativeDropdownHeight();
sreeram 2012/08/13 16:37:08 This is a good opportunity to rename some of these
Shishir 2012/08/13 18:11:12 Done.
this.__defineGetter__('value', GetValue);
this.__defineGetter__('verbatim', GetVerbatim);
this.__defineGetter__('selectionStart', GetSelectionStart);
@@ -24,12 +31,31 @@ if (!chrome.searchBox) {
this.__defineGetter__('y', GetY);
this.__defineGetter__('width', GetWidth);
this.__defineGetter__('height', GetHeight);
+ this.__defineGetter__('nativeSuggestions', GetAutocompleteResults);
+ this.__defineGetter__('keyCode', GetKeyCode);
this.setSuggestions = function(text) {
SetSuggestions(text);
};
+ this.setAutocompleteText = function(text, behavior) {
+ SetSuggestionInline(text, behavior);
+ };
+ this.setRestrictedAutocompleteText = function(resultId, behavior) {
+ SetAutocompleteResultInline(resultId, behavior);
+ };
+ this.setValue = function(text, type) {
+ SetSuggestionReplace(text, type);
+ };
+ this.setRestrictedValue = function(resultId, behavior) {
+ SetAutocompleteResultReplace(resultId, behavior);
+ };
+ this.setNonNativeDropdownHeight = function(height) {
+ SetNonNativeDropdownHeight(height);
+ };
this.onchange = null;
this.onsubmit = null;
this.oncancel = null;
this.onresize = null;
+ this.onautocompleteresults = null;
+ this.onkeypress = null;
};
}

Powered by Google App Engine
This is Rietveld 408576698