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

Unified Diff: ui/file_manager/file_manager/foreground/js/quick_view_controller.js

Issue 2065403002: Implement close and open-in-new button. Add filename to quick view. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Nit Created 4 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/file_manager/file_manager/foreground/js/file_manager.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/file_manager/file_manager/foreground/js/quick_view_controller.js
diff --git a/ui/file_manager/file_manager/foreground/js/quick_view_controller.js b/ui/file_manager/file_manager/foreground/js/quick_view_controller.js
index c18e031886b50d182bd8953de86a7379cf359278..94b075c0fa93d68564e01723c1b4a9e6abc13252 100644
--- a/ui/file_manager/file_manager/foreground/js/quick_view_controller.js
+++ b/ui/file_manager/file_manager/foreground/js/quick_view_controller.js
@@ -10,11 +10,13 @@
* @param {!FileSelectionHandler} selectionHandler
* @param {!ListContainer} listContainer
* @param {!QuickViewModel} quickViewModel
+ * @param {!TaskController} taskController
*
* @constructor
*/
function QuickViewController(
- quickView, metadataModel, selectionHandler, listContainer, quickViewModel) {
+ quickView, metadataModel, selectionHandler, listContainer, quickViewModel,
+ taskController) {
/**
* @type {!FilesQuickView}
* @private
@@ -40,6 +42,12 @@ function QuickViewController(
this.listContainer_ = listContainer;
/**
+ * @type {!TaskController}
+ * @private
+ */
+ this.taskController_ = taskController;
+
+ /**
* Current selection of selectionHandler.
*
* @type {!Array<!FileEntry>}
@@ -53,9 +61,22 @@ function QuickViewController(
listContainer.element.addEventListener(
'keypress', this.onKeyPressToOpen_.bind(this));
quickView.addEventListener('keypress', this.onKeyPressToClose_.bind(this));
+ quickView.onOpenInNewButtonTap = this.onOpenInNewButtonTap_.bind(this);
}
/**
+ * Handles open-in-new button tap.
+ *
+ * @param {!Event} event A button click event.
+ * @private
+ */
+QuickViewController.prototype.onOpenInNewButtonTap_ = function(event) {
+ this.taskController_.executeDefaultTask();
+ this.quickView_.close();
+}
+
+
+/**
* Handles key event on listContainer if it's relevent to quick view.
*
* @param {!Event} event A keyboard event.
@@ -128,6 +149,7 @@ QuickViewController.prototype.updateQuickView_ = function() {
var entry =
(/** @type {!FileEntry} */ (this.quickViewModel_.getSelectedEntry()));
assert(entry);
+ this.quickView_.filePath = entry.name;
return this.metadataModel_.get([entry], ['contentThumbnailUrl'])
.then(this.onMetadataLoaded_.bind(this, entry));
};
« no previous file with comments | « ui/file_manager/file_manager/foreground/js/file_manager.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698