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

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

Issue 132683004: [Files.app] Change sort timing during metadata fetch (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 6 years, 11 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
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 '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
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
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 947 matching lines...) Expand 10 before | Expand all | Expand 10 after
3658 callback(this.preferences_); 3656 callback(this.preferences_);
3659 return; 3657 return;
3660 } 3658 }
3661 3659
3662 chrome.fileBrowserPrivate.getPreferences(function(prefs) { 3660 chrome.fileBrowserPrivate.getPreferences(function(prefs) {
3663 this.preferences_ = prefs; 3661 this.preferences_ = prefs;
3664 callback(prefs); 3662 callback(prefs);
3665 }.bind(this)); 3663 }.bind(this));
3666 }; 3664 };
3667 })(); 3665 })();
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698