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

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

Issue 22167002: Cleanup: Remove unnecessary property: VolumeList.currentVolume_ (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 4 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/file_manager/js/volume_list.js
diff --git a/chrome/browser/resources/file_manager/js/volume_list.js b/chrome/browser/resources/file_manager/js/volume_list.js
index e27301c40cd03e2753c286c7b83605a754dd77d1..f2cbc88aa4f6c6500ba6a703caa81aa6d7c41f14 100644
--- a/chrome/browser/resources/file_manager/js/volume_list.js
+++ b/chrome/browser/resources/file_manager/js/volume_list.js
@@ -186,8 +186,6 @@ VolumeList.prototype.decorate = function(directoryModel, pinnedFolderModel) {
'change', this.onSelectionChange_.bind(this));
this.selectionModel.addEventListener(
'beforeChange', this.onBeforeSelectionChange_.bind(this));
- this.currentVolume_ = null;
-
this.scrollBar_ = new ScrollBar();
this.scrollBar_.initialize(this.parentNode, this);
@@ -314,11 +312,10 @@ VolumeList.prototype.selectByIndex = function(index) {
return false;
var newPath = this.dataModel.item(index);
- if (!newPath || this.currentVolume_ == newPath)
+ if (!newPath || this.directoryModel.getCurrentDirEntry().fullPath == newPath)
mtomasz 2013/08/05 12:17:57 directoryModel -> directoryModel_
mtomasz 2013/08/05 12:17:57 I think this will not work as it should. getCurren
yoshiki 2013/08/05 16:08:01 Done.
yoshiki 2013/08/05 16:08:01 It should work. Previous code was wrong. Before i
mtomasz 2013/08/05 16:25:52 I see. My concern is that this check was used to a
return false;
- this.currentVolume_ = newPath;
- this.directoryModel_.changeDirectory(this.currentVolume_);
+ this.directoryModel_.changeDirectory(newPath);
return true;
};
@@ -355,10 +352,6 @@ VolumeList.prototype.onCurrentDirectoryChanged_ = function(event) {
var path = event.newDirEntry.fullPath || this.dataModel.getCurrentDirPath();
var newRootPath = PathUtil.getRootPath(path);
- // Sets |this.currentVolume_| in advance to prevent |onSelectionChange_()|
- // from calling |DirectoryModel.ChangeDirectory()| again.
- this.currentVolume_ = newRootPath;
-
// Synchronizes the volume list selection with the current directory, after
// it is changed outside of the volume list.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698