| 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 2587 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2598 */ | 2598 */ |
| 2599 FileManager.prototype.onScanCompleted_ = function() { | 2599 FileManager.prototype.onScanCompleted_ = function() { |
| 2600 if (!this.scanInProgress_) { | 2600 if (!this.scanInProgress_) { |
| 2601 console.error('Scan-completed event recieved. But scan is not started.'); | 2601 console.error('Scan-completed event recieved. But scan is not started.'); |
| 2602 return; | 2602 return; |
| 2603 } | 2603 } |
| 2604 | 2604 |
| 2605 if (this.commandHandler) | 2605 if (this.commandHandler) |
| 2606 this.commandHandler.updateAvailability(); | 2606 this.commandHandler.updateAvailability(); |
| 2607 this.hideSpinnerLater_(); | 2607 this.hideSpinnerLater_(); |
| 2608 this.refreshCurrentDirectoryMetadata_(); | |
| 2609 | 2608 |
| 2610 if (this.scanUpdatedTimer_) { | 2609 if (this.scanUpdatedTimer_) { |
| 2611 clearTimeout(this.scanUpdatedTimer_); | 2610 clearTimeout(this.scanUpdatedTimer_); |
| 2612 this.scanUpdatedTimer_ = null; | 2611 this.scanUpdatedTimer_ = null; |
| 2613 } | 2612 } |
| 2614 | 2613 |
| 2615 // To avoid flickering postpone updating the ui by a small amount of time. | 2614 // To avoid flickering postpone updating the ui by a small amount of time. |
| 2616 // There is a high chance, that metadata will be received within 50 ms. | 2615 // There is a high chance, that metadata will be received within 50 ms. |
| 2617 this.scanCompletedTimer_ = setTimeout(function() { | 2616 this.scanCompletedTimer_ = setTimeout(function() { |
| 2618 // Check if batch updates are already finished by onScanUpdated_(). | 2617 // Check if batch updates are already finished by onScanUpdated_(). |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2690 this.scanInProgress_ = false; | 2689 this.scanInProgress_ = false; |
| 2691 this.table_.list.endBatchUpdates(); | 2690 this.table_.list.endBatchUpdates(); |
| 2692 this.grid_.endBatchUpdates(); | 2691 this.grid_.endBatchUpdates(); |
| 2693 }; | 2692 }; |
| 2694 | 2693 |
| 2695 /** | 2694 /** |
| 2696 * Handle the 'rescan-completed' from the DirectoryModel. | 2695 * Handle the 'rescan-completed' from the DirectoryModel. |
| 2697 * @private | 2696 * @private |
| 2698 */ | 2697 */ |
| 2699 FileManager.prototype.onRescanCompleted_ = function() { | 2698 FileManager.prototype.onRescanCompleted_ = function() { |
| 2700 this.refreshCurrentDirectoryMetadata_(); | |
| 2701 this.selectionHandler_.onFileSelectionChanged(); | 2699 this.selectionHandler_.onFileSelectionChanged(); |
| 2702 }; | 2700 }; |
| 2703 | 2701 |
| 2704 /** | 2702 /** |
| 2705 * @private | 2703 * @private |
| 2706 */ | 2704 */ |
| 2707 FileManager.prototype.cancelSpinnerTimeout_ = function() { | 2705 FileManager.prototype.cancelSpinnerTimeout_ = function() { |
| 2708 if (this.showSpinnerTimeout_) { | 2706 if (this.showSpinnerTimeout_) { |
| 2709 clearTimeout(this.showSpinnerTimeout_); | 2707 clearTimeout(this.showSpinnerTimeout_); |
| 2710 this.showSpinnerTimeout_ = null; | 2708 this.showSpinnerTimeout_ = null; |
| (...skipping 937 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3648 callback(this.preferences_); | 3646 callback(this.preferences_); |
| 3649 return; | 3647 return; |
| 3650 } | 3648 } |
| 3651 | 3649 |
| 3652 chrome.fileBrowserPrivate.getPreferences(function(prefs) { | 3650 chrome.fileBrowserPrivate.getPreferences(function(prefs) { |
| 3653 this.preferences_ = prefs; | 3651 this.preferences_ = prefs; |
| 3654 callback(prefs); | 3652 callback(prefs); |
| 3655 }.bind(this)); | 3653 }.bind(this)); |
| 3656 }; | 3654 }; |
| 3657 })(); | 3655 })(); |
| OLD | NEW |