| 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(); | |
| 23 native function GetSuggestionToPrefetch(); | 22 native function GetSuggestionToPrefetch(); |
| 24 native function IsFocused(); | 23 native function IsFocused(); |
| 25 native function IsKeyCaptureEnabled(); | 24 native function IsKeyCaptureEnabled(); |
| 26 native function Paste(); | 25 native function Paste(); |
| 27 native function StartCapturingKeyStrokes(); | 26 native function StartCapturingKeyStrokes(); |
| 28 native function StopCapturingKeyStrokes(); | 27 native function StopCapturingKeyStrokes(); |
| 29 | 28 |
| 30 // ======================================================================= | 29 // ======================================================================= |
| 31 // Exported functions | 30 // Exported functions |
| 32 // ======================================================================= | 31 // ======================================================================= |
| 33 this.__defineGetter__('displayInstantResults', GetDisplayInstantResults); | 32 this.__defineGetter__('displayInstantResults', GetDisplayInstantResults); |
| 34 this.__defineGetter__('isFocused', IsFocused); | 33 this.__defineGetter__('isFocused', IsFocused); |
| 35 this.__defineGetter__('isKeyCaptureEnabled', IsKeyCaptureEnabled); | 34 this.__defineGetter__('isKeyCaptureEnabled', IsKeyCaptureEnabled); |
| 36 this.__defineGetter__('rtl', GetRightToLeft); | 35 this.__defineGetter__('rtl', GetRightToLeft); |
| 37 this.__defineGetter__('startMargin', GetStartMargin); | |
| 38 this.__defineGetter__('suggestion', GetSuggestionToPrefetch); | 36 this.__defineGetter__('suggestion', GetSuggestionToPrefetch); |
| 39 this.__defineGetter__('value', GetQuery); | 37 this.__defineGetter__('value', GetQuery); |
| 40 Object.defineProperty(this, 'requestParams', | 38 Object.defineProperty(this, 'requestParams', |
| 41 { get: GetSearchRequestParams }); | 39 { get: GetSearchRequestParams }); |
| 42 | 40 |
| 43 this.focus = function() { | 41 this.focus = function() { |
| 44 Focus(); | 42 Focus(); |
| 45 }; | 43 }; |
| 46 | 44 |
| 47 // This method is restricted to chrome-search://most-visited pages by | 45 // This method is restricted to chrome-search://most-visited pages by |
| (...skipping 23 matching lines...) Expand all Loading... |
| 71 this.startCapturingKeyStrokes = function() { | 69 this.startCapturingKeyStrokes = function() { |
| 72 StartCapturingKeyStrokes(); | 70 StartCapturingKeyStrokes(); |
| 73 }; | 71 }; |
| 74 | 72 |
| 75 this.stopCapturingKeyStrokes = function() { | 73 this.stopCapturingKeyStrokes = function() { |
| 76 StopCapturingKeyStrokes(); | 74 StopCapturingKeyStrokes(); |
| 77 }; | 75 }; |
| 78 | 76 |
| 79 this.onfocuschange = null; | 77 this.onfocuschange = null; |
| 80 this.onkeycapturechange = null; | 78 this.onkeycapturechange = null; |
| 81 this.onmarginchange = null; | |
| 82 this.onsubmit = null; | 79 this.onsubmit = null; |
| 83 this.onsuggestionchange = null; | 80 this.onsuggestionchange = null; |
| 84 | 81 |
| 85 //TODO(jered): Remove this empty method when google no longer requires it. | 82 //TODO(jered): Remove this empty method when google no longer requires it. |
| 86 this.setRestrictedValue = function() {}; | 83 this.setRestrictedValue = function() {}; |
| 87 }; | 84 }; |
| 88 | 85 |
| 89 this.newTabPage = new function() { | 86 this.newTabPage = new function() { |
| 90 | 87 |
| 91 // ======================================================================= | 88 // ======================================================================= |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 197 this.oninputcancel = null; | 194 this.oninputcancel = null; |
| 198 this.oninputstart = null; | 195 this.oninputstart = null; |
| 199 this.onmostvisitedchange = null; | 196 this.onmostvisitedchange = null; |
| 200 this.onthemechange = null; | 197 this.onthemechange = null; |
| 201 }; | 198 }; |
| 202 | 199 |
| 203 // TODO(jered): Remove when google no longer expects this object. | 200 // TODO(jered): Remove when google no longer expects this object. |
| 204 chrome.searchBox = this.searchBox; | 201 chrome.searchBox = this.searchBox; |
| 205 }; | 202 }; |
| 206 } | 203 } |
| OLD | NEW |