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

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

Issue 821003002: Files.app: Fix TaskController so that it calls correct default task. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add Licence Created 6 years 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/js/dialog_type.js
diff --git a/ui/file_manager/file_manager/foreground/js/dialog_type.js b/ui/file_manager/file_manager/foreground/js/dialog_type.js
new file mode 100644
index 0000000000000000000000000000000000000000..a21f06120d78d251adf32ae998259f039d9e2b9d
--- /dev/null
+++ b/ui/file_manager/file_manager/foreground/js/dialog_type.js
@@ -0,0 +1,62 @@
+// Copyright 2014 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.
+
+/**
+ * List of dialog types.
+ *
+ * Keep this in sync with FileManagerDialog::GetDialogTypeAsString, except
+ * FULL_PAGE which is specific to this code.
+ *
+ * @enum {string}
+ * @const
+ */
+var DialogType = {
+ SELECT_FOLDER: 'folder',
+ SELECT_UPLOAD_FOLDER: 'upload-folder',
+ SELECT_SAVEAS_FILE: 'saveas-file',
+ SELECT_OPEN_FILE: 'open-file',
+ SELECT_OPEN_MULTI_FILE: 'open-multi-file',
+ FULL_PAGE: 'full-page'
+};
+
+/**
+ * @param {DialogType} type Dialog type.
+ * @return {boolean} Whether the type is modal.
+ */
+DialogType.isModal = function(type) {
+ return type == DialogType.SELECT_FOLDER ||
+ type == DialogType.SELECT_UPLOAD_FOLDER ||
+ type == DialogType.SELECT_SAVEAS_FILE ||
+ type == DialogType.SELECT_OPEN_FILE ||
+ type == DialogType.SELECT_OPEN_MULTI_FILE;
+};
+
+/**
+ * @param {DialogType} type Dialog type.
+ * @return {boolean} Whether the type is open dialog.
+ */
+DialogType.isOpenDialog = function(type) {
+ return type == DialogType.SELECT_OPEN_FILE ||
+ type == DialogType.SELECT_OPEN_MULTI_FILE ||
+ type == DialogType.SELECT_FOLDER ||
+ type == DialogType.SELECT_UPLOAD_FOLDER;
+};
+
+/**
+ * @param {DialogType} type Dialog type.
+ * @return {boolean} Whether the type is open dialog for file(s).
+ */
+DialogType.isOpenFileDialog = function(type) {
+ return type == DialogType.SELECT_OPEN_FILE ||
+ type == DialogType.SELECT_OPEN_MULTI_FILE;
+};
+
+/**
+ * @param {DialogType} type Dialog type.
+ * @return {boolean} Whether the type is folder selection dialog.
+ */
+DialogType.isFolderDialog = function(type) {
+ return type == DialogType.SELECT_FOLDER ||
+ type == DialogType.SELECT_UPLOAD_FOLDER;
+};

Powered by Google App Engine
This is Rietveld 408576698