| OLD | NEW |
| 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 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 // ======================================================================= | 87 // ======================================================================= |
| 88 native function GetQuery(); | 88 native function GetQuery(); |
| 89 native function GetVerbatim(); | 89 native function GetVerbatim(); |
| 90 native function GetSelectionStart(); | 90 native function GetSelectionStart(); |
| 91 native function GetSelectionEnd(); | 91 native function GetSelectionEnd(); |
| 92 native function GetStartMargin(); | 92 native function GetStartMargin(); |
| 93 native function GetRightToLeft(); | 93 native function GetRightToLeft(); |
| 94 native function GetAutocompleteResults(); | 94 native function GetAutocompleteResults(); |
| 95 native function GetDisplayInstantResults(); | 95 native function GetDisplayInstantResults(); |
| 96 native function GetFontSize(); | 96 native function GetFontSize(); |
| 97 native function IsFocused(); |
| 97 native function IsKeyCaptureEnabled(); | 98 native function IsKeyCaptureEnabled(); |
| 98 native function SetQuery(); | 99 native function SetQuery(); |
| 99 native function SetQueryFromAutocompleteResult(); | 100 native function SetQueryFromAutocompleteResult(); |
| 100 native function SetSuggestion(); | 101 native function SetSuggestion(); |
| 101 native function SetSuggestionFromAutocompleteResult(); | 102 native function SetSuggestionFromAutocompleteResult(); |
| 102 native function SetSuggestions(); | 103 native function SetSuggestions(); |
| 103 native function ShowOverlay(); | 104 native function ShowOverlay(); |
| 104 native function FocusOmnibox(); | 105 native function FocusOmnibox(); |
| 105 native function StartCapturingKeyStrokes(); | 106 native function StartCapturingKeyStrokes(); |
| 106 native function StopCapturingKeyStrokes(); | 107 native function StopCapturingKeyStrokes(); |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 221 // ======================================================================= | 222 // ======================================================================= |
| 222 // Exported functions | 223 // Exported functions |
| 223 // ======================================================================= | 224 // ======================================================================= |
| 224 this.__defineGetter__('value', GetQuery); | 225 this.__defineGetter__('value', GetQuery); |
| 225 this.__defineGetter__('verbatim', GetVerbatim); | 226 this.__defineGetter__('verbatim', GetVerbatim); |
| 226 this.__defineGetter__('selectionStart', GetSelectionStart); | 227 this.__defineGetter__('selectionStart', GetSelectionStart); |
| 227 this.__defineGetter__('selectionEnd', GetSelectionEnd); | 228 this.__defineGetter__('selectionEnd', GetSelectionEnd); |
| 228 this.__defineGetter__('startMargin', GetStartMargin); | 229 this.__defineGetter__('startMargin', GetStartMargin); |
| 229 this.__defineGetter__('rtl', GetRightToLeft); | 230 this.__defineGetter__('rtl', GetRightToLeft); |
| 230 this.__defineGetter__('nativeSuggestions', GetAutocompleteResultsWrapper); | 231 this.__defineGetter__('nativeSuggestions', GetAutocompleteResultsWrapper); |
| 232 this.__defineGetter__('isFocused', IsFocused); |
| 231 this.__defineGetter__('isKeyCaptureEnabled', IsKeyCaptureEnabled); | 233 this.__defineGetter__('isKeyCaptureEnabled', IsKeyCaptureEnabled); |
| 232 this.__defineGetter__('displayInstantResults', GetDisplayInstantResults); | 234 this.__defineGetter__('displayInstantResults', GetDisplayInstantResults); |
| 233 this.__defineGetter__('font', GetFont); | 235 this.__defineGetter__('font', GetFont); |
| 234 this.__defineGetter__('fontSize', GetFontSize); | 236 this.__defineGetter__('fontSize', GetFontSize); |
| 235 | 237 |
| 236 // This method is restricted to chrome-search://suggestion pages by | 238 // This method is restricted to chrome-search://suggestion pages by |
| 237 // checking the invoking context's origin in searchbox_extension.cc. | 239 // checking the invoking context's origin in searchbox_extension.cc. |
| 238 this.getSuggestionData = function(restrictedId) { | 240 this.getSuggestionData = function(restrictedId) { |
| 239 return GetSuggestionData(restrictedId); | 241 return GetSuggestionData(restrictedId); |
| 240 }; | 242 }; |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 287 }; | 289 }; |
| 288 this.onchange = null; | 290 this.onchange = null; |
| 289 this.onsubmit = null; | 291 this.onsubmit = null; |
| 290 this.oncancel = null; | 292 this.oncancel = null; |
| 291 this.onresize = null; | 293 this.onresize = null; |
| 292 this.onkeypress = null; | 294 this.onkeypress = null; |
| 293 this.onkeycapturechange = null; | 295 this.onkeycapturechange = null; |
| 294 this.onmarginchange = null; | 296 this.onmarginchange = null; |
| 295 this.onnativesuggestions = null; | 297 this.onnativesuggestions = null; |
| 296 this.onbarshidden = null; | 298 this.onbarshidden = null; |
| 299 this.onfocuschange = null; |
| 297 | 300 |
| 298 // DEPRECATED. These methods are from the legacy searchbox API. | 301 // DEPRECATED. These methods are from the legacy searchbox API. |
| 299 // TODO(jered): Delete these. | 302 // TODO(jered): Delete these. |
| 300 native function GetX(); | 303 native function GetX(); |
| 301 native function GetY(); | 304 native function GetY(); |
| 302 native function GetWidth(); | 305 native function GetWidth(); |
| 303 native function GetHeight(); | 306 native function GetHeight(); |
| 304 this.__defineGetter__('x', GetX); | 307 this.__defineGetter__('x', GetX); |
| 305 this.__defineGetter__('y', GetY); | 308 this.__defineGetter__('y', GetY); |
| 306 this.__defineGetter__('width', GetWidth); | 309 this.__defineGetter__('width', GetWidth); |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 359 | 362 |
| 360 this.onmostvisitedchange = null; | 363 this.onmostvisitedchange = null; |
| 361 this.onthemechange = null; | 364 this.onthemechange = null; |
| 362 }; | 365 }; |
| 363 | 366 |
| 364 // Export legacy searchbox API. | 367 // Export legacy searchbox API. |
| 365 // TODO: Remove this when Instant Extended is fully launched. | 368 // TODO: Remove this when Instant Extended is fully launched. |
| 366 chrome.searchBox = this.searchBox; | 369 chrome.searchBox = this.searchBox; |
| 367 }; | 370 }; |
| 368 } | 371 } |
| OLD | NEW |