repost_form_warning_gtk.h revision 72a454cd3513ac24fbdd0e0cb9ad70b86a99b801
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_GTK_REPOST_FORM_WARNING_GTK_H_
6#define CHROME_BROWSER_UI_GTK_REPOST_FORM_WARNING_GTK_H_
7#pragma once
8
9#include <gtk/gtk.h>
10
11#include "base/scoped_ptr.h"
12#include "chrome/browser/ui/gtk/constrained_window_gtk.h"
13#include "ui/base/gtk/gtk_signal.h"
14
15class RepostFormWarningController;
16
17// Displays a dialog that warns the user that they are about to resubmit
18// a form.
19// To display the dialog, allocate this object on the heap. It will open the
20// dialog from its constructor and then delete itself when the user dismisses
21// the dialog.
22class RepostFormWarningGtk : public ConstrainedDialogDelegate {
23 public:
24  RepostFormWarningGtk(GtkWindow* parent, TabContents* tab_contents);
25
26  // ConstrainedDialogDelegate methods
27  virtual GtkWidget* GetWidgetRoot();
28
29  virtual void DeleteDelegate();
30
31 private:
32  virtual ~RepostFormWarningGtk();
33
34  // Callbacks
35  CHROMEGTK_CALLBACK_0(RepostFormWarningGtk, void, OnRefresh);
36  CHROMEGTK_CALLBACK_0(RepostFormWarningGtk, void, OnCancel);
37  CHROMEGTK_CALLBACK_1(RepostFormWarningGtk,
38                       void,
39                       OnHierarchyChanged,
40                       GtkWidget*);
41
42  scoped_ptr<RepostFormWarningController> controller_;
43
44  GtkWidget* dialog_;
45  GtkWidget* ok_;
46  GtkWidget* cancel_;
47
48  DISALLOW_COPY_AND_ASSIGN(RepostFormWarningGtk);
49};
50
51#endif  // CHROME_BROWSER_UI_GTK_REPOST_FORM_WARNING_GTK_H_
52