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

Unified Diff: chrome/browser/resources/file_manager/js/ui/file_manager_dialog_base.js

Issue 23483029: [Files.app] Not to capture mouse events when the suggest app dialog is visible. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rename enableDragOnTitleArea -> onDialogShownOrHidden Created 7 years, 3 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: chrome/browser/resources/file_manager/js/ui/file_manager_dialog_base.js
diff --git a/chrome/browser/resources/file_manager/js/ui/file_manager_dialog_base.js b/chrome/browser/resources/file_manager/js/ui/file_manager_dialog_base.js
new file mode 100644
index 0000000000000000000000000000000000000000..e68c219e3163d61cf14eb0857228dac65edc9b00
--- /dev/null
+++ b/chrome/browser/resources/file_manager/js/ui/file_manager_dialog_base.js
@@ -0,0 +1,110 @@
+// Copyright 2013 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.
+
+'use strict';
+
+/**
+ * This class is an extended class, to manage the status of the dialogs.
+ *
+ * @param {HTMLElement} parentNode Parent node of the dialog.
+ * @extends {cr.ui.dialogs.FileManagerDialogBase}
+ * @constructor
+ */
+var FileManagerDialogBase = function(parentNode) {
+ cr.ui.dialogs.BaseDialog.call(this, parentNode);
+};
+
+FileManagerDialogBase.prototype = {
+ __proto__: cr.ui.dialogs.BaseDialog.prototype
+};
+
+/**
+ * The FileManager object.
hirono 2013/09/06 08:30:14 nit: Could you please add the description about wh
yoshiki 2013/09/09 01:50:42 Done.
+ * @type {FileManager}
+ * @private
+ */
+FileManagerDialogBase.fileManager_ = null;
+
+/**
+ * Setter of FileManagerDialogBase.fileManager_.
+ * @param {FileManager} fileManager The fileManager object.
+ */
+FileManagerDialogBase.setFileManager = function(fileManager) {
+ FileManagerDialogBase.fileManager_ = fileManager;
+};
+
+/**
+ * The flag if any dialog is shown. True if a dialog is visible, false
+ * otherwise.
+ * @type {boolean}
+ */
+FileManagerDialogBase.shown = false;
+
+/**
+ * @param {string} title Title.
+ * @param {string} message Message.
+ * @param {function()} onOk Called when the OK buttun is pressed.
+ * @param {function()} onCancel Called when the cancel button is pressed.
+ * @return {boolean} True if the dialog can show successfully. False if the
+ * dialog failed to show due to an exisiting dialog.
+ */
+FileManagerDialogBase.prototype.showOkCancelDialog = function(
+ title, message, onOk, onCancel) {
+ return this.showImpl_(title, message, onOk, onCancel);
+};
+
+/**
+ * @param {string} title Title.
+ * @param {string} message Message.
+ * @param {function()} onOk Called when the OK buttun is pressed.
+ * @param {function()} onCancel Called when the cancel button is pressed.
+ * @return {boolean} True if the dialog can show successfully. False if the
+ * dialog failed to show due to an exisiting dialog.
+ * @private
+ */
+FileManagerDialogBase.prototype.showImpl_ = function(
+ title, message, onOk, onCancel) {
+ if (FileManagerDialogBase.shown)
+ return false;
+
+ FileManagerDialogBase.shown = true;
+ if (FileManagerDialogBase.fileManager_)
+ FileManagerDialogBase.fileManager_.onDialogShownOrHidden(true);
+ cr.ui.dialogs.BaseDialog.prototype.showWithTitle.call(
+ this, title, message, onOk, onCancel, null);
+
+ return true;
+};
+
+/**
+ * @return {boolean} True if the dialog can show successfully. False if the
+ * dialog failed to show due to an exisiting dialog.
+ */
+FileManagerDialogBase.prototype.showBlankDialog = function() {
+ return this.showImpl_('', '', null, null, null);
+};
+
+/**
+ * @param {string} title Title.
+ * @return {boolean} True if the dialog can show successfully. False if the
+ * dialog failed to show due to an exisiting dialog.
+ */
+FileManagerDialogBase.prototype.showTitleOnlyDialog = function(title) {
+ return this.showImpl_(title, '', null, null, null);
+};
+
+/**
+ * @param {function()=} opt_onHide Called when the dialog is hidden.
+ */
+FileManagerDialogBase.prototype.hide = function(opt_onHide) {
+ cr.ui.dialogs.BaseDialog.prototype.hide.call(
+ this,
+ function() {
+ if (opt_onHide)
+ opt_onHide();
+ if (FileManagerDialogBase.fileManager_)
+ FileManagerDialogBase.fileManager_.onDialogShownOrHidden(false);
+ FileManagerDialogBase.shown = false;
+ });
+};
« no previous file with comments | « chrome/browser/resources/file_manager/js/suggest_apps_dialog.js ('k') | chrome/browser/resources/file_manager/main.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698