| 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 GetQuery(); | |
| 17 native function GetSearchRequestParams(); | 16 native function GetSearchRequestParams(); |
| 18 native function GetRightToLeft(); | |
| 19 native function GetSuggestionToPrefetch(); | 17 native function GetSuggestionToPrefetch(); |
| 20 native function IsFocused(); | 18 native function IsFocused(); |
| 21 native function IsKeyCaptureEnabled(); | 19 native function IsKeyCaptureEnabled(); |
| 22 native function Paste(); | 20 native function Paste(); |
| 23 native function StartCapturingKeyStrokes(); | 21 native function StartCapturingKeyStrokes(); |
| 24 native function StopCapturingKeyStrokes(); | 22 native function StopCapturingKeyStrokes(); |
| 25 | 23 |
| 26 // ======================================================================= | 24 // ======================================================================= |
| 27 // Exported functions | 25 // Exported functions |
| 28 // ======================================================================= | 26 // ======================================================================= |
| 29 this.__defineGetter__('isFocused', IsFocused); | 27 this.__defineGetter__('isFocused', IsFocused); |
| 30 this.__defineGetter__('isKeyCaptureEnabled', IsKeyCaptureEnabled); | 28 this.__defineGetter__('isKeyCaptureEnabled', IsKeyCaptureEnabled); |
| 31 this.__defineGetter__('rtl', GetRightToLeft); | |
| 32 this.__defineGetter__('suggestion', GetSuggestionToPrefetch); | 29 this.__defineGetter__('suggestion', GetSuggestionToPrefetch); |
| 33 this.__defineGetter__('value', GetQuery); | |
| 34 Object.defineProperty(this, 'requestParams', | 30 Object.defineProperty(this, 'requestParams', |
| 35 { get: GetSearchRequestParams }); | 31 { get: GetSearchRequestParams }); |
| 36 | 32 |
| 37 this.paste = function(value) { | 33 this.paste = function(value) { |
| 38 Paste(value); | 34 Paste(value); |
| 39 }; | 35 }; |
| 40 | 36 |
| 41 this.startCapturingKeyStrokes = function() { | 37 this.startCapturingKeyStrokes = function() { |
| 42 StartCapturingKeyStrokes(); | 38 StartCapturingKeyStrokes(); |
| 43 }; | 39 }; |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 this.oninputcancel = null; | 144 this.oninputcancel = null; |
| 149 this.oninputstart = null; | 145 this.oninputstart = null; |
| 150 this.onmostvisitedchange = null; | 146 this.onmostvisitedchange = null; |
| 151 this.onthemechange = null; | 147 this.onthemechange = null; |
| 152 }; | 148 }; |
| 153 | 149 |
| 154 // TODO(jered): Remove when google no longer expects this object. | 150 // TODO(jered): Remove when google no longer expects this object. |
| 155 chrome.searchBox = this.searchBox; | 151 chrome.searchBox = this.searchBox; |
| 156 }; | 152 }; |
| 157 } | 153 } |
| OLD | NEW |