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 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
333 this.height = 0; | 333 this.height = 0; |
334 /** @type {number} */ | 334 /** @type {number} */ |
335 this.top = 0; | 335 this.top = 0; |
336 /** @type {number} */ | 336 /** @type {number} */ |
337 this.bottom = 0; | 337 this.bottom = 0; |
338 /** @type {number} */ | 338 /** @type {number} */ |
339 this.left = 0; | 339 this.left = 0; |
340 /** @type {number} */ | 340 /** @type {number} */ |
341 this.right = 0; | 341 this.right = 0; |
342 }; | 342 }; |
343 | |
344 /** @type {Object} */ | |
345 chrome.cast = {}; | |
346 | |
347 /** @constructor */ | |
348 chrome.cast.AutoJoinPolicy = function() {}; | |
349 | |
350 /** @type {chrome.cast.AutoJoinPolicy} */ | |
351 chrome.cast.AutoJoinPolicy.PAGE_SCOPED; | |
352 | |
353 /** @type {chrome.cast.AutoJoinPolicy} */ | |
354 chrome.cast.AutoJoinPolicy.ORIGIN_SCOPED; | |
355 | |
356 /** @type {chrome.cast.AutoJoinPolicy} */ | |
357 chrome.cast.AutoJoinPolicy.TAB_AND_ORIGIN_SCOPED; | |
358 | |
359 /** @constructor */ | |
360 chrome.cast.DefaultActionPolicy = function() {}; | |
361 | |
362 /** @type {chrome.cast.DefaultActionPolicy} */ | |
363 chrome.cast.DefaultActionPolicy.CAST_THIS_TAB; | |
364 | |
365 /** @type {chrome.cast.DefaultActionPolicy} */ | |
366 chrome.cast.DefaultActionPolicy.CREATE_SESSION; | |
Jamie
2014/08/13 23:21:04
AutoJoinPolicy, DefaultActionPolicy and ReceiverAv
aiguha
2014/08/15 07:09:56
They are, but I wasn't sure how to prototype those
| |
367 | |
368 /** @constructor */ | |
369 chrome.cast.Error = function() {}; | |
370 | |
371 /** @constructor */ | |
372 chrome.cast.ReceiverAvailability = function() {}; | |
373 | |
374 /** @type {chrome.cast.ReceiverAvailability} */ | |
375 chrome.cast.ReceiverAvailability.AVAILABLE; | |
376 | |
377 /** @type {chrome.cast.ReceiverAvailability} */ | |
378 chrome.cast.ReceiverAvailability.UNAVAILABLE; | |
379 | |
380 /** @type {Object} */ | |
381 chrome.cast.media = {}; | |
382 | |
383 /** @constructor */ | |
384 chrome.cast.media.Media = function() { | |
385 /** @type {number} */ | |
386 this.mediaSessionId = 0; | |
387 }; | |
388 | |
389 /** @constructor */ | |
390 chrome.cast.Session = function() { | |
391 /** @type {Array.<chrome.cast.media.Media>} */ | |
392 this.media = []; | |
393 | |
394 /** @type {string} */ | |
395 this.sessionId = ''; | |
396 }; | |
397 | |
398 /** | |
399 * @param {string} namespace | |
400 * @param {Object} message | |
401 * @param {function():void} successCallback | |
402 * @param {function(chrome.cast.Error):void} errorCallback | |
403 */ | |
404 chrome.cast.Session.prototype.sendMessage = | |
405 function(namespace, message, successCallback, errorCallback) {}; | |
406 | |
407 /** | |
408 * @param {function(chrome.cast.media.Media):void} listener | |
409 */ | |
410 chrome.cast.Session.prototype.addMediaListener = function(listener) {}; | |
411 | |
412 /** | |
413 * @param {function(boolean):void} listener | |
414 */ | |
415 chrome.cast.Session.prototype.addUpdateListener = function(listener) {}; | |
416 | |
417 /** | |
418 * @param {string} namespace | |
419 * @param {function(chrome.cast.media.Media):void} listener | |
420 */ | |
421 chrome.cast.Session.prototype.addMessageListener = | |
422 function(namespace, listener){}; | |
423 | |
424 /** | |
425 * @param {function():void} successCallback | |
426 * @param {function(chrome.cast.Error):void} errorCallback | |
427 */ | |
428 chrome.cast.Session.prototype.stop = | |
429 function(successCallback, errorCallback) {}; | |
430 | |
431 /** | |
432 * @constructor | |
433 * @param {string} applicationID | |
434 */ | |
435 chrome.cast.SessionRequest = function(applicationID) {}; | |
436 | |
437 /** | |
438 * @constructor | |
439 * @param {chrome.cast.SessionRequest} sessionRequest | |
440 * @param {function(chrome.cast.Session):void} sessionListener | |
441 * @param {function(chrome.cast.ReceiverAvailability):void} receiverListener | |
442 * @param {chrome.cast.AutoJoinPolicy=} opt_autoJoinPolicy | |
443 * @param {chrome.cast.DefaultActionPolicy=} opt_defaultActionPolicy | |
444 */ | |
445 chrome.cast.ApiConfig = function(sessionRequest, | |
446 sessionListener, | |
447 receiverListener, | |
448 opt_autoJoinPolicy, | |
449 opt_defaultActionPolicy) {}; | |
450 | |
451 /** | |
452 * @param {chrome.cast.ApiConfig} apiConfig | |
453 * @param {function():void} onInitSuccess | |
454 * @param {function(chrome.cast.Error):void} onInitError | |
455 */ | |
456 chrome.cast.initialize = | |
457 function(apiConfig, onInitSuccess, onInitError) {}; | |
458 | |
459 /** | |
460 * @param {function(chrome.cast.Session):void} successCallback | |
461 * @param {function(chrome.cast.Error):void} errorCallback | |
462 */ | |
463 chrome.cast.requestSession = | |
464 function(successCallback, errorCallback) {}; | |
465 | |
OLD | NEW |