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() { |
11 this.searchBox = new function() { | 11 this.searchBox = new function() { |
12 | 12 |
13 // ======================================================================= | 13 // ======================================================================= |
14 // Private functions | 14 // Private functions |
15 // ======================================================================= | 15 // ======================================================================= |
16 native function Focus(); | 16 native function Focus(); |
17 native function GetDisplayInstantResults(); | 17 native function GetDisplayInstantResults(); |
18 native function GetMostVisitedItemData(); | 18 native function GetMostVisitedItemData(); |
19 native function GetQuery(); | 19 native function GetQuery(); |
20 native function GetSearchRequestParams(); | 20 native function GetSearchRequestParams(); |
21 native function GetRightToLeft(); | 21 native function GetRightToLeft(); |
22 native function GetStartMargin(); | 22 native function GetStartMargin(); |
23 native function GetSuggestionToPrefetch(); | 23 native function GetSuggestionToPrefetch(); |
24 native function IsFocused(); | 24 native function IsFocused(); |
25 native function IsKeyCaptureEnabled(); | 25 native function IsKeyCaptureEnabled(); |
26 native function Paste(); | 26 native function Paste(); |
| 27 native function SetVoiceSearchSupported(); |
27 native function StartCapturingKeyStrokes(); | 28 native function StartCapturingKeyStrokes(); |
28 native function StopCapturingKeyStrokes(); | 29 native function StopCapturingKeyStrokes(); |
29 | 30 |
30 // ======================================================================= | 31 // ======================================================================= |
31 // Exported functions | 32 // Exported functions |
32 // ======================================================================= | 33 // ======================================================================= |
33 this.__defineGetter__('displayInstantResults', GetDisplayInstantResults); | 34 this.__defineGetter__('displayInstantResults', GetDisplayInstantResults); |
34 this.__defineGetter__('isFocused', IsFocused); | 35 this.__defineGetter__('isFocused', IsFocused); |
35 this.__defineGetter__('isKeyCaptureEnabled', IsKeyCaptureEnabled); | 36 this.__defineGetter__('isKeyCaptureEnabled', IsKeyCaptureEnabled); |
36 this.__defineGetter__('rtl', GetRightToLeft); | 37 this.__defineGetter__('rtl', GetRightToLeft); |
(...skipping 24 matching lines...) Expand all Loading... |
61 sizeInPx + ",,,,/" + item.renderViewId + "/" + item.rid; | 62 sizeInPx + ",,,,/" + item.renderViewId + "/" + item.rid; |
62 } | 63 } |
63 } | 64 } |
64 return item; | 65 return item; |
65 }; | 66 }; |
66 | 67 |
67 this.paste = function(value) { | 68 this.paste = function(value) { |
68 Paste(value); | 69 Paste(value); |
69 }; | 70 }; |
70 | 71 |
| 72 this.setVoiceSearchSupported = function(supported) { |
| 73 SetVoiceSearchSupported(supported); |
| 74 }; |
| 75 |
71 this.startCapturingKeyStrokes = function() { | 76 this.startCapturingKeyStrokes = function() { |
72 StartCapturingKeyStrokes(); | 77 StartCapturingKeyStrokes(); |
73 }; | 78 }; |
74 | 79 |
75 this.stopCapturingKeyStrokes = function() { | 80 this.stopCapturingKeyStrokes = function() { |
76 StopCapturingKeyStrokes(); | 81 StopCapturingKeyStrokes(); |
77 }; | 82 }; |
78 | 83 |
79 this.onfocuschange = null; | 84 this.onfocuschange = null; |
80 this.onkeycapturechange = null; | 85 this.onkeycapturechange = null; |
81 this.onmarginchange = null; | 86 this.onmarginchange = null; |
82 this.onsubmit = null; | 87 this.onsubmit = null; |
83 this.onsuggestionchange = null; | 88 this.onsuggestionchange = null; |
| 89 this.ontogglevoicesearch = null; |
84 | 90 |
85 //TODO(jered): Remove this empty method when google no longer requires it. | 91 //TODO(jered): Remove this empty method when google no longer requires it. |
86 this.setRestrictedValue = function() {}; | 92 this.setRestrictedValue = function() {}; |
87 }; | 93 }; |
88 | 94 |
89 this.newTabPage = new function() { | 95 this.newTabPage = new function() { |
90 | 96 |
91 // ======================================================================= | 97 // ======================================================================= |
92 // Private functions | 98 // Private functions |
93 // ======================================================================= | 99 // ======================================================================= |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
197 this.oninputcancel = null; | 203 this.oninputcancel = null; |
198 this.oninputstart = null; | 204 this.oninputstart = null; |
199 this.onmostvisitedchange = null; | 205 this.onmostvisitedchange = null; |
200 this.onthemechange = null; | 206 this.onthemechange = null; |
201 }; | 207 }; |
202 | 208 |
203 // TODO(jered): Remove when google no longer expects this object. | 209 // TODO(jered): Remove when google no longer expects this object. |
204 chrome.searchBox = this.searchBox; | 210 chrome.searchBox = this.searchBox; |
205 }; | 211 }; |
206 } | 212 } |
OLD | NEW |