| OLD | NEW |
| 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 // ========================================================================= | 10 // ========================================================================= |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 // ========================================================================= | 22 // ========================================================================= |
| 23 native function GetQuery(); | 23 native function GetQuery(); |
| 24 native function GetVerbatim(); | 24 native function GetVerbatim(); |
| 25 native function GetSelectionStart(); | 25 native function GetSelectionStart(); |
| 26 native function GetSelectionEnd(); | 26 native function GetSelectionEnd(); |
| 27 native function GetX(); | 27 native function GetX(); |
| 28 native function GetY(); | 28 native function GetY(); |
| 29 native function GetWidth(); | 29 native function GetWidth(); |
| 30 native function GetHeight(); | 30 native function GetHeight(); |
| 31 native function GetAutocompleteResults(); | 31 native function GetAutocompleteResults(); |
| 32 native function GetKeyCode(); | |
| 33 native function SetSuggestions(); | 32 native function SetSuggestions(); |
| 34 native function SetQuerySuggestion(); | 33 native function SetQuerySuggestion(); |
| 35 native function SetQuerySuggestionFromAutocompleteResult(); | 34 native function SetQuerySuggestionFromAutocompleteResult(); |
| 36 native function SetQuery(); | 35 native function SetQuery(); |
| 37 native function SetQueryFromAutocompleteResult(); | 36 native function SetQueryFromAutocompleteResult(); |
| 38 native function SetPreviewHeight(); | 37 native function SetPreviewHeight(); |
| 39 | 38 |
| 40 // Returns the |restrictedText| wrapped in a ShadowDOM. | 39 // Returns the |restrictedText| wrapped in a ShadowDOM. |
| 41 function SafeWrap(restrictedText) { | 40 function SafeWrap(restrictedText) { |
| 42 var node = document.createElement('div'); | 41 var node = document.createElement('div'); |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 // ========================================================================= | 148 // ========================================================================= |
| 150 this.__defineGetter__('value', GetQuery); | 149 this.__defineGetter__('value', GetQuery); |
| 151 this.__defineGetter__('verbatim', GetVerbatim); | 150 this.__defineGetter__('verbatim', GetVerbatim); |
| 152 this.__defineGetter__('selectionStart', GetSelectionStart); | 151 this.__defineGetter__('selectionStart', GetSelectionStart); |
| 153 this.__defineGetter__('selectionEnd', GetSelectionEnd); | 152 this.__defineGetter__('selectionEnd', GetSelectionEnd); |
| 154 this.__defineGetter__('x', GetX); | 153 this.__defineGetter__('x', GetX); |
| 155 this.__defineGetter__('y', GetY); | 154 this.__defineGetter__('y', GetY); |
| 156 this.__defineGetter__('width', GetWidth); | 155 this.__defineGetter__('width', GetWidth); |
| 157 this.__defineGetter__('height', GetHeight); | 156 this.__defineGetter__('height', GetHeight); |
| 158 this.__defineGetter__('nativeSuggestions', GetAutocompleteResultsWrapper); | 157 this.__defineGetter__('nativeSuggestions', GetAutocompleteResultsWrapper); |
| 159 this.__defineGetter__('keyCode', GetKeyCode); | |
| 160 this.setSuggestions = function(text) { | 158 this.setSuggestions = function(text) { |
| 161 SetSuggestions(text); | 159 SetSuggestions(text); |
| 162 }; | 160 }; |
| 163 this.setAutocompleteText = function(text, behavior) { | 161 this.setAutocompleteText = function(text, behavior) { |
| 164 SetQuerySuggestion(text, behavior); | 162 SetQuerySuggestion(text, behavior); |
| 165 }; | 163 }; |
| 166 this.setRestrictedAutocompleteText = function(resultId, behavior) { | 164 this.setRestrictedAutocompleteText = function(resultId, behavior) { |
| 167 SetQuerySuggestionFromAutocompleteResult(resultId, behavior); | 165 SetQuerySuggestionFromAutocompleteResult(resultId, behavior); |
| 168 }; | 166 }; |
| 169 this.setValue = function(text, type) { | 167 this.setValue = function(text, type) { |
| 170 SetQuery(text, type); | 168 SetQuery(text, type); |
| 171 }; | 169 }; |
| 172 this.setRestrictedValue = function(resultId, behavior) { | 170 this.setRestrictedValue = function(resultId, behavior) { |
| 173 SetQueryFromAutocompleteResult(resultId, behavior); | 171 SetQueryFromAutocompleteResult(resultId, behavior); |
| 174 }; | 172 }; |
| 175 this.setNonNativeDropdownHeight = function(height) { | 173 this.setNonNativeDropdownHeight = function(height) { |
| 176 SetPreviewHeight(height); | 174 SetPreviewHeight(height); |
| 177 }; | 175 }; |
| 178 this.markDuplicateSuggestions = function(clientSuggestions) { | 176 this.markDuplicateSuggestions = function(clientSuggestions) { |
| 179 return DedupeClientSuggestions(clientSuggestions); | 177 return DedupeClientSuggestions(clientSuggestions); |
| 180 }; | 178 }; |
| 181 this.onchange = null; | 179 this.onchange = null; |
| 182 this.onsubmit = null; | 180 this.onsubmit = null; |
| 183 this.oncancel = null; | 181 this.oncancel = null; |
| 184 this.onresize = null; | 182 this.onresize = null; |
| 185 this.onautocompleteresults = null; | 183 this.onautocompleteresults = null; |
| 186 this.onkeypress = null; | 184 this.onkeypress = null; |
| 187 }; | 185 }; |
| 188 } | 186 } |
| OLD | NEW |