Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1837)

Unified Diff: chrome/browser/resources/file_manager/common/js/util.js

Issue 163083002: Files.app: Show error messages for the case the source file is not exists. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed. Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/resources/file_manager/common/js/util.js
diff --git a/chrome/browser/resources/file_manager/common/js/util.js b/chrome/browser/resources/file_manager/common/js/util.js
index afc29fabf76880fe322c7b0836f3eddb53122fc5..c057c6f60e52f586ec9714c38060a34b328828f8 100644
--- a/chrome/browser/resources/file_manager/common/js/util.js
+++ b/chrome/browser/resources/file_manager/common/js/util.js
@@ -1148,11 +1148,12 @@ util.entriesToURLs = function(entries) {
* Converts array of URLs to an array of corresponding Entries.
*
* @param {Array.<string>} urls Input array of URLs.
- * @param {function(Array.<Entry>)} callback Completion callback with array of
- * Entries.
+ * @param {function(Array.<Entry>, Array.<URL>)} callback Completion callback
+ * with array of success Entries and failure URLs.
*/
util.URLsToEntries = function(urls, callback) {
var result = [];
+ var failureUrl = [];
AsyncUtil.forEach(
urls,
function(forEachCallback, url) {
@@ -1162,12 +1163,11 @@ util.URLsToEntries = function(urls, callback) {
}, function() {
// Not an error. Possibly, the file is not accessible anymore.
console.warn('Failed to resolve the file with url: ' + url + '.');
+ failureUrl.push(url);
forEachCallback();
});
},
- function() {
- callback(result);
- });
+ callback.bind(null, result, failureUrl));
};
/**

Powered by Google App Engine
This is Rietveld 408576698