OLD | NEW |
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 955 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
966 this.grid_.addEventListener('dragselectionend', dragEndBound); | 966 this.grid_.addEventListener('dragselectionend', dragEndBound); |
967 | 967 |
968 // TODO(mtomasz, yoshiki): Create navigation list earlier, and here just | 968 // TODO(mtomasz, yoshiki): Create navigation list earlier, and here just |
969 // attach the directory model. | 969 // attach the directory model. |
970 this.initNavigationList_(); | 970 this.initNavigationList_(); |
971 | 971 |
972 this.table_.addEventListener('column-resize-end', | 972 this.table_.addEventListener('column-resize-end', |
973 this.updateStartupPrefs_.bind(this)); | 973 this.updateStartupPrefs_.bind(this)); |
974 | 974 |
975 // Restore preferences. | 975 // Restore preferences. |
976 this.directoryModel_.sortFileList( | 976 this.directoryModel_.getFileList().sort( |
977 this.viewOptions_.sortField || 'modificationTime', | 977 this.viewOptions_.sortField || 'modificationTime', |
978 this.viewOptions_.sortDirection || 'desc'); | 978 this.viewOptions_.sortDirection || 'desc'); |
979 if (this.viewOptions_.columns) { | 979 if (this.viewOptions_.columns) { |
980 var cm = this.table_.columnModel; | 980 var cm = this.table_.columnModel; |
981 for (var i = 0; i < cm.totalSize; i++) { | 981 for (var i = 0; i < cm.totalSize; i++) { |
982 if (this.viewOptions_.columns[i] > 0) | 982 if (this.viewOptions_.columns[i] > 0) |
983 cm.setWidth(i, this.viewOptions_.columns[i]); | 983 cm.setWidth(i, this.viewOptions_.columns[i]); |
984 } | 984 } |
985 } | 985 } |
986 this.setListType(this.viewOptions_.listType || FileManager.ListType.DETAIL); | 986 this.setListType(this.viewOptions_.listType || FileManager.ListType.DETAIL); |
(...skipping 2706 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3693 callback(this.preferences_); | 3693 callback(this.preferences_); |
3694 return; | 3694 return; |
3695 } | 3695 } |
3696 | 3696 |
3697 chrome.fileBrowserPrivate.getPreferences(function(prefs) { | 3697 chrome.fileBrowserPrivate.getPreferences(function(prefs) { |
3698 this.preferences_ = prefs; | 3698 this.preferences_ = prefs; |
3699 callback(prefs); | 3699 callback(prefs); |
3700 }.bind(this)); | 3700 }.bind(this)); |
3701 }; | 3701 }; |
3702 })(); | 3702 })(); |
OLD | NEW |