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

Unified Diff: chrome/browser/ui/tab_modal_confirm_dialog_delegate.h

Issue 12276010: Factor out uses of the WebContentsModalDialog interface from platform-independent code (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: remove incorrect override Created 7 years, 10 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/ui/tab_modal_confirm_dialog_delegate.h
diff --git a/chrome/browser/ui/tab_modal_confirm_dialog_delegate.h b/chrome/browser/ui/tab_modal_confirm_dialog_delegate.h
index 3045adbf6e336f67c1dba8911faf0eb86d58b9db..e6041ffbf0a75afcf5b8411b6d2b4a0f77bc7b42 100644
--- a/chrome/browser/ui/tab_modal_confirm_dialog_delegate.h
+++ b/chrome/browser/ui/tab_modal_confirm_dialog_delegate.h
@@ -11,8 +11,6 @@
#include "content/public/browser/notification_observer.h"
#include "content/public/browser/notification_registrar.h"
-class WebContentsModalDialog;
-
namespace content {
class WebContents;
}
@@ -21,6 +19,17 @@ namespace gfx {
class Image;
}
+class TabModalConfirmDialogCloseDelegate {
+ public:
+ TabModalConfirmDialogCloseDelegate() {}
+ virtual ~TabModalConfirmDialogCloseDelegate() {}
+
+ virtual void CloseDialog() = 0;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(TabModalConfirmDialogCloseDelegate);
+};
+
// 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 {
@@ -28,7 +37,9 @@ class TabModalConfirmDialogDelegate : public content::NotificationObserver {
explicit TabModalConfirmDialogDelegate(content::WebContents* web_contents);
virtual ~TabModalConfirmDialogDelegate();
- void set_window(WebContentsModalDialog* window) { window_ = window; }
+ void set_close_delegate(TabModalConfirmDialogCloseDelegate* close_delegate) {
+ close_delegate_ = close_delegate;
+ }
// Accepts the confirmation prompt and calls |OnAccepted|.
// This method is safe to call even from an |OnAccepted| or |OnCanceled|
@@ -62,7 +73,9 @@ class TabModalConfirmDialogDelegate : public content::NotificationObserver {
virtual const char* GetCancelButtonIcon();
protected:
- WebContentsModalDialog* window() { return window_; }
+ TabModalConfirmDialogCloseDelegate* close_delegate() {
+ return close_delegate_;
+ }
// content::NotificationObserver implementation.
// Watch for a new load or a closed tab and dismiss the dialog if they occur.
@@ -80,7 +93,7 @@ class TabModalConfirmDialogDelegate : public content::NotificationObserver {
// Close the dialog.
void CloseDialog();
- WebContentsModalDialog* window_;
+ TabModalConfirmDialogCloseDelegate* close_delegate_;
// True iff we are in the process of closing, to avoid running callbacks
// multiple times.
bool closing_;
« no previous file with comments | « chrome/browser/ui/tab_modal_confirm_dialog.h ('k') | chrome/browser/ui/tab_modal_confirm_dialog_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698