| 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 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 222 // ======================================================================= | 223 // ======================================================================= |
| 223 // Exported functions | 224 // Exported functions |
| 224 // ======================================================================= | 225 // ======================================================================= |
| 225 this.__defineGetter__('value', GetQuery); | 226 this.__defineGetter__('value', GetQuery); |
| 226 this.__defineGetter__('verbatim', GetVerbatim); | 227 this.__defineGetter__('verbatim', GetVerbatim); |
| 227 this.__defineGetter__('selectionStart', GetSelectionStart); | 228 this.__defineGetter__('selectionStart', GetSelectionStart); |
| 228 this.__defineGetter__('selectionEnd', GetSelectionEnd); | 229 this.__defineGetter__('selectionEnd', GetSelectionEnd); |
| 229 this.__defineGetter__('startMargin', GetStartMargin); | 230 this.__defineGetter__('startMargin', GetStartMargin); |
| 230 this.__defineGetter__('rtl', GetRightToLeft); | 231 this.__defineGetter__('rtl', GetRightToLeft); |
| 231 this.__defineGetter__('nativeSuggestions', GetAutocompleteResultsWrapper); | 232 this.__defineGetter__('nativeSuggestions', GetAutocompleteResultsWrapper); |
| 233 this.__defineGetter__('isFocused', IsFocused); |
| 232 this.__defineGetter__('isKeyCaptureEnabled', IsKeyCaptureEnabled); | 234 this.__defineGetter__('isKeyCaptureEnabled', IsKeyCaptureEnabled); |
| 233 this.__defineGetter__('displayInstantResults', GetDisplayInstantResults); | 235 this.__defineGetter__('displayInstantResults', GetDisplayInstantResults); |
| 234 this.__defineGetter__('font', GetFont); | 236 this.__defineGetter__('font', GetFont); |
| 235 this.__defineGetter__('fontSize', GetFontSize); | 237 this.__defineGetter__('fontSize', GetFontSize); |
| 236 | 238 |
| 237 // This method is restricted to chrome-search://suggestion pages by | 239 // This method is restricted to chrome-search://suggestion pages by |
| 238 // checking the invoking context's origin in searchbox_extension.cc. | 240 // checking the invoking context's origin in searchbox_extension.cc. |
| 239 this.getSuggestionData = function(restrictedId) { | 241 this.getSuggestionData = function(restrictedId) { |
| 240 return GetSuggestionData(restrictedId); | 242 return GetSuggestionData(restrictedId); |
| 241 }; | 243 }; |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 288 }; | 290 }; |
| 289 this.onchange = null; | 291 this.onchange = null; |
| 290 this.onsubmit = null; | 292 this.onsubmit = null; |
| 291 this.oncancel = null; | 293 this.oncancel = null; |
| 292 this.onresize = null; | 294 this.onresize = null; |
| 293 this.onkeypress = null; | 295 this.onkeypress = null; |
| 294 this.onkeycapturechange = null; | 296 this.onkeycapturechange = null; |
| 295 this.onmarginchange = null; | 297 this.onmarginchange = null; |
| 296 this.onnativesuggestions = null; | 298 this.onnativesuggestions = null; |
| 297 this.onbarshidden = null; | 299 this.onbarshidden = null; |
| 300 this.onfocuschange = null; |
| 298 | 301 |
| 299 // DEPRECATED. These methods are from the legacy searchbox API. | 302 // DEPRECATED. These methods are from the legacy searchbox API. |
| 300 // TODO(jered): Delete these. | 303 // TODO(jered): Delete these. |
| 301 native function GetX(); | 304 native function GetX(); |
| 302 native function GetY(); | 305 native function GetY(); |
| 303 native function GetWidth(); | 306 native function GetWidth(); |
| 304 native function GetHeight(); | 307 native function GetHeight(); |
| 305 this.__defineGetter__('x', GetX); | 308 this.__defineGetter__('x', GetX); |
| 306 this.__defineGetter__('y', GetY); | 309 this.__defineGetter__('y', GetY); |
| 307 this.__defineGetter__('width', GetWidth); | 310 this.__defineGetter__('width', GetWidth); |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 364 | 367 |
| 365 this.onmostvisitedchange = null; | 368 this.onmostvisitedchange = null; |
| 366 this.onthemechange = null; | 369 this.onthemechange = null; |
| 367 }; | 370 }; |
| 368 | 371 |
| 369 // Export legacy searchbox API. | 372 // Export legacy searchbox API. |
| 370 // TODO: Remove this when Instant Extended is fully launched. | 373 // TODO: Remove this when Instant Extended is fully launched. |
| 371 chrome.searchBox = this.searchBox; | 374 chrome.searchBox = this.searchBox; |
| 372 }; | 375 }; |
| 373 } | 376 } |
| OLD | NEW |