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

Unified Diff: ui/file_manager/file_manager/foreground/elements/files_quick_view.js

Issue 2043333002: Quick View: Space key opens quick view for image, video and audio in Download. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Resolve comment 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
Index: ui/file_manager/file_manager/foreground/elements/files_quick_view.js
diff --git a/ui/file_manager/file_manager/foreground/elements/files_quick_view.js b/ui/file_manager/file_manager/foreground/elements/files_quick_view.js
new file mode 100644
index 0000000000000000000000000000000000000000..539e4583b0231789e657fcc3870dfe04a409e640
--- /dev/null
+++ b/ui/file_manager/file_manager/foreground/elements/files_quick_view.js
@@ -0,0 +1,56 @@
+// Copyright 2016 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.
+
+var FilesQuickView = Polymer({
+ is: 'files-quick-view',
+
+ properties: {
+ image: String,
+ video: String,
+ videoPoster: String,
+ audio: String,
+ },
+
+ listeners: {
+ 'iron-overlay-closed': 'clear_',
+ },
+
+ setImageURL: function(url) {
+ this.clear_();
+ this.image = url;
+ },
+
+ setVideoURL: function(url) {
+ this.clear_();
+ this.video = url;
+ },
+
+ setAudioURL: function(url) {
+ this.clear_();
+ this.audio = url;
+ },
+
+ clear_: function() {
+ this.image = '';
+ this.video = '';
+ this.audio = '';
+ },
+
+ // Open the dialog.
+ open: function() {
+ if (!this.isOpened())
+ this.$.dialog.open();
+ },
+
+ close: function() {
+ if (this.isOpened())
+ this.$.dialog.close();
+ },
+
+ isOpened: function() {
+ // TODO(oka): This is a workaround to satisfy closure compiler.
+ // Update ['opened'] to .opened.
+ return (/** @type{Object} */ (this.$.dialog))['opened'];
+ },
+});

Powered by Google App Engine
This is Rietveld 408576698