summaryrefslogtreecommitdiffstats
path: root/chrome/browser/ui/webui/tab_modal_confirm_dialog_webui.h
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/ui/webui/tab_modal_confirm_dialog_webui.h')
-rw-r--r--chrome/browser/ui/webui/tab_modal_confirm_dialog_webui.h42
1 files changed, 31 insertions, 11 deletions
diff --git a/chrome/browser/ui/webui/tab_modal_confirm_dialog_webui.h b/chrome/browser/ui/webui/tab_modal_confirm_dialog_webui.h
index edcb7b7..66ae8c9 100644
--- a/chrome/browser/ui/webui/tab_modal_confirm_dialog_webui.h
+++ b/chrome/browser/ui/webui/tab_modal_confirm_dialog_webui.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 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.
@@ -6,13 +6,15 @@
#define CHROME_BROWSER_UI_WEBUI_TAB_MODAL_CONFIRM_DIALOG_WEBUI_H_
#pragma once
-#if !(defined(USE_AURA) || defined(TOOLKIT_VIEWS))
+#if !(defined(USE_AURA) || defined(OS_CHROMEOS))
#error Tab-modal confirm dialog should be shown with native UI.
#endif
#include "base/basictypes.h"
#include "base/memory/scoped_ptr.h"
+#include "chrome/browser/ui/webui/html_dialog_ui.h"
+class ConstrainedHtmlUIDelegate;
class TabContentsWrapper;
class TabModalConfirmDialogDelegate;
@@ -21,20 +23,38 @@ class TabModalConfirmDialogDelegate;
// To display the dialog, allocate this object on the heap. It will open the
// dialog from its constructor and then delete itself when the user dismisses
// the dialog.
-class TabModalConfirmDialogUI {
+class TabModalConfirmDialogWebUI : public HtmlDialogUIDelegate {
public:
- TabModalConfirmDialogUI(TabModalConfirmDialogDelegate* delegate,
- TabContentsWrapper* wrapper);
- ~TabModalConfirmDialogUI();
-
- // Invoked when the dialog is closed. Notifies the controller of the user's
- // response.
- void OnDialogClosed(bool accept);
+ TabModalConfirmDialogWebUI(
+ TabModalConfirmDialogDelegate* dialog_delegate,
+ TabContentsWrapper* wrapper);
+
+ // HtmlDialogUIDelegate implementation.
+ virtual bool IsDialogModal() const OVERRIDE;
+ virtual string16 GetDialogTitle() const OVERRIDE;
+ virtual GURL GetDialogContentURL() const OVERRIDE;
+ virtual void GetWebUIMessageHandlers(
+ std::vector<content::WebUIMessageHandler*>* handlers) const OVERRIDE;
+ virtual void GetDialogSize(gfx::Size* size) const OVERRIDE;
+ virtual std::string GetDialogArgs() const OVERRIDE;
+ virtual void OnDialogClosed(const std::string& json_retval) OVERRIDE;
+ virtual void OnCloseContents(content::WebContents* source,
+ bool* out_close_dialog) OVERRIDE;
+ virtual bool ShouldShowDialogTitle() const OVERRIDE;
+
+ ConstrainedHtmlUIDelegate* constrained_html_ui_delegate() {
+ return constrained_html_ui_delegate_;
+ }
private:
+ virtual ~TabModalConfirmDialogWebUI();
+
scoped_ptr<TabModalConfirmDialogDelegate> delegate_;
- DISALLOW_COPY_AND_ASSIGN(TabModalConfirmDialogUI);
+ // Deletes itself.
+ ConstrainedHtmlUIDelegate* constrained_html_ui_delegate_;
+
+ DISALLOW_COPY_AND_ASSIGN(TabModalConfirmDialogWebUI);
};
#endif // CHROME_BROWSER_UI_WEBUI_TAB_MODAL_CONFIRM_DIALOG_WEBUI_H_