OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 // This file contains various hacks needed to inform JSCompiler of various | 5 // This file contains various hacks needed to inform JSCompiler of various |
6 // WebKit- and Chrome-specific properties and methods. It is used only with | 6 // WebKit- and Chrome-specific properties and methods. It is used only with |
7 // JSCompiler to verify the type-correctness of our code. | 7 // JSCompiler to verify the type-correctness of our code. |
8 | 8 |
9 /** @type {HTMLElement} */ | 9 /** @type {HTMLElement} */ |
10 Document.prototype.activeElement; | 10 Document.prototype.activeElement; |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 | 97 |
98 /** @type {Object} */ | 98 /** @type {Object} */ |
99 chrome.experimental = {}; | 99 chrome.experimental = {}; |
100 | 100 |
101 /** @type {Object} */ | 101 /** @type {Object} */ |
102 chrome.experimental.identity = { | 102 chrome.experimental.identity = { |
103 /** | 103 /** |
104 * @param {Object.<string>} parameters | 104 * @param {Object.<string>} parameters |
105 * @param {function(string):void} callback | 105 * @param {function(string):void} callback |
106 */ | 106 */ |
107 getAuthToken: function(parameters, callback) {} | 107 getAuthToken: function(parameters, callback) {}, |
| 108 /** |
| 109 * @param {Object.<string>} parameters |
| 110 * @param {function(string):void} callback |
| 111 */ |
| 112 launchWebAuthFlow: function(parameters, callback) {} |
108 }; | 113 }; |
109 | 114 |
110 /** @constructor */ | 115 /** @constructor */ |
111 chrome.Event = function() {}; | 116 chrome.Event = function() {}; |
112 | 117 |
113 /** @param {function():void} callback */ | 118 /** @param {function():void} callback */ |
114 chrome.Event.prototype.addListener = function(callback) {}; | 119 chrome.Event.prototype.addListener = function(callback) {}; |
115 | 120 |
| 121 /** @param {function():void} callback */ |
| 122 chrome.Event.prototype.removeListener = function(callback) {}; |
| 123 |
116 /** @constructor */ | 124 /** @constructor */ |
117 chrome.extension.Port = function() {}; | 125 chrome.extension.Port = function() {}; |
118 | 126 |
119 /** @type {chrome.Event} */ | 127 /** @type {chrome.Event} */ |
120 chrome.extension.Port.prototype.onMessage; | 128 chrome.extension.Port.prototype.onMessage; |
121 | 129 |
122 /** @type {chrome.Event} */ | 130 /** @type {chrome.Event} */ |
123 chrome.extension.Port.prototype.onDisconnect; | 131 chrome.extension.Port.prototype.onDisconnect; |
124 | 132 |
125 /** | 133 /** |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
165 * @param {function(chrome.Window):void} callback */ | 173 * @param {function(chrome.Window):void} callback */ |
166 chrome.windows.get = function(id, getInfo, callback) {} | 174 chrome.windows.get = function(id, getInfo, callback) {} |
167 | 175 |
168 /** @constructor */ | 176 /** @constructor */ |
169 chrome.Window = function() { | 177 chrome.Window = function() { |
170 /** @type {string} */ | 178 /** @type {string} */ |
171 this.state = ''; | 179 this.state = ''; |
172 /** @type {string} */ | 180 /** @type {string} */ |
173 this.type = ''; | 181 this.type = ''; |
174 }; | 182 }; |
| 183 |
| 184 /** @param {string} message*/ |
| 185 chrome.extension.sendMessage = function(message) {} |
| 186 |
| 187 /** @type {chrome.Event} */ |
| 188 chrome.extension.onMessage; |
| 189 |
| 190 /** @type {Object} */ |
| 191 chrome.permissions = { |
| 192 /** |
| 193 * @param {Object.<string>} permissions |
| 194 * @param {function(boolean):void} callback |
| 195 */ |
| 196 contains: function(permissions, callback) {}, |
| 197 /** |
| 198 * @param {Object.<string>} permissions |
| 199 * @param {function(boolean):void} callback |
| 200 */ |
| 201 request: function(permissions, callback) {} |
| 202 }; |
OLD | NEW |