| OLD | NEW |
| 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 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <gtk/gtk.h> | 9 #include <gtk/gtk.h> |
| 10 | 10 |
| 11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
| 12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
| 13 #include "chrome/browser/ui/gtk/constrained_window_gtk.h" | 13 #include "chrome/browser/ui/gtk/constrained_window_gtk.h" |
| 14 #include "ui/base/gtk/gtk_signal.h" | 14 #include "ui/base/gtk/gtk_signal.h" |
| 15 | 15 |
| 16 class TabContents; | 16 class TabContents; |
| 17 typedef TabContents TabContentsWrapper; | |
| 18 class TabModalConfirmDialogDelegate; | 17 class TabModalConfirmDialogDelegate; |
| 19 | 18 |
| 20 // 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 |
| 21 // but still allow the user to switch to a different page. | 20 // but still allow the user to switch to a different page. |
| 22 // 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 |
| 23 // 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 |
| 24 // the dialog. | 23 // the dialog. |
| 25 class TabModalConfirmDialogGtk : public ConstrainedWindowGtkDelegate { | 24 class TabModalConfirmDialogGtk : public ConstrainedWindowGtkDelegate { |
| 26 public: | 25 public: |
| 27 TabModalConfirmDialogGtk(TabModalConfirmDialogDelegate* delegate, | 26 TabModalConfirmDialogGtk(TabModalConfirmDialogDelegate* delegate, |
| 28 TabContentsWrapper* wrapper); | 27 TabContents* tab_contents); |
| 29 | 28 |
| 30 // ConstrainedWindowGtkDelegate methods | 29 // ConstrainedWindowGtkDelegate methods |
| 31 virtual GtkWidget* GetWidgetRoot() OVERRIDE; | 30 virtual GtkWidget* GetWidgetRoot() OVERRIDE; |
| 32 virtual GtkWidget* GetFocusWidget() OVERRIDE; | 31 virtual GtkWidget* GetFocusWidget() OVERRIDE; |
| 33 virtual void DeleteDelegate() OVERRIDE; | 32 virtual void DeleteDelegate() OVERRIDE; |
| 34 | 33 |
| 35 private: | 34 private: |
| 36 friend class TabModalConfirmDialogTest; | 35 friend class TabModalConfirmDialogTest; |
| 37 | 36 |
| 38 virtual ~TabModalConfirmDialogGtk(); | 37 virtual ~TabModalConfirmDialogGtk(); |
| 39 | 38 |
| 40 // Callbacks | 39 // Callbacks |
| 41 CHROMEGTK_CALLBACK_0(TabModalConfirmDialogGtk, void, OnAccept); | 40 CHROMEGTK_CALLBACK_0(TabModalConfirmDialogGtk, void, OnAccept); |
| 42 CHROMEGTK_CALLBACK_0(TabModalConfirmDialogGtk, void, OnCancel); | 41 CHROMEGTK_CALLBACK_0(TabModalConfirmDialogGtk, void, OnCancel); |
| 43 | 42 |
| 44 scoped_ptr<TabModalConfirmDialogDelegate> delegate_; | 43 scoped_ptr<TabModalConfirmDialogDelegate> delegate_; |
| 45 | 44 |
| 46 GtkWidget* dialog_; | 45 GtkWidget* dialog_; |
| 47 GtkWidget* ok_; | 46 GtkWidget* ok_; |
| 48 GtkWidget* cancel_; | 47 GtkWidget* cancel_; |
| 49 | 48 |
| 50 DISALLOW_COPY_AND_ASSIGN(TabModalConfirmDialogGtk); | 49 DISALLOW_COPY_AND_ASSIGN(TabModalConfirmDialogGtk); |
| 51 }; | 50 }; |
| 52 | 51 |
| 53 #endif // CHROME_BROWSER_UI_GTK_TAB_MODAL_CONFIRM_DIALOG_GTK_H_ | 52 #endif // CHROME_BROWSER_UI_GTK_TAB_MODAL_CONFIRM_DIALOG_GTK_H_ |
| OLD | NEW |