| 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 960 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 Loading... |
| 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 })(); |
| OLD | NEW |