Index: chrome/browser/resources/file_manager/js/directory_model.js |
diff --git a/chrome/browser/resources/file_manager/js/directory_model.js b/chrome/browser/resources/file_manager/js/directory_model.js |
index e846acc7d00927fbdb94c42b39779673e0ffaf09..9a081cfe209ecae07c167ce911e18b44e89790ea 100644 |
--- a/chrome/browser/resources/file_manager/js/directory_model.js |
+++ b/chrome/browser/resources/file_manager/js/directory_model.js |
@@ -328,9 +328,14 @@ DirectoryModel.prototype = { |
}, |
/** |
- * Cancels waiting and scheduled rescans and starts new scan. |
+ * Cancels waiting and scheduled rescans and starts new scan. If the scan |
rginda
2012/03/15 17:42:09
I had been following python documentation guidelin
Rick Byers
2012/03/15 19:13:32
Thanks, Done. I agree that's better.
|
+ * completes successfully on the first attempt, the callback will be invoked |
+ * and a 'scan-completed' event will be dispatched. If the scan fails for |
+ * any reason, we'll periodically retry until it succeeds (and then send a |
+ * 'rescan-complete' event) or is cancelled or replaced by another scan. |
* |
- * @param {Function} callback Called when scan completed. |
+ * @param {Function} callback Called if scan completes on the first attempt. |
+ * Note that this will NOT be called if the scan fails but later succeeds. |
*/ |
scan_: function(callback) { |
if (this.rescanTimeout_) { |
@@ -497,9 +502,9 @@ DirectoryModel.prototype = { |
* changed. |
* |
* @param {DirectoryEntry} dirEntry The absolute path to the new directory. |
- * @param {function} action Action executed when the directory loaded. |
- * By default selects the first item |
- * (unless it's a save dialog). |
+ * @param {function} action Action executed if the directory loads |
+ * successfully. By default selects the first item (unless it's a save |
+ * dialog). |
* @param {boolean} initial True if it comes from setupPath and |
* false if caused by an user action. |
*/ |
@@ -528,7 +533,9 @@ DirectoryModel.prototype = { |
* |
* @param {string} path The root path to use |
* @param {Function=} opt_loadedCallback Invoked when the entire directory |
- * has been loaded and any default file selected. |
+ * has been loaded and any default file selected. If there are any |
+ * errors loading the directory this will not get called (even if the |
+ * directory loads OK on retry later). |
* @param {Function=} opt_pathResolveCallback Invoked as soon as the path has |
* been resolved, and called with the base and leaf portions of the path |
* name, and a flag indicating if the entry exists. |
@@ -597,7 +604,7 @@ DirectoryModel.prototype = { |
} else { |
// Well, we can't find the downloads dir. Let's just show something, |
// or we will get an infinite recursion. |
- this.changeDirectory('/', opt_loadedCallback, true); |
+ this.changeDirectoryEntry_(this.root_, opt_loadedCallback, true); |
} |
}.bind(this); |