Chromium Code Reviews| 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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 48 native function GetAutocompleteResults(); | 48 native function GetAutocompleteResults(); |
| 49 native function GetDisplayInstantResults(); | 49 native function GetDisplayInstantResults(); |
| 50 native function GetFontSize(); | 50 native function GetFontSize(); |
| 51 native function IsFocused(); | 51 native function IsFocused(); |
| 52 native function IsKeyCaptureEnabled(); | 52 native function IsKeyCaptureEnabled(); |
| 53 native function SetQuery(); | 53 native function SetQuery(); |
| 54 native function SetQueryFromAutocompleteResult(); | 54 native function SetQueryFromAutocompleteResult(); |
| 55 native function SetSuggestion(); | 55 native function SetSuggestion(); |
| 56 native function SetSuggestionFromAutocompleteResult(); | 56 native function SetSuggestionFromAutocompleteResult(); |
| 57 native function SetSuggestions(); | 57 native function SetSuggestions(); |
| 58 native function SetVoiceSearchSupported(); | |
| 58 native function ShowOverlay(); | 59 native function ShowOverlay(); |
| 59 native function FocusOmnibox(); | 60 native function FocusOmnibox(); |
| 60 native function StartCapturingKeyStrokes(); | 61 native function StartCapturingKeyStrokes(); |
| 61 native function StopCapturingKeyStrokes(); | 62 native function StopCapturingKeyStrokes(); |
| 62 native function NavigateSearchBox(); | 63 native function NavigateSearchBox(); |
| 63 native function ShowBars(); | 64 native function ShowBars(); |
| 64 native function HideBars(); | 65 native function HideBars(); |
| 65 native function GetSuggestionData(); | 66 native function GetSuggestionData(); |
| 66 native function GetMostVisitedItemData(); | 67 native function GetMostVisitedItemData(); |
| 67 | 68 |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 174 | 175 |
| 175 // This method is restricted to chrome-search://most-visited pages by | 176 // This method is restricted to chrome-search://most-visited pages by |
| 176 // checking the invoking context's origin in searchbox_extension.cc. | 177 // checking the invoking context's origin in searchbox_extension.cc. |
| 177 this.getMostVisitedItemData = function(restrictedId) { | 178 this.getMostVisitedItemData = function(restrictedId) { |
| 178 return GetMostVisitedItemData(restrictedId); | 179 return GetMostVisitedItemData(restrictedId); |
| 179 }; | 180 }; |
| 180 | 181 |
| 181 this.setSuggestions = function(text) { | 182 this.setSuggestions = function(text) { |
| 182 SetSuggestions(text); | 183 SetSuggestions(text); |
| 183 }; | 184 }; |
| 185 this.setVoiceSearchSupported = function(supported) { | |
|
samarth
2013/06/19 05:39:20
nit: extra space
jeremycho
2013/06/19 20:11:34
Done.
| |
| 186 SetVoiceSearchSupported(supported); | |
| 187 }; | |
| 184 this.setAutocompleteText = function(text, behavior) { | 188 this.setAutocompleteText = function(text, behavior) { |
| 185 SetSuggestion(text, behavior); | 189 SetSuggestion(text, behavior); |
| 186 }; | 190 }; |
| 187 this.setRestrictedAutocompleteText = function(autocompleteResultId) { | 191 this.setRestrictedAutocompleteText = function(autocompleteResultId) { |
| 188 SetSuggestionFromAutocompleteResult(autocompleteResultId); | 192 SetSuggestionFromAutocompleteResult(autocompleteResultId); |
| 189 }; | 193 }; |
| 190 this.setValue = function(text, type) { | 194 this.setValue = function(text, type) { |
| 191 SetQuery(text, type); | 195 SetQuery(text, type); |
| 192 }; | 196 }; |
| 193 // Must access nativeSuggestions before calling setRestrictedValue. | 197 // Must access nativeSuggestions before calling setRestrictedValue. |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 292 this.onthemechange = null; | 296 this.onthemechange = null; |
| 293 this.oninputstart = null; | 297 this.oninputstart = null; |
| 294 this.oninputcancel = null; | 298 this.oninputcancel = null; |
| 295 }; | 299 }; |
| 296 | 300 |
| 297 // Export legacy searchbox API. | 301 // Export legacy searchbox API. |
| 298 // TODO: Remove this when Instant Extended is fully launched. | 302 // TODO: Remove this when Instant Extended is fully launched. |
| 299 chrome.searchBox = this.searchBox; | 303 chrome.searchBox = this.searchBox; |
| 300 }; | 304 }; |
| 301 } | 305 } |
| OLD | NEW |