| 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 // If directory files changes too often, don't rescan directory more than once | 7 // If directory files changes too often, don't rescan directory more than once |
| 8 // per specified interval | 8 // per specified interval |
| 9 var SIMULTANEOUS_RESCAN_INTERVAL = 1000; | 9 var SIMULTANEOUS_RESCAN_INTERVAL = 1000; |
| 10 // Used for operations that require almost instant rescan. | 10 // Used for operations that require almost instant rescan. |
| (...skipping 1157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1168 this.fileListSelection_.selectedIndex = index; | 1168 this.fileListSelection_.selectedIndex = index; |
| 1169 }; | 1169 }; |
| 1170 | 1170 |
| 1171 /** | 1171 /** |
| 1172 * Updates the roots list. | 1172 * Updates the roots list. |
| 1173 * | 1173 * |
| 1174 * @param {function()=} opt_callback Completion callback. | 1174 * @param {function()=} opt_callback Completion callback. |
| 1175 * @private | 1175 * @private |
| 1176 */ | 1176 */ |
| 1177 DirectoryModel.prototype.updateRoots_ = function(opt_callback) { | 1177 DirectoryModel.prototype.updateRoots_ = function(opt_callback) { |
| 1178 metrics.startInterval('Load.Roots'); | 1178 metrics.startInterval('UpdateRootsTime'); |
| 1179 DirectoryModelUtil.resolveRoots( | 1179 DirectoryModelUtil.resolveRoots( |
| 1180 this.root_, this.driveEnabled_, | 1180 this.root_, this.driveEnabled_, |
| 1181 function(rootEntries) { | 1181 function(rootEntries) { |
| 1182 metrics.recordInterval('Load.Roots'); | 1182 metrics.recordInterval('UpdateRootsTime'); |
| 1183 | 1183 |
| 1184 var rootsList = this.rootsList_; | 1184 var rootsList = this.rootsList_; |
| 1185 rootsList.splice.apply( | 1185 rootsList.splice.apply( |
| 1186 rootsList, [0, rootsList.length].concat(rootEntries)); | 1186 rootsList, [0, rootsList.length].concat(rootEntries)); |
| 1187 if (opt_callback) | 1187 if (opt_callback) |
| 1188 opt_callback(); | 1188 opt_callback(); |
| 1189 }.bind(this)); | 1189 }.bind(this)); |
| 1190 }; | 1190 }; |
| 1191 | 1191 |
| 1192 /** | 1192 /** |
| (...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1436 if (this.onSearchCompleted_) { | 1436 if (this.onSearchCompleted_) { |
| 1437 this.removeEventListener('scan-completed', this.onSearchCompleted_); | 1437 this.removeEventListener('scan-completed', this.onSearchCompleted_); |
| 1438 this.onSearchCompleted_ = null; | 1438 this.onSearchCompleted_ = null; |
| 1439 } | 1439 } |
| 1440 | 1440 |
| 1441 if (this.onClearSearch_) { | 1441 if (this.onClearSearch_) { |
| 1442 this.onClearSearch_(); | 1442 this.onClearSearch_(); |
| 1443 this.onClearSearch_ = null; | 1443 this.onClearSearch_ = null; |
| 1444 } | 1444 } |
| 1445 }; | 1445 }; |
| OLD | NEW |