| 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 // Setting the src of an img to an empty string can crash the browser, so we | 5 // Setting the src of an img to an empty string can crash the browser, so we |
| 6 // use an empty 1x1 gif instead. | 6 // use an empty 1x1 gif instead. |
| 7 | 7 |
| 8 /** | 8 /** |
| 9 * FileManager constructor. | 9 * FileManager constructor. |
| 10 * | 10 * |
| (...skipping 1134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1145 (this.dialogType_ == FileManager.DialogType.SELECT_SAVEAS_FILE || | 1145 (this.dialogType_ == FileManager.DialogType.SELECT_SAVEAS_FILE || |
| 1146 this.dialogType_ == FileManager.DialogType.FULL_PAGE); | 1146 this.dialogType_ == FileManager.DialogType.FULL_PAGE); |
| 1147 | 1147 |
| 1148 case 'unmount': | 1148 case 'unmount': |
| 1149 return true; | 1149 return true; |
| 1150 | 1150 |
| 1151 case 'format': | 1151 case 'format': |
| 1152 var entry = | 1152 var entry = |
| 1153 this.getRootEntry_(this.rootsList_.selectionModel.selectedIndex); | 1153 this.getRootEntry_(this.rootsList_.selectionModel.selectedIndex); |
| 1154 | 1154 |
| 1155 return DirectoryModel.getRootType(entry.fullPath) == | 1155 return entry && DirectoryModel.getRootType(entry.fullPath) == |
| 1156 DirectoryModel.RootType.REMOVABLE; | 1156 DirectoryModel.RootType.REMOVABLE; |
| 1157 } | 1157 } |
| 1158 }; | 1158 }; |
| 1159 | 1159 |
| 1160 FileManager.prototype.getRootEntry_ = function(index) { | 1160 FileManager.prototype.getRootEntry_ = function(index) { |
| 1161 if (index == -1) | 1161 if (index == -1) |
| 1162 return null; | 1162 return null; |
| 1163 | 1163 |
| 1164 return this.rootsList_.dataModel.item(index); | 1164 return this.rootsList_.dataModel.item(index); |
| 1165 }; | 1165 }; |
| 1166 | 1166 |
| (...skipping 2982 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4149 }); | 4149 }); |
| 4150 }, onError); | 4150 }, onError); |
| 4151 | 4151 |
| 4152 function onError(err) { | 4152 function onError(err) { |
| 4153 console.log('Error while checking free space: ' + err); | 4153 console.log('Error while checking free space: ' + err); |
| 4154 setTimeout(doCheck, 1000 * 60); | 4154 setTimeout(doCheck, 1000 * 60); |
| 4155 } | 4155 } |
| 4156 } | 4156 } |
| 4157 } | 4157 } |
| 4158 })(); | 4158 })(); |
| OLD | NEW |