| Index: ui/file_manager/video_player/js/cast/media_manager.js
|
| diff --git a/ui/file_manager/video_player/js/cast/media_manager.js b/ui/file_manager/video_player/js/cast/media_manager.js
|
| index 884c63985bebb25a0bd14c5182009274e12f7658..93b43b2e9f437f5d64c0bc46bc357acf11ba3b4e 100644
|
| --- a/ui/file_manager/video_player/js/cast/media_manager.js
|
| +++ b/ui/file_manager/video_player/js/cast/media_manager.js
|
| @@ -51,6 +51,10 @@ MediaManager.prototype.getToken = function(refresh) {
|
| // TODO(yoshiki): Creates the method to get a token and use it.
|
| chrome.fileBrowserPrivate.getDownloadUrl(this.entry_.toURL(), fulfill);
|
| }.bind(this)).then(function(url) {
|
| + if (chrome.runtime.lastError) {
|
| + return Promise.reject(
|
| + 'Token fetch failed: ' + chrome.runtime.lastError.message);
|
| + }
|
| if (!url)
|
| return Promise.reject('Token fetch failed.');
|
| var token = url.substring(url.indexOf('access_token=') + 13);
|
| @@ -76,6 +80,10 @@ MediaManager.prototype.getUrl = function() {
|
| // TODO(yoshiki): Creates the method to get a url and use it.
|
| chrome.fileBrowserPrivate.getDownloadUrl(this.entry_.toURL(), fulfill);
|
| }.bind(this)).then(function(url) {
|
| + if (chrome.runtime.lastError) {
|
| + return Promise.reject(
|
| + 'URL fetch failed: ' + chrome.runtime.lastError.message);
|
| + }
|
| if (!url)
|
| return Promise.reject('URL fetch failed.');
|
| var access_token_index = url.indexOf('access_token=');
|
|
|