OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 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 | 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_INFOBARS_CONFIRM_INFOBAR_GTK_H_ | 5 #ifndef CHROME_BROWSER_UI_GTK_INFOBARS_CONFIRM_INFOBAR_GTK_H_ |
6 #define CHROME_BROWSER_UI_GTK_INFOBARS_CONFIRM_INFOBAR_GTK_H_ | 6 #define CHROME_BROWSER_UI_GTK_INFOBARS_CONFIRM_INFOBAR_GTK_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "chrome/browser/tab_contents/confirm_infobar_delegate.h" | 10 #include "chrome/browser/tab_contents/confirm_infobar_delegate.h" |
11 #include "chrome/browser/ui/gtk/infobars/infobar_gtk.h" | 11 #include "chrome/browser/ui/gtk/infobars/infobar_gtk.h" |
12 #include "ui/base/gtk/gtk_signal.h" | 12 #include "ui/base/gtk/gtk_signal.h" |
13 | 13 |
14 typedef struct _GtkSizeGroup GtkSizeGroup; | 14 typedef struct _GtkSizeGroup GtkSizeGroup; |
15 typedef struct _GtkWidget GtkWidget; | 15 typedef struct _GtkWidget GtkWidget; |
16 | 16 |
17 // An infobar that shows a message, up to two optional buttons, and an optional, | 17 // An infobar that shows a message, up to two optional buttons, and an optional, |
18 // right-aligned link. This is commonly used to do things like: | 18 // right-aligned link. This is commonly used to do things like: |
19 // "Would you like to do X? [Yes] [No] _Learn More_ [x]" | 19 // "Would you like to do X? [Yes] [No] _Learn More_ [x]" |
20 class ConfirmInfoBarGtk : public InfoBarGtk { | 20 class ConfirmInfoBarGtk : public InfoBarGtk { |
21 public: | 21 public: |
22 explicit ConfirmInfoBarGtk(TabContentsWrapper* owner, | 22 ConfirmInfoBarGtk(TabContentsWrapper* owner, |
23 ConfirmInfoBarDelegate* delegate); | 23 ConfirmInfoBarDelegate* delegate); |
24 | 24 |
25 private: | 25 private: |
26 virtual ~ConfirmInfoBarGtk(); | 26 virtual ~ConfirmInfoBarGtk(); |
27 | 27 |
28 // Adds a button to the info bar by type. It will do nothing if the delegate | 28 // Adds a button to the info bar by type. It will do nothing if the delegate |
29 // doesn't specify a button of the given type. | 29 // doesn't specify a button of the given type. |
30 void AddButton(ConfirmInfoBarDelegate::InfoBarButton type); | 30 void AddButton(ConfirmInfoBarDelegate::InfoBarButton type); |
31 | 31 |
32 CHROMEGTK_CALLBACK_0(ConfirmInfoBarGtk, void, OnOkButton); | 32 CHROMEGTK_CALLBACK_0(ConfirmInfoBarGtk, void, OnOkButton); |
33 CHROMEGTK_CALLBACK_0(ConfirmInfoBarGtk, void, OnCancelButton); | 33 CHROMEGTK_CALLBACK_0(ConfirmInfoBarGtk, void, OnCancelButton); |
34 CHROMEGTK_CALLBACK_0(ConfirmInfoBarGtk, void, OnLinkClicked); | 34 CHROMEGTK_CALLBACK_0(ConfirmInfoBarGtk, void, OnLinkClicked); |
35 | 35 |
36 GtkWidget* confirm_hbox_; | 36 GtkWidget* confirm_hbox_; |
37 | 37 |
38 GtkSizeGroup* size_group_; | 38 GtkSizeGroup* size_group_; |
39 | 39 |
40 DISALLOW_COPY_AND_ASSIGN(ConfirmInfoBarGtk); | 40 DISALLOW_COPY_AND_ASSIGN(ConfirmInfoBarGtk); |
41 }; | 41 }; |
42 | 42 |
43 #endif // CHROME_BROWSER_UI_GTK_INFOBARS_CONFIRM_INFOBAR_GTK_H_ | 43 #endif // CHROME_BROWSER_UI_GTK_INFOBARS_CONFIRM_INFOBAR_GTK_H_ |
OLD | NEW |