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

Side by Side Diff: chrome/renderer/resources/extensions/searchbox_api.js

Issue 12047107: Change the SearchBox API from using the start/end margins of the location bar to using the start ma… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Don't run test on Mac & Linux Created 7 years, 9 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 | Annotate | Revision Log
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 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 8
9 if (!chrome.embeddedSearch) { 9 if (!chrome.embeddedSearch) {
10 chrome.embeddedSearch = new function() { 10 chrome.embeddedSearch = new function() {
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 var WWW_REGEX = /^www\./; 78 var WWW_REGEX = /^www\./;
79 79
80 // ======================================================================= 80 // =======================================================================
81 // Private functions 81 // Private functions
82 // ======================================================================= 82 // =======================================================================
83 native function GetQuery(); 83 native function GetQuery();
84 native function GetVerbatim(); 84 native function GetVerbatim();
85 native function GetSelectionStart(); 85 native function GetSelectionStart();
86 native function GetSelectionEnd(); 86 native function GetSelectionEnd();
87 native function GetStartMargin(); 87 native function GetStartMargin();
88 native function GetEndMargin();
89 native function GetRightToLeft(); 88 native function GetRightToLeft();
90 native function GetAutocompleteResults(); 89 native function GetAutocompleteResults();
91 native function GetDisplayInstantResults(); 90 native function GetDisplayInstantResults();
92 native function GetFontSize(); 91 native function GetFontSize();
93 native function IsKeyCaptureEnabled(); 92 native function IsKeyCaptureEnabled();
94 native function SetSuggestions(); 93 native function SetSuggestions();
95 native function SetQuerySuggestion(); 94 native function SetQuerySuggestion();
96 native function SetQuerySuggestionFromAutocompleteResult(); 95 native function SetQuerySuggestionFromAutocompleteResult();
97 native function SetQuery(); 96 native function SetQuery();
98 native function SetQueryFromAutocompleteResult(); 97 native function SetQueryFromAutocompleteResult();
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
216 } 215 }
217 216
218 // ======================================================================= 217 // =======================================================================
219 // Exported functions 218 // Exported functions
220 // ======================================================================= 219 // =======================================================================
221 this.__defineGetter__('value', GetQuery); 220 this.__defineGetter__('value', GetQuery);
222 this.__defineGetter__('verbatim', GetVerbatim); 221 this.__defineGetter__('verbatim', GetVerbatim);
223 this.__defineGetter__('selectionStart', GetSelectionStart); 222 this.__defineGetter__('selectionStart', GetSelectionStart);
224 this.__defineGetter__('selectionEnd', GetSelectionEnd); 223 this.__defineGetter__('selectionEnd', GetSelectionEnd);
225 this.__defineGetter__('startMargin', GetStartMargin); 224 this.__defineGetter__('startMargin', GetStartMargin);
226 this.__defineGetter__('endMargin', GetEndMargin);
227 this.__defineGetter__('rtl', GetRightToLeft); 225 this.__defineGetter__('rtl', GetRightToLeft);
228 this.__defineGetter__('nativeSuggestions', GetAutocompleteResultsWrapper); 226 this.__defineGetter__('nativeSuggestions', GetAutocompleteResultsWrapper);
229 this.__defineGetter__('isKeyCaptureEnabled', IsKeyCaptureEnabled); 227 this.__defineGetter__('isKeyCaptureEnabled', IsKeyCaptureEnabled);
230 this.__defineGetter__('displayInstantResults', GetDisplayInstantResults); 228 this.__defineGetter__('displayInstantResults', GetDisplayInstantResults);
231 this.__defineGetter__('font', GetFont); 229 this.__defineGetter__('font', GetFont);
232 this.__defineGetter__('fontSize', GetFontSize); 230 this.__defineGetter__('fontSize', GetFontSize);
233 231
234 this.setSuggestions = function(text) { 232 this.setSuggestions = function(text) {
235 SetSuggestions(text); 233 SetSuggestions(text);
236 }; 234 };
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
329 327
330 this.onmostvisitedchange = null; 328 this.onmostvisitedchange = null;
331 this.onthemechange = null; 329 this.onthemechange = null;
332 }; 330 };
333 331
334 // Export legacy searchbox API. 332 // Export legacy searchbox API.
335 // TODO: Remove this when Instant Extended is fully launched. 333 // TODO: Remove this when Instant Extended is fully launched.
336 chrome.searchBox = this.searchBox; 334 chrome.searchBox = this.searchBox;
337 }; 335 };
338 } 336 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/location_bar/location_bar_view.cc ('k') | chrome/renderer/searchbox/searchbox.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698