- add sources.
[platform/framework/web/crosswalk.git] / src / chrome / browser / ui / gtk / tab_modal_confirm_dialog_gtk.h
1 // Copyright (c) 2012 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_TAB_MODAL_CONFIRM_DIALOG_GTK_H_
6 #define CHROME_BROWSER_UI_GTK_TAB_MODAL_CONFIRM_DIALOG_GTK_H_
7
8 #include <gtk/gtk.h>
9
10 #include "base/compiler_specific.h"
11 #include "base/memory/scoped_ptr.h"
12 #include "chrome/browser/ui/tab_modal_confirm_dialog.h"
13 #include "chrome/browser/ui/gtk/constrained_window_gtk.h"
14 #include "ui/base/gtk/gtk_signal.h"
15
16 class TabModalConfirmDialogDelegate;
17
18 namespace content {
19 class WebContents;
20 }
21
22 // Displays a tab-modal dialog, i.e. a dialog that will block the current page
23 // but still allow the user to switch to a different page.
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.
27 class TabModalConfirmDialogGtk : public TabModalConfirmDialog {
28  public:
29   TabModalConfirmDialogGtk(TabModalConfirmDialogDelegate* delegate,
30                            content::WebContents* web_contents);
31
32  private:
33   friend class TabModalConfirmDialogTest;
34
35   virtual ~TabModalConfirmDialogGtk();
36
37   // TabModalConfirmDialog:
38   virtual void AcceptTabModalDialog() OVERRIDE;
39   virtual void CancelTabModalDialog() OVERRIDE;
40
41   // TabModalConfirmDialogCloseDelegate:
42   virtual void CloseDialog() OVERRIDE;
43
44   // Callbacks:
45   CHROMEGTK_CALLBACK_0(TabModalConfirmDialogGtk, void, OnAccept);
46   CHROMEGTK_CALLBACK_0(TabModalConfirmDialogGtk, void, OnCancel);
47   CHROMEGTK_CALLBACK_0(TabModalConfirmDialogGtk, void, OnDestroy);
48   CHROMEGTK_CALLBACK_0(TabModalConfirmDialogGtk, void, OnLinkClicked);
49
50   scoped_ptr<TabModalConfirmDialogDelegate> delegate_;
51
52   GtkWidget* dialog_;
53   GtkWidget* ok_;
54   GtkWidget* cancel_;
55
56   GtkWidget* window_;
57
58   bool closing_;
59
60   DISALLOW_COPY_AND_ASSIGN(TabModalConfirmDialogGtk);
61 };
62
63 #endif  // CHROME_BROWSER_UI_GTK_TAB_MODAL_CONFIRM_DIALOG_GTK_H_