| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 /** | 5 /** |
| 6 * Discover the ID of installed cast extension. | 6 * Discover the ID of installed cast extension. |
| 7 * @constructor | 7 * @constructor |
| 8 * @struct | 8 * @struct |
| 9 */ | 9 */ |
| 10 function CastExtensionDiscoverer() {} | 10 function CastExtensionDiscoverer() {} |
| 11 | 11 |
| 12 /** | 12 /** |
| 13 * Tentatice IDs to try. | 13 * Tentatice IDs to try. |
| 14 * @type {!Array<string>} | 14 * @type {!Array<string>} |
| 15 * @const | 15 * @const |
| 16 */ | 16 */ |
| 17 CastExtensionDiscoverer.CAST_EXTENSION_IDS = [ | 17 CastExtensionDiscoverer.CAST_EXTENSION_IDS = [ |
| 18 'pkedcjkdefgpdelpbcmbmeomcjbeemfm', // MR official |
| 18 'boadgeojelhgndaghljhdicfkmllpafd', // release | 19 'boadgeojelhgndaghljhdicfkmllpafd', // release |
| 19 'dliochdbjfkdbacpmhlcpmleaejidimm', // beta | 20 'dliochdbjfkdbacpmhlcpmleaejidimm', // beta |
| 20 'hfaagokkkhdbgiakmmlclaapfelnkoah', | 21 'enhhojjnijigcajfphajepfemndkmdlo', // dev |
| 21 'fmfcbgogabcbclcofgocippekhfcmgfj', | 22 'fmfcbgogabcbclcofgocippekhfcmgfj', // staging |
| 22 'enhhojjnijigcajfphajepfemndkmdlo' | 23 'fjhoaacokmgbjemoflkofnenfaiekifl' // stable used during MR development. |
| 23 ]; | 24 ]; |
| 24 | 25 |
| 25 /** | 26 /** |
| 26 * @param {function(?string)} callback Callback called with the extension ID. | 27 * @param {function(?string)} callback Callback called with the extension ID. |
| 27 * The ID may be null if extension is not found. | 28 * The ID may be null if extension is not found. |
| 28 */ | 29 */ |
| 29 CastExtensionDiscoverer.findInstalledExtension = function(callback) { | 30 CastExtensionDiscoverer.findInstalledExtension = function(callback) { |
| 30 CastExtensionDiscoverer.findInstalledExtensionHelper_(0, callback); | 31 CastExtensionDiscoverer.findInstalledExtensionHelper_(0, callback); |
| 31 }; | 32 }; |
| 32 | 33 |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 xhr.onerror = function() { callback(false); }; | 72 xhr.onerror = function() { callback(false); }; |
| 72 /** @param {*} event */ | 73 /** @param {*} event */ |
| 73 xhr.onreadystatechange = function(event) { | 74 xhr.onreadystatechange = function(event) { |
| 74 if (xhr.readyState == 4 && xhr.status === 200) { | 75 if (xhr.readyState == 4 && xhr.status === 200) { |
| 75 // Cast extension found. | 76 // Cast extension found. |
| 76 callback(true); | 77 callback(true); |
| 77 } | 78 } |
| 78 }.wrap(this); | 79 }.wrap(this); |
| 79 xhr.send(); | 80 xhr.send(); |
| 80 }; | 81 }; |
| OLD | NEW |