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

Side by Side Diff: chrome/browser/resources/file_manager/foreground/js/file_manager.js

Issue 151413002: Files.app: Clean DirectoryModel. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 'use strict'; 5 'use strict';
6 6
7 /** 7 /**
8 * FileManager constructor. 8 * FileManager constructor.
9 * 9 *
10 * FileManager objects encapsulate the functionality of the file selector 10 * FileManager objects encapsulate the functionality of the file selector
(...skipping 960 matching lines...) Expand 10 before | Expand all | Expand 10 after
971 this.grid_.addEventListener('dragselectionend', dragEndBound); 971 this.grid_.addEventListener('dragselectionend', dragEndBound);
972 972
973 // TODO(mtomasz, yoshiki): Create navigation list earlier, and here just 973 // TODO(mtomasz, yoshiki): Create navigation list earlier, and here just
974 // attach the directory model. 974 // attach the directory model.
975 this.initNavigationList_(); 975 this.initNavigationList_();
976 976
977 this.table_.addEventListener('column-resize-end', 977 this.table_.addEventListener('column-resize-end',
978 this.updateStartupPrefs_.bind(this)); 978 this.updateStartupPrefs_.bind(this));
979 979
980 // Restore preferences. 980 // Restore preferences.
981 this.directoryModel_.sortFileList( 981 this.directoryModel_.getFileList().sort(
982 this.viewOptions_.sortField || 'modificationTime', 982 this.viewOptions_.sortField || 'modificationTime',
983 this.viewOptions_.sortDirection || 'desc'); 983 this.viewOptions_.sortDirection || 'desc');
984 if (this.viewOptions_.columns) { 984 if (this.viewOptions_.columns) {
985 var cm = this.table_.columnModel; 985 var cm = this.table_.columnModel;
986 for (var i = 0; i < cm.totalSize; i++) { 986 for (var i = 0; i < cm.totalSize; i++) {
987 if (this.viewOptions_.columns[i] > 0) 987 if (this.viewOptions_.columns[i] > 0)
988 cm.setWidth(i, this.viewOptions_.columns[i]); 988 cm.setWidth(i, this.viewOptions_.columns[i]);
989 } 989 }
990 } 990 }
991 this.setListType(this.viewOptions_.listType || FileManager.ListType.DETAIL); 991 this.setListType(this.viewOptions_.listType || FileManager.ListType.DETAIL);
(...skipping 2733 matching lines...) Expand 10 before | Expand all | Expand 10 after
3725 callback(this.preferences_); 3725 callback(this.preferences_);
3726 return; 3726 return;
3727 } 3727 }
3728 3728
3729 chrome.fileBrowserPrivate.getPreferences(function(prefs) { 3729 chrome.fileBrowserPrivate.getPreferences(function(prefs) {
3730 this.preferences_ = prefs; 3730 this.preferences_ = prefs;
3731 callback(prefs); 3731 callback(prefs);
3732 }.bind(this)); 3732 }.bind(this));
3733 }; 3733 };
3734 })(); 3734 })();
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698