| 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 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 native function SetSuggestions(); | 98 native function SetSuggestions(); |
| 99 native function SetQuerySuggestion(); | 99 native function SetQuerySuggestion(); |
| 100 native function SetQuerySuggestionFromAutocompleteResult(); | 100 native function SetQuerySuggestionFromAutocompleteResult(); |
| 101 native function SetQuery(); | 101 native function SetQuery(); |
| 102 native function SetQueryFromAutocompleteResult(); | 102 native function SetQueryFromAutocompleteResult(); |
| 103 native function ShowOverlay(); | 103 native function ShowOverlay(); |
| 104 native function FocusOmnibox(); | 104 native function FocusOmnibox(); |
| 105 native function StartCapturingKeyStrokes(); | 105 native function StartCapturingKeyStrokes(); |
| 106 native function StopCapturingKeyStrokes(); | 106 native function StopCapturingKeyStrokes(); |
| 107 native function NavigateSearchBox(); | 107 native function NavigateSearchBox(); |
| 108 native function ShowBars(); |
| 109 native function HideBars(); |
| 108 | 110 |
| 109 function SafeWrapSuggestion(restrictedText) { | 111 function SafeWrapSuggestion(restrictedText) { |
| 110 return SafeWrap(restrictedText, window.innerWidth - 155, 22); | 112 return SafeWrap(restrictedText, window.innerWidth - 155, 22); |
| 111 } | 113 } |
| 112 | 114 |
| 113 // Wraps the AutocompleteResult query and URL into ShadowDOM nodes so that | 115 // Wraps the AutocompleteResult query and URL into ShadowDOM nodes so that |
| 114 // the JS cannot access them and deletes the raw values. | 116 // the JS cannot access them and deletes the raw values. |
| 115 function GetAutocompleteResultsWrapper() { | 117 function GetAutocompleteResultsWrapper() { |
| 116 var autocompleteResults = DedupeAutocompleteResults( | 118 var autocompleteResults = DedupeAutocompleteResults( |
| 117 GetAutocompleteResults()); | 119 GetAutocompleteResults()); |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 265 }; | 267 }; |
| 266 this.startCapturingKeyStrokes = function() { | 268 this.startCapturingKeyStrokes = function() { |
| 267 StartCapturingKeyStrokes(); | 269 StartCapturingKeyStrokes(); |
| 268 }; | 270 }; |
| 269 this.stopCapturingKeyStrokes = function() { | 271 this.stopCapturingKeyStrokes = function() { |
| 270 StopCapturingKeyStrokes(); | 272 StopCapturingKeyStrokes(); |
| 271 }; | 273 }; |
| 272 this.navigateContentWindow = function(destination, disposition) { | 274 this.navigateContentWindow = function(destination, disposition) { |
| 273 NavigateSearchBox(destination, disposition); | 275 NavigateSearchBox(destination, disposition); |
| 274 } | 276 } |
| 277 this.showBars = function() { |
| 278 ShowBars(); |
| 279 }; |
| 280 this.hideBars = function() { |
| 281 HideBars(); |
| 282 }; |
| 275 this.onchange = null; | 283 this.onchange = null; |
| 276 this.onsubmit = null; | 284 this.onsubmit = null; |
| 277 this.oncancel = null; | 285 this.oncancel = null; |
| 278 this.onresize = null; | 286 this.onresize = null; |
| 279 this.onkeypress = null; | 287 this.onkeypress = null; |
| 280 this.onkeycapturechange = null; | 288 this.onkeycapturechange = null; |
| 281 this.oncontextchange = null; | 289 this.oncontextchange = null; |
| 282 this.onmarginchange = null; | 290 this.onmarginchange = null; |
| 283 this.onnativesuggestions = null; | 291 this.onnativesuggestions = null; |
| 292 this.onbarshidden = null; |
| 284 | 293 |
| 285 // DEPRECATED. These methods are from the legacy searchbox API. | 294 // DEPRECATED. These methods are from the legacy searchbox API. |
| 286 // TODO(jered): Delete these. | 295 // TODO(jered): Delete these. |
| 287 native function GetX(); | 296 native function GetX(); |
| 288 native function GetY(); | 297 native function GetY(); |
| 289 native function GetWidth(); | 298 native function GetWidth(); |
| 290 native function GetHeight(); | 299 native function GetHeight(); |
| 291 this.__defineGetter__('x', GetX); | 300 this.__defineGetter__('x', GetX); |
| 292 this.__defineGetter__('y', GetY); | 301 this.__defineGetter__('y', GetY); |
| 293 this.__defineGetter__('width', GetWidth); | 302 this.__defineGetter__('width', GetWidth); |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 345 | 354 |
| 346 this.onmostvisitedchange = null; | 355 this.onmostvisitedchange = null; |
| 347 this.onthemechange = null; | 356 this.onthemechange = null; |
| 348 }; | 357 }; |
| 349 | 358 |
| 350 // Export legacy searchbox API. | 359 // Export legacy searchbox API. |
| 351 // TODO: Remove this when Instant Extended is fully launched. | 360 // TODO: Remove this when Instant Extended is fully launched. |
| 352 chrome.searchBox = this.searchBox; | 361 chrome.searchBox = this.searchBox; |
| 353 }; | 362 }; |
| 354 } | 363 } |
| OLD | NEW |