| 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 15 matching lines...) Expand all Loading... |
| 26 native function GetSelectionStart(); | 26 native function GetSelectionStart(); |
| 27 native function GetSelectionEnd(); | 27 native function GetSelectionEnd(); |
| 28 native function GetX(); | 28 native function GetX(); |
| 29 native function GetY(); | 29 native function GetY(); |
| 30 native function GetWidth(); | 30 native function GetWidth(); |
| 31 native function GetHeight(); | 31 native function GetHeight(); |
| 32 native function GetAutocompleteResults(); | 32 native function GetAutocompleteResults(); |
| 33 native function GetIsFocused(); | 33 native function GetIsFocused(); |
| 34 native function GetContext(); | 34 native function GetContext(); |
| 35 native function NavigateContentWindow(); | 35 native function NavigateContentWindow(); |
| 36 native function SetHasCustomLogo(); |
| 36 native function SetSuggestions(); | 37 native function SetSuggestions(); |
| 37 native function SetQuerySuggestion(); | 38 native function SetQuerySuggestion(); |
| 38 native function SetQuerySuggestionFromAutocompleteResult(); | 39 native function SetQuerySuggestionFromAutocompleteResult(); |
| 39 native function SetQuery(); | 40 native function SetQuery(); |
| 40 native function SetQueryFromAutocompleteResult(); | 41 native function SetQueryFromAutocompleteResult(); |
| 41 native function SetPreviewHeight(); | 42 native function SetPreviewHeight(); |
| 42 | 43 |
| 43 // Returns the |restrictedText| wrapped in a ShadowDOM. | 44 // Returns the |restrictedText| wrapped in a ShadowDOM. |
| 44 function SafeWrap(restrictedText) { | 45 function SafeWrap(restrictedText) { |
| 45 var node = document.createElement('div'); | 46 var node = document.createElement('div'); |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 189 }; | 190 }; |
| 190 this.setValue = function(text, type) { | 191 this.setValue = function(text, type) { |
| 191 SetQuery(text, type); | 192 SetQuery(text, type); |
| 192 }; | 193 }; |
| 193 this.setRestrictedValue = function(resultId, behavior) { | 194 this.setRestrictedValue = function(resultId, behavior) { |
| 194 SetQueryFromAutocompleteResult(resultId, behavior); | 195 SetQueryFromAutocompleteResult(resultId, behavior); |
| 195 }; | 196 }; |
| 196 this.setNonNativeDropdownHeight = function(height) { | 197 this.setNonNativeDropdownHeight = function(height) { |
| 197 SetPreviewHeight(height); | 198 SetPreviewHeight(height); |
| 198 }; | 199 }; |
| 200 this.setHasCustomLogo = function(hasLogo) { |
| 201 SetHasCustomLogo(hasLogo); |
| 202 }; |
| 199 this.markDuplicateSuggestions = function(clientSuggestions) { | 203 this.markDuplicateSuggestions = function(clientSuggestions) { |
| 200 return DedupeClientSuggestions(clientSuggestions); | 204 return DedupeClientSuggestions(clientSuggestions); |
| 201 }; | 205 }; |
| 202 this.navigateContentWindow = function(destination) { | 206 this.navigateContentWindow = function(destination) { |
| 203 return NavigateContentWindow(destination); | 207 return NavigateContentWindow(destination); |
| 204 }; | 208 }; |
| 205 this.onchange = null; | 209 this.onchange = null; |
| 206 this.onsubmit = null; | 210 this.onsubmit = null; |
| 207 this.oncancel = null; | 211 this.oncancel = null; |
| 208 this.onresize = null; | 212 this.onresize = null; |
| 209 this.onautocompleteresults = null; | 213 this.onautocompleteresults = null; |
| 210 this.onkeypress = null; | 214 this.onkeypress = null; |
| 211 this.onfocus = null; | 215 this.onfocus = null; |
| 212 this.onblur = null; | 216 this.onblur = null; |
| 213 this.oncontextchange = null; | 217 this.oncontextchange = null; |
| 214 }; | 218 }; |
| 215 } | 219 } |
| OLD | NEW |