| 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 'use strict'; | 5 'use strict'; |
| 6 | 6 |
| 7 // This hack prevents a bug on the cast extension. | 7 // This hack prevents a bug on the cast extension. |
| 8 // TODO(yoshiki): Remove this once the cast extension supports Chrome apps. | 8 // TODO(yoshiki): Remove this once the cast extension supports Chrome apps. |
| 9 // Although localStorage in Chrome app is not supported, but it's used in the | 9 // Although localStorage in Chrome app is not supported, but it's used in the |
| 10 // cast extension. This line prevents an exception on using localStorage. | 10 // cast extension. This line prevents an exception on using localStorage. |
| 11 window.__defineGetter__('localStorage', function() { return {}; }); | 11 window.__defineGetter__('localStorage', function() { return {}; }); |
| 12 | 12 |
| 13 // THIS IS A TEST APP. | 13 var APPLICATION_ID = '4CCB98DA'; |
| 14 // TODO(yoshiki): Fix this before launch. | |
| 15 var APPLICATION_ID = '214CC863'; | |
| 16 | 14 |
| 17 util.addPageLoadHandler(function() { | 15 util.addPageLoadHandler(function() { |
| 18 initialize(); | 16 initialize(); |
| 19 }.wrap()); | 17 }.wrap()); |
| 20 | 18 |
| 21 /** | 19 /** |
| 22 * Starts initialization of cast-related feature. | 20 * Starts initialization of cast-related feature. |
| 23 */ | 21 */ |
| 24 function initialize() { | 22 function initialize() { |
| 25 if (window.loadMockCastExtensionForTest) { | 23 if (window.loadMockCastExtensionForTest) { |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 } | 143 } |
| 146 | 144 |
| 147 player.setCastList(receivers); | 145 player.setCastList(receivers); |
| 148 } else if (availability == chrome.cast.ReceiverAvailability.UNAVAILABLE) { | 146 } else if (availability == chrome.cast.ReceiverAvailability.UNAVAILABLE) { |
| 149 player.setCastList([]); | 147 player.setCastList([]); |
| 150 } else { | 148 } else { |
| 151 console.error('Unexpected response in onReceiver.', arguments); | 149 console.error('Unexpected response in onReceiver.', arguments); |
| 152 player.setCastList([]); | 150 player.setCastList([]); |
| 153 } | 151 } |
| 154 } | 152 } |
| OLD | NEW |