| 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;
|
| +};
|
|
|