// Fetches the access token and makes an authorized call. If refresh is true,
// then forces refreshing the access token.
var requestTokenAndCall = function(refresh, onInnerSuccess, onInnerFailure) {
- chrome.fileBrowserPrivate.requestAccessToken(refresh, function(token) {
+ chrome.fileManagerPrivate.requestAccessToken(refresh, function(token) {
if (this.aborted_)
return;
if (!token) {
}.bind(this);
// Do not request a token for local resources, since it is not necessary.
- if (url.indexOf('filesystem:') === 0) {
- this.xhr_ = AuthorizedXHR.load_(null, url, onMaybeSuccess, onMaybeFailure);
+ if (/^filesystem:/.test(url)) {
+ // The query parameter is workaround for
+ // crbug.com/379678, which force to obtain the latest contents of the image.
+ var noCacheUrl = url + '?nocache=' + Date.now();
+ this.xhr_ = AuthorizedXHR.load_(
+ null,
+ noCacheUrl,
+ onMaybeSuccess,
+ onMaybeFailure);
return;
}
* @private
*/
Request.prototype.sendImageData_ = function(data) {
- this.sendResponse_({status: 'success',
- data: data,
- taskId: this.request_.taskId});
+ this.sendResponse_(
+ {status: 'success', data: data, taskId: this.request_.taskId});
};
/**
* @private
*/
Request.prototype.onImageError_ = function(callback) {
- this.sendResponse_({status: 'error',
- taskId: this.request_.taskId});
+ this.sendResponse_(
+ {status: 'error', taskId: this.request_.taskId});
this.cleanup_();
this.downloadCallback_();
};