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 {Object} */ | 9 /** @type {Object} */ |
10 var chrome = {}; | 10 var chrome = {}; |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 }; | 48 }; |
49 | 49 |
50 | 50 |
51 /** @type {Object} */ | 51 /** @type {Object} */ |
52 chrome.runtime = { | 52 chrome.runtime = { |
53 /** @type {Object} */ | 53 /** @type {Object} */ |
54 lastError: { | 54 lastError: { |
55 /** @type {string} */ | 55 /** @type {string} */ |
56 message: '' | 56 message: '' |
57 }, | 57 }, |
58 /** @return {{version: string, app: {background: Object}}} */ | 58 /** @type {string} */ |
| 59 id: '', |
| 60 /** @return {{name: string, version: string, app: {background: Object}}} */ |
59 getManifest: function() {}, | 61 getManifest: function() {}, |
| 62 /** @param {function(Window):void} callback */ |
| 63 getBackgroundPage: function(callback) {}, |
60 /** @type {chrome.Event} */ | 64 /** @type {chrome.Event} */ |
61 onSuspend: null, | 65 onSuspend: null, |
62 /** @type {chrome.Event} */ | 66 /** @type {chrome.Event} */ |
63 onSuspendCanceled: null, | 67 onSuspendCanceled: null, |
64 /** @type {chrome.Event} */ | 68 /** @type {chrome.Event} */ |
65 onConnect: null, | 69 onConnect: null, |
66 /** @type {chrome.Event} */ | 70 /** @type {chrome.Event} */ |
67 onConnectExternal: null, | 71 onConnectExternal: null, |
68 /** @type {chrome.Event} */ | 72 /** @type {chrome.Event} */ |
69 onMessage: null, | 73 onMessage: null, |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 /** @type {Object} */ | 142 /** @type {Object} */ |
139 chrome.i18n = {}; | 143 chrome.i18n = {}; |
140 | 144 |
141 /** | 145 /** |
142 * @param {string} messageName | 146 * @param {string} messageName |
143 * @param {(string|Array.<string>)=} opt_args | 147 * @param {(string|Array.<string>)=} opt_args |
144 * @return {string} | 148 * @return {string} |
145 */ | 149 */ |
146 chrome.i18n.getMessage = function(messageName, opt_args) {}; | 150 chrome.i18n.getMessage = function(messageName, opt_args) {}; |
147 | 151 |
| 152 /** |
| 153 * @return {string} |
| 154 */ |
| 155 chrome.i18n.getUILanguage = function() {}; |
| 156 |
148 | 157 |
149 /** @type {Object} */ | 158 /** @type {Object} */ |
150 chrome.storage = {}; | 159 chrome.storage = {}; |
151 | 160 |
152 /** @type {chrome.Storage} */ | 161 /** @type {chrome.Storage} */ |
153 chrome.storage.local; | 162 chrome.storage.local; |
154 | 163 |
155 /** @type {chrome.Storage} */ | 164 /** @type {chrome.Storage} */ |
156 chrome.storage.sync; | 165 chrome.storage.sync; |
157 | 166 |
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
352 /** @type {chrome.Event} */ | 361 /** @type {chrome.Event} */ |
353 this.onMaximized = null; | 362 this.onMaximized = null; |
354 /** @type {chrome.Event} */ | 363 /** @type {chrome.Event} */ |
355 this.onFullscreened = null; | 364 this.onFullscreened = null; |
356 /** @type {string} */ | 365 /** @type {string} */ |
357 this.id = ''; | 366 this.id = ''; |
358 }; | 367 }; |
359 | 368 |
360 AppWindow.prototype.close = function() {}; | 369 AppWindow.prototype.close = function() {}; |
361 AppWindow.prototype.drawAttention = function() {}; | 370 AppWindow.prototype.drawAttention = function() {}; |
| 371 AppWindow.prototype.focus = function() {}; |
362 AppWindow.prototype.maximize = function() {}; | 372 AppWindow.prototype.maximize = function() {}; |
363 AppWindow.prototype.minimize = function() {}; | 373 AppWindow.prototype.minimize = function() {}; |
364 AppWindow.prototype.restore = function() {}; | 374 AppWindow.prototype.restore = function() {}; |
365 AppWindow.prototype.show = function() {}; | 375 AppWindow.prototype.show = function() {}; |
| 376 /** @return {boolean} */ |
| 377 AppWindow.prototype.isMinimized = function() {}; |
366 AppWindow.prototype.fullscreen = function() {}; | 378 AppWindow.prototype.fullscreen = function() {}; |
367 /** @return {boolean} */ | 379 /** @return {boolean} */ |
368 AppWindow.prototype.isFullscreen = function() {}; | 380 AppWindow.prototype.isFullscreen = function() {}; |
369 /** @return {boolean} */ | 381 /** @return {boolean} */ |
370 AppWindow.prototype.isMaximized = function() {}; | 382 AppWindow.prototype.isMaximized = function() {}; |
371 | 383 |
372 /** | 384 /** |
373 * @param {{rects: Array.<ClientRect>}} rects | 385 * @param {{rects: Array.<ClientRect>}} rects |
374 */ | 386 */ |
375 AppWindow.prototype.setShape = function(rects) {}; | 387 AppWindow.prototype.setShape = function(rects) {}; |
(...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
670 * @param {number} socketId | 682 * @param {number} socketId |
671 */ | 683 */ |
672 chrome.socket.destroy = function(socketId) {}; | 684 chrome.socket.destroy = function(socketId) {}; |
673 | 685 |
674 /** | 686 /** |
675 * @param {number} socketId | 687 * @param {number} socketId |
676 * @param {Object} options | 688 * @param {Object} options |
677 * @param {function(number):void} callback | 689 * @param {function(number):void} callback |
678 */ | 690 */ |
679 chrome.socket.secure = function(socketId, options, callback) {}; | 691 chrome.socket.secure = function(socketId, options, callback) {}; |
OLD | NEW |