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

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

Issue 2553003003: Files app: Show a dialog to suggest extensions when file's extension or mime type is available. (Closed)
Patch Set: Make the mime type of suggestAppDialog opational. Created 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/file_manager/file_manager/foreground/js/file_tasks.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/ui/suggest_apps_dialog.js
diff --git a/ui/file_manager/file_manager/foreground/js/ui/suggest_apps_dialog.js b/ui/file_manager/file_manager/foreground/js/ui/suggest_apps_dialog.js
index b2fc020fb5125e175a50645ee5b82d1d496e432c..ad3c6b54092c09d63cfcae00e7c36fcdef6c3a12 100644
--- a/ui/file_manager/file_manager/foreground/js/ui/suggest_apps_dialog.js
+++ b/ui/file_manager/file_manager/foreground/js/ui/suggest_apps_dialog.js
@@ -88,7 +88,7 @@ SuggestAppsDialog.prototype.show = function() {
* Shows suggest-apps dialog by file extension and mime.
*
* @param {string} extension Extension of the file with a trailing dot.
- * @param {string} mime Mime of the file.
+ * @param {?string} mime Mime of the file.
* @param {function(SuggestAppsDialog.Result, ?string)} onDialogClosed Called
* when the dialog is closed, with a result code and an optionally an
* extension id, if an extension was installed.
@@ -96,11 +96,11 @@ SuggestAppsDialog.prototype.show = function() {
SuggestAppsDialog.prototype.showByExtensionAndMime =
function(extension, mime, onDialogClosed) {
assert(extension && extension[0] === '.');
+ var options = {file_extension: extension.substr(1)};
+ if (mime)
+ options.mime_type = mime;
this.showInternal_(
- {
- file_extension: extension.substr(1),
- mime_type: mime
- },
+ options,
str('SUGGEST_DIALOG_TITLE'),
FileTasks.createWebStoreLink(extension, mime),
onDialogClosed);
« no previous file with comments | « ui/file_manager/file_manager/foreground/js/file_tasks.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698