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