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

Unified Diff: chrome/browser/resources/file_manager/foreground/js/file_manager.js

Issue 148193002: Removed most of path utility functions in Files app. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased. Created 6 years, 11 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/foreground/js/file_manager.js
diff --git a/chrome/browser/resources/file_manager/foreground/js/file_manager.js b/chrome/browser/resources/file_manager/foreground/js/file_manager.js
index 5dcac3aab04d473df6bacc59e7600f66e558443a..41dfcb6e0dc1b1e3c197c50585be49fea39e357f 100644
--- a/chrome/browser/resources/file_manager/foreground/js/file_manager.js
+++ b/chrome/browser/resources/file_manager/foreground/js/file_manager.js
@@ -1410,7 +1410,6 @@ var BOTTOM_MARGIN_FOR_PREVIEW_PANEL_PX = 52;
// Resolve the selectionURL to selectionEntry or to currentDirectoryEntry
// in case of being a display root.
queue.run(function(callback) {
- // TODO(mtomasz): Migrate to URLs, and stop calling resolveAbsoluteURL.
if (!this.initSelectionURL_) {
callback();
return;
@@ -1419,10 +1418,16 @@ var BOTTOM_MARGIN_FOR_PREVIEW_PANEL_PX = 52;
this.initSelectionURL_,
function(inEntry) {
var locationInfo = this.volumeManager_.getLocationInfo(inEntry);
+ // If location information is not available, then the volume is
+ // no longer (or never) available.
+ if (!locationInfo) {
+ callback();
+ return;
+ }
// If the selection is root, then use it as a current directory
// instead. This is because, selecting a root entry is done as
// opening it.
- if (locationInfo && locationInfo.isRootEntry)
+ if (locationInfo.isRootEntry)
nextCurrentDirEntry = inEntry;
else
selectionEntry = inEntry;
@@ -1439,9 +1444,14 @@ var BOTTOM_MARGIN_FOR_PREVIEW_PANEL_PX = 52;
webkitResolveLocalFileSystemURL(
this.initCurrentDirectoryURL_,
function(inEntry) {
+ var locationInfo = this.volumeManager_.getLocationInfo(inEntry);
+ if (!locationInfo) {
+ callback();
+ return;
+ }
nextCurrentDirEntry = inEntry;
callback();
- }, callback);
+ }.bind(this), callback);
// TODO(mtomasz): Implement reopening on special search, when fake
// entries are converted to directory providers.
}.bind(this));

Powered by Google App Engine
This is Rietveld 408576698