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

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

Issue 9705058: Fix exception on loading File Manager. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 9 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 // 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
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
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 })();
OLDNEW
« 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