forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
recent: Use modificationByMeDate in Recent root.
This change adds MetadataModel.setUseModificationByMeTime() to ask it to override modificationDate field in MetadataItem with modificationByMeDate. This function is called on changing the current directory, and set to true when Recent root is being opened. Bug: 758677 Test: Last modified column in Recent is replaced Cq-Include-Trybots: master.tryserver.chromium.linux:closure_compilation Change-Id: I838e7ab5b46d4a4962becea60a2225531ba67363 Reviewed-on: https://chromium-review.googlesource.com/676506 Reviewed-by: Naoki Fukino <[email protected]> Reviewed-by: Tomasz Mikolajewski <[email protected]> Commit-Queue: Shuhei Takahashi <[email protected]> Cr-Commit-Position: refs/heads/master@{#504269}
- Loading branch information
Showing
12 changed files
with
128 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
ui/file_manager/file_manager/foreground/js/last_modified_controller.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
// Copyright 2017 The Chromium Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
/** | ||
* Controls last modified column in the file table. | ||
* @param {!FileTable} fileTable File table UI. | ||
* @param {!DirectoryModel} directoryModel Directory model. | ||
* @constructor | ||
* @struct | ||
*/ | ||
function LastModifiedController(fileTable, directoryModel) { | ||
/** | ||
* @private {!FileTable} | ||
*/ | ||
this.fileTable_ = fileTable; | ||
|
||
/** | ||
* @private {!DirectoryModel} | ||
*/ | ||
this.directoryModel_ = directoryModel; | ||
|
||
this.directoryModel_.addEventListener( | ||
'scan-started', this.onScanStarted_.bind(this)); | ||
} | ||
|
||
/** | ||
* Handles directory scan start. | ||
* @private | ||
*/ | ||
LastModifiedController.prototype.onScanStarted_ = function() { | ||
// If the current directory is Recent root, request FileTable to use | ||
// modificationByMeTime instead of modificationTime in last modified column. | ||
var useModificationByMeTime = this.directoryModel_.getCurrentRootType() === | ||
VolumeManagerCommon.RootType.RECENT; | ||
this.fileTable_.setUseModificationByMeTime(useModificationByMeTime); | ||
this.directoryModel_.getFileList().setUseModificationByMeTime( | ||
useModificationByMeTime); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters