summaryrefslogtreecommitdiffstats
path: root/chrome/browser/ui/tab_modal_confirm_dialog_delegate.h
diff options
context:
space:
mode:
authorbauerb@chromium.org <bauerb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-12-17 02:54:43 +0000
committerbauerb@chromium.org <bauerb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-12-17 02:54:43 +0000
commitcb928b74a8f2a612d746a06321d14c34cffedb50 (patch)
tree65420c15864fc903263eb3084c21038fa6c6d99b /chrome/browser/ui/tab_modal_confirm_dialog_delegate.h
parent196fd8a8240ffa5750867f4253475a1f440ca2a6 (diff)
downloadchromium_src-cb928b74a8f2a612d746a06321d14c34cffedb50.zip
chromium_src-cb928b74a8f2a612d746a06321d14c34cffedb50.tar.gz
chromium_src-cb928b74a8f2a612d746a06321d14c34cffedb50.tar.bz2
Revert 114898 - Add TabModalConfirmDialogDelegate to show simple tab-modal confirmation dialogs.
This CL carves a TabModalConfirmDialogDelegate class (modeled after ConfirmInfobarDelegate) out of RepostFormWarningController and makes it a subclass thereof. It also removes the ShowRepostFormWarning method from BrowserWindow and its subclasses, in favor of a method in browser_dialogs.h. BUG=92795 TEST=none Review URL: http://codereview.chromium.org/8658005 TBR=bauerb@chromium.org Review URL: http://codereview.chromium.org/8962012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@114903 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/ui/tab_modal_confirm_dialog_delegate.h')
-rw-r--r--chrome/browser/ui/tab_modal_confirm_dialog_delegate.h79
1 files changed, 0 insertions, 79 deletions
diff --git a/chrome/browser/ui/tab_modal_confirm_dialog_delegate.h b/chrome/browser/ui/tab_modal_confirm_dialog_delegate.h
deleted file mode 100644
index 7055a6f..0000000
--- a/chrome/browser/ui/tab_modal_confirm_dialog_delegate.h
+++ /dev/null
@@ -1,79 +0,0 @@
-// Copyright (c) 2011 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.
-
-#ifndef CHROME_BROWSER_UI_TAB_MODAL_CONFIRM_DIALOG_DELEGATE_H_
-#define CHROME_BROWSER_UI_TAB_MODAL_CONFIRM_DIALOG_DELEGATE_H_
-#pragma once
-
-#include "base/callback.h"
-#include "base/compiler_specific.h"
-#include "base/string16.h"
-#include "content/public/browser/notification_observer.h"
-#include "content/public/browser/notification_registrar.h"
-
-namespace gfx {
-class Image;
-}
-class ConstrainedWindow;
-class TabContents;
-
-// This class acts as the delegate for a simple tab-modal dialog confirming
-// whether the user wants to execute a certain action.
-class TabModalConfirmDialogDelegate : public content::NotificationObserver {
- public:
- explicit TabModalConfirmDialogDelegate(TabContents* tab_contents);
- virtual ~TabModalConfirmDialogDelegate();
-
- void set_window(ConstrainedWindow* window) { window_ = window; }
-
- void Accept();
- void Cancel();
-
- // The title of the dialog. Note that the title is not shown on all platforms.
- virtual string16 GetTitle() = 0;
- virtual string16 GetMessage() = 0;
-
- // Icon to show for the dialog. If this method is not overridden, a default
- // icon (like the application icon) is shown.
- virtual gfx::Image* GetIcon();
-
- // Title for the accept and the cancel buttons.
- // The default implementation uses IDS_OK and IDS_CANCEL.
- virtual string16 GetAcceptButtonTitle();
- virtual string16 GetCancelButtonTitle();
-
- // GTK stock icon names for the accept and cancel buttons, respectively.
- // The icons are only used on GTK. If these methods are not overriden,
- // the buttons have no stock icons.
- virtual const char* GetAcceptButtonIcon();
- virtual const char* GetCancelButtonIcon();
-
- protected:
- ConstrainedWindow* window() { return window_; }
-
- // content::NotificationObserver implementation.
- // Watch for a new load or a closed tab and dismiss the dialog if they occur.
- virtual void Observe(int type,
- const content::NotificationSource& source,
- const content::NotificationDetails& details) OVERRIDE;
-
- content::NotificationRegistrar registrar_;
-
- private:
- // Called when the user accepts or cancels the dialog, respectively.
- virtual void OnAccepted();
- virtual void OnCanceled();
-
- // Close the dialog.
- void CloseDialog();
-
- ConstrainedWindow* window_;
- // True iff we are in the process of closing, to avoid running callbacks
- // multiple times.
- bool closing_;
-
- DISALLOW_COPY_AND_ASSIGN(TabModalConfirmDialogDelegate);
-};
-
-#endif // CHROME_BROWSER_UI_TAB_MODAL_CONFIRM_DIALOG_DELEGATE_H_