Commit b52d73ab authored by mtomasz@chromium.org's avatar mtomasz@chromium.org

Remove fullPath from util.isSameEntry().

Full paths will not work after migrating to the separate file systems per volume. Therefore, for comparing urls should be used instead.

TEST=Tested manually, partly by browser_tests.
BUG=320967

Review URL: https://codereview.chromium.org/130263003

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@244102 0039d316-1c4b-4281-b951-d872f2087c98
parent 656de4e2
...@@ -42,25 +42,29 @@ function VolumeInfo( ...@@ -42,25 +42,29 @@ function VolumeInfo(
fullPath: RootDirectory.DRIVE + '/' + DriveSubRootDirectory.ROOT, fullPath: RootDirectory.DRIVE + '/' + DriveSubRootDirectory.ROOT,
isDirectory: true, isDirectory: true,
rootType: RootType.DRIVE, rootType: RootType.DRIVE,
label: PathUtil.getRootLabel(RootType.DRIVE) label: PathUtil.getRootLabel(RootType.DRIVE),
toURL: function() { return 'fake-entry://' + this.fullPath; }
}; };
this.fakeEntries[RootType.DRIVE_OFFLINE] = { this.fakeEntries[RootType.DRIVE_OFFLINE] = {
fullPath: RootDirectory.DRIVE_OFFLINE, fullPath: RootDirectory.DRIVE_OFFLINE,
isDirectory: true, isDirectory: true,
rootType: RootType.DRIVE_OFFLINE, rootType: RootType.DRIVE_OFFLINE,
label: PathUtil.getRootLabel(RootType.DRIVE_OFFLINE) label: PathUtil.getRootLabel(RootType.DRIVE_OFFLINE),
toURL: function() { return 'fake-entry://' + this.fullPath; }
}; };
this.fakeEntries[RootType.DRIVE_SHARED_WITH_ME] = { this.fakeEntries[RootType.DRIVE_SHARED_WITH_ME] = {
fullPath: RootDirectory.DRIVE_SHARED_WITH_ME, fullPath: RootDirectory.DRIVE_SHARED_WITH_ME,
isDirectory: true, isDirectory: true,
rootType: RootType.DRIVE_SHARED_WITH_ME, rootType: RootType.DRIVE_SHARED_WITH_ME,
label: PathUtil.getRootLabel(RootType.DRIVE_SHARED_WITH_ME) label: PathUtil.getRootLabel(RootType.DRIVE_SHARED_WITH_ME),
toURL: function() { return 'fake-entry://' + this.fullPath; }
}; };
this.fakeEntries[RootType.DRIVE_RECENT] = { this.fakeEntries[RootType.DRIVE_RECENT] = {
fullPath: RootDirectory.DRIVE_RECENT, fullPath: RootDirectory.DRIVE_RECENT,
isDirectory: true, isDirectory: true,
rootType: RootType.DRIVE_RECENT, rootType: RootType.DRIVE_RECENT,
label: PathUtil.getRootLabel(RootType.DRIVE_RECENT) label: PathUtil.getRootLabel(RootType.DRIVE_RECENT),
toURL: function() { return 'fake-entry://' + this.fullPath; }
}; };
} }
......
...@@ -1106,11 +1106,14 @@ util.createFileError = function(code) { ...@@ -1106,11 +1106,14 @@ util.createFileError = function(code) {
util.isSameEntry = function(entry1, entry2) { util.isSameEntry = function(entry1, entry2) {
// Currently, we can assume there is only one root. // Currently, we can assume there is only one root.
// When we support multi-file system, we need to look at filesystem, too. // When we support multi-file system, we need to look at filesystem, too.
return (entry1 && entry2 && entry1.fullPath === entry2.fullPath) || return (entry1 && entry2 && entry1.toURL() === entry2.toURL()) ||
(!entry1 && !entry2); (!entry1 && !entry2);
}; };
/** /**
* TODO(mtomasz, yoshiki): Deprecated. Only used in directory_tree.js. Will
* be removed soon.
*
* @param {Entry|Object} parent The parent entry. Can be a fake. * @param {Entry|Object} parent The parent entry. Can be a fake.
* @param {Entry|Object} child The child entry. Can be a fake. * @param {Entry|Object} child The child entry. Can be a fake.
* @return {boolean} True if parent entry is actualy the parent of the child * @return {boolean} True if parent entry is actualy the parent of the child
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment