repost_form_warning_view.h revision dc0f95d653279beabeb9817299e2902918ba123e
1// Copyright (c) 2011 The Chromium Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef CHROME_BROWSER_UI_VIEWS_REPOST_FORM_WARNING_VIEW_H_
6#define CHROME_BROWSER_UI_VIEWS_REPOST_FORM_WARNING_VIEW_H_
7#pragma once
8
9#include "content/browser/tab_contents/constrained_window.h"
10#include "ui/gfx/native_widget_types.h"
11#include "views/window/dialog_delegate.h"
12
13class ConstrainedWindow;
14class MessageBoxView;
15class NavigationController;
16class RepostFormWarningController;
17class TabContents;
18namespace views {
19class Window;
20}
21
22// Displays a dialog that warns the user that they are about to resubmit
23// a form.
24// To display the dialog, allocate this object on the heap. It will open the
25// dialog from its constructor and then delete itself when the user dismisses
26// the dialog.
27class RepostFormWarningView : public ConstrainedDialogDelegate {
28 public:
29  // Use BrowserWindow::ShowRepostFormWarningDialog to use.
30  RepostFormWarningView(gfx::NativeWindow parent_window,
31                        TabContents* tab_contents);
32
33  // views::DialogDelegate Methods:
34  virtual std::wstring GetWindowTitle() const;
35  virtual std::wstring GetDialogButtonLabel(
36      MessageBoxFlags::DialogButton button) const;
37  virtual void DeleteDelegate();
38
39  virtual bool Cancel();
40  virtual bool Accept();
41
42  // views::WindowDelegate Methods:
43  virtual views::View* GetContentsView();
44
45 private:
46  virtual ~RepostFormWarningView();
47
48  // The message box view whose commands we handle.
49  MessageBoxView* message_box_view_;
50
51  scoped_ptr<RepostFormWarningController> controller_;
52
53  DISALLOW_COPY_AND_ASSIGN(RepostFormWarningView);
54};
55
56#endif  // CHROME_BROWSER_UI_VIEWS_REPOST_FORM_WARNING_VIEW_H_
57