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 if (!chrome.searchBox) { | 8 if (!chrome.searchBox) { |
9 chrome.searchBox = new function() { | 9 chrome.searchBox = new function() { |
10 // ========================================================================= | 10 // ========================================================================= |
(...skipping 22 matching lines...) Expand all Loading... |
33 native function GetDisplayInstantResults(); | 33 native function GetDisplayInstantResults(); |
34 native function GetThemeBackgroundInfo(); | 34 native function GetThemeBackgroundInfo(); |
35 native function GetThemeAreaHeight(); | 35 native function GetThemeAreaHeight(); |
36 native function NavigateContentWindow(); | 36 native function NavigateContentWindow(); |
37 native function SetSuggestions(); | 37 native function SetSuggestions(); |
38 native function SetQuerySuggestion(); | 38 native function SetQuerySuggestion(); |
39 native function SetQuerySuggestionFromAutocompleteResult(); | 39 native function SetQuerySuggestionFromAutocompleteResult(); |
40 native function SetQuery(); | 40 native function SetQuery(); |
41 native function SetQueryFromAutocompleteResult(); | 41 native function SetQueryFromAutocompleteResult(); |
42 native function Show(); | 42 native function Show(); |
| 43 native function StartCapturingKeyStrokes(); |
| 44 native function StopCapturingKeyStrokes(); |
43 | 45 |
44 // Returns the |restrictedText| wrapped in a ShadowDOM. | 46 // Returns the |restrictedText| wrapped in a ShadowDOM. |
45 function SafeWrap(restrictedText) { | 47 function SafeWrap(restrictedText) { |
46 var node = document.createElement('div'); | 48 var node = document.createElement('div'); |
47 var nodeShadow = new WebKitShadowRoot(node); | 49 var nodeShadow = new WebKitShadowRoot(node); |
48 nodeShadow.applyAuthorStyles = true; | 50 nodeShadow.applyAuthorStyles = true; |
49 nodeShadow.innerHTML = | 51 nodeShadow.innerHTML = |
50 '<div style="width:700px!important;' + | 52 '<div style="width:700px!important;' + |
51 ' height:22px!important;' + | 53 ' height:22px!important;' + |
52 ' font-family:\'Chrome Droid Sans\',\'Arial\'!important;' + | 54 ' font-family:\'Chrome Droid Sans\',\'Arial\'!important;' + |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
198 }; | 200 }; |
199 this.show = function(reason, height) { | 201 this.show = function(reason, height) { |
200 Show(reason, height); | 202 Show(reason, height); |
201 }; | 203 }; |
202 this.markDuplicateSuggestions = function(clientSuggestions) { | 204 this.markDuplicateSuggestions = function(clientSuggestions) { |
203 return DedupeClientSuggestions(clientSuggestions); | 205 return DedupeClientSuggestions(clientSuggestions); |
204 }; | 206 }; |
205 this.navigateContentWindow = function(destination) { | 207 this.navigateContentWindow = function(destination) { |
206 return NavigateContentWindow(destination); | 208 return NavigateContentWindow(destination); |
207 }; | 209 }; |
| 210 this.startCapturingKeyStrokes = function() { |
| 211 StartCapturingKeyStrokes(); |
| 212 }; |
| 213 this.stopCapturingKeyStrokes = function() { |
| 214 StopCapturingKeyStrokes(); |
| 215 }; |
208 this.onchange = null; | 216 this.onchange = null; |
209 this.onsubmit = null; | 217 this.onsubmit = null; |
210 this.oncancel = null; | 218 this.oncancel = null; |
211 this.onresize = null; | 219 this.onresize = null; |
212 this.onautocompleteresults = null; | 220 this.onautocompleteresults = null; |
213 this.onkeypress = null; | 221 this.onkeypress = null; |
214 this.oncontextchange = null; | 222 this.oncontextchange = null; |
215 }; | 223 }; |
216 } | 224 } |
OLD | NEW |