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

Side by Side 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 var chrome; 5 var chrome;
6 if (!chrome) 6 if (!chrome)
7 chrome = {}; 7 chrome = {};
8 if (!chrome.searchBox) { 8 if (!chrome.searchBox) {
9 chrome.searchBox = new function() { 9 chrome.searchBox = new function() {
10 native function GetValue(); 10 native function GetValue();
11 native function GetVerbatim(); 11 native function GetVerbatim();
12 native function GetSelectionStart(); 12 native function GetSelectionStart();
13 native function GetSelectionEnd(); 13 native function GetSelectionEnd();
14 native function GetX(); 14 native function GetX();
15 native function GetY(); 15 native function GetY();
16 native function GetWidth(); 16 native function GetWidth();
17 native function GetHeight(); 17 native function GetHeight();
18 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.
19 native function GetKeyCode();
18 native function SetSuggestions(); 20 native function SetSuggestions();
21 native function SetSuggestionInline();
22 native function SetAutocompleteResultInline();
23 native function SetSuggestionReplace();
24 native function SetAutocompleteResultReplace();
25 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.
19 this.__defineGetter__('value', GetValue); 26 this.__defineGetter__('value', GetValue);
20 this.__defineGetter__('verbatim', GetVerbatim); 27 this.__defineGetter__('verbatim', GetVerbatim);
21 this.__defineGetter__('selectionStart', GetSelectionStart); 28 this.__defineGetter__('selectionStart', GetSelectionStart);
22 this.__defineGetter__('selectionEnd', GetSelectionEnd); 29 this.__defineGetter__('selectionEnd', GetSelectionEnd);
23 this.__defineGetter__('x', GetX); 30 this.__defineGetter__('x', GetX);
24 this.__defineGetter__('y', GetY); 31 this.__defineGetter__('y', GetY);
25 this.__defineGetter__('width', GetWidth); 32 this.__defineGetter__('width', GetWidth);
26 this.__defineGetter__('height', GetHeight); 33 this.__defineGetter__('height', GetHeight);
34 this.__defineGetter__('nativeSuggestions', GetAutocompleteResults);
35 this.__defineGetter__('keyCode', GetKeyCode);
27 this.setSuggestions = function(text) { 36 this.setSuggestions = function(text) {
28 SetSuggestions(text); 37 SetSuggestions(text);
29 }; 38 };
39 this.setAutocompleteText = function(text, behavior) {
40 SetSuggestionInline(text, behavior);
41 };
42 this.setRestrictedAutocompleteText = function(resultId, behavior) {
43 SetAutocompleteResultInline(resultId, behavior);
44 };
45 this.setValue = function(text, type) {
46 SetSuggestionReplace(text, type);
47 };
48 this.setRestrictedValue = function(resultId, behavior) {
49 SetAutocompleteResultReplace(resultId, behavior);
50 };
51 this.setNonNativeDropdownHeight = function(height) {
52 SetNonNativeDropdownHeight(height);
53 };
30 this.onchange = null; 54 this.onchange = null;
31 this.onsubmit = null; 55 this.onsubmit = null;
32 this.oncancel = null; 56 this.oncancel = null;
33 this.onresize = null; 57 this.onresize = null;
58 this.onautocompleteresults = null;
59 this.onkeypress = null;
34 }; 60 };
35 } 61 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698