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

Side by Side Diff: chrome/browser/ui/gtk/tab_modal_confirm_dialog_gtk.h

Issue 10972002: chrome: Add TabModalConfirmDialog interface. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 2 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_UI_GTK_TAB_MODAL_CONFIRM_DIALOG_GTK_H_ 5 #ifndef CHROME_BROWSER_UI_GTK_TAB_MODAL_CONFIRM_DIALOG_GTK_H_
6 #define CHROME_BROWSER_UI_GTK_TAB_MODAL_CONFIRM_DIALOG_GTK_H_ 6 #define CHROME_BROWSER_UI_GTK_TAB_MODAL_CONFIRM_DIALOG_GTK_H_
7 7
8 #include <gtk/gtk.h> 8 #include <gtk/gtk.h>
9 9
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
11 #include "base/memory/scoped_ptr.h" 11 #include "base/memory/scoped_ptr.h"
12 #include "chrome/browser/ui/tab_modal_confirm_dialog.h"
12 #include "chrome/browser/ui/gtk/constrained_window_gtk.h" 13 #include "chrome/browser/ui/gtk/constrained_window_gtk.h"
13 #include "ui/base/gtk/gtk_signal.h" 14 #include "ui/base/gtk/gtk_signal.h"
14 15
15 class TabContents; 16 class TabContents;
16 class TabModalConfirmDialogDelegate; 17 class TabModalConfirmDialogDelegate;
17 18
18 // Displays a tab-modal dialog, i.e. a dialog that will block the current page 19 // Displays a tab-modal dialog, i.e. a dialog that will block the current page
19 // but still allow the user to switch to a different page. 20 // but still allow the user to switch to a different page.
20 // To display the dialog, allocate this object on the heap. It will open the 21 // To display the dialog, allocate this object on the heap. It will open the
21 // dialog from its constructor and then delete itself when the user dismisses 22 // dialog from its constructor and then delete itself when the user dismisses
22 // the dialog. 23 // the dialog.
23 class TabModalConfirmDialogGtk : public ConstrainedWindowGtkDelegate { 24 class TabModalConfirmDialogGtk : public TabModalConfirmDialog,
25 public ConstrainedWindowGtkDelegate {
24 public: 26 public:
25 TabModalConfirmDialogGtk(TabModalConfirmDialogDelegate* delegate, 27 TabModalConfirmDialogGtk(TabModalConfirmDialogDelegate* delegate,
26 TabContents* tab_contents); 28 TabContents* tab_contents);
27 29
28 // ConstrainedWindowGtkDelegate methods 30 // Overridden from ConstrainedWindowGtkDelegate:
Peter Kasting 2012/09/25 00:39:20 Nit: Be consistent; the the Mac header you used "X
tfarina 2012/09/25 02:03:38 Done.
29 virtual GtkWidget* GetWidgetRoot() OVERRIDE; 31 virtual GtkWidget* GetWidgetRoot() OVERRIDE;
30 virtual GtkWidget* GetFocusWidget() OVERRIDE; 32 virtual GtkWidget* GetFocusWidget() OVERRIDE;
31 virtual void DeleteDelegate() OVERRIDE; 33 virtual void DeleteDelegate() OVERRIDE;
32 34
33 private: 35 private:
34 friend class TabModalConfirmDialogTest; 36 friend class TabModalConfirmDialogTest;
35 37
36 virtual ~TabModalConfirmDialogGtk(); 38 virtual ~TabModalConfirmDialogGtk();
37 39
40 // Overridden from TabModalConfirmDialog:
41 virtual void AcceptTabModalDialog() OVERRIDE;
42 virtual void CancelTabModalDialog() OVERRIDE;
43
38 // Callbacks 44 // Callbacks
39 CHROMEGTK_CALLBACK_0(TabModalConfirmDialogGtk, void, OnAccept); 45 CHROMEGTK_CALLBACK_0(TabModalConfirmDialogGtk, void, OnAccept);
40 CHROMEGTK_CALLBACK_0(TabModalConfirmDialogGtk, void, OnCancel); 46 CHROMEGTK_CALLBACK_0(TabModalConfirmDialogGtk, void, OnCancel);
41 47
42 scoped_ptr<TabModalConfirmDialogDelegate> delegate_; 48 scoped_ptr<TabModalConfirmDialogDelegate> delegate_;
43 49
44 GtkWidget* dialog_; 50 GtkWidget* dialog_;
45 GtkWidget* ok_; 51 GtkWidget* ok_;
46 GtkWidget* cancel_; 52 GtkWidget* cancel_;
47 53
48 DISALLOW_COPY_AND_ASSIGN(TabModalConfirmDialogGtk); 54 DISALLOW_COPY_AND_ASSIGN(TabModalConfirmDialogGtk);
49 }; 55 };
50 56
51 #endif // CHROME_BROWSER_UI_GTK_TAB_MODAL_CONFIRM_DIALOG_GTK_H_ 57 #endif // CHROME_BROWSER_UI_GTK_TAB_MODAL_CONFIRM_DIALOG_GTK_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698