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 #include "chrome/browser/ui/gtk/infobars/confirm_infobar_gtk.h" | 5 #include "chrome/browser/ui/gtk/infobars/confirm_infobar_gtk.h" |
6 | 6 |
7 #include <gtk/gtk.h> | 7 #include <gtk/gtk.h> |
8 | 8 |
9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
| 10 #include "chrome/browser/infobars/infobar_tab_helper.h" |
10 #include "chrome/browser/ui/gtk/event_utils.h" | 11 #include "chrome/browser/ui/gtk/event_utils.h" |
11 #include "chrome/browser/ui/gtk/gtk_chrome_link_button.h" | 12 #include "chrome/browser/ui/gtk/gtk_chrome_link_button.h" |
12 #include "chrome/browser/ui/gtk/gtk_chrome_shrinkable_hbox.h" | 13 #include "chrome/browser/ui/gtk/gtk_chrome_shrinkable_hbox.h" |
13 #include "chrome/browser/ui/gtk/gtk_util.h" | 14 #include "chrome/browser/ui/gtk/gtk_util.h" |
14 #include "ui/base/gtk/gtk_signal_registrar.h" | 15 #include "ui/base/gtk/gtk_signal_registrar.h" |
15 | 16 |
16 // ConfirmInfoBarDelegate ------------------------------------------------------ | 17 // ConfirmInfoBarDelegate ------------------------------------------------------ |
17 | 18 |
18 InfoBar* ConfirmInfoBarDelegate::CreateInfoBar(InfoBarTabHelper* owner) { | 19 InfoBar* ConfirmInfoBarDelegate::CreateInfoBar(InfoBarTabService* owner) { |
19 return new ConfirmInfoBarGtk(owner, this); | 20 return new ConfirmInfoBarGtk(static_cast<InfoBarTabHelper*>(owner), this); |
20 } | 21 } |
21 | 22 |
22 // ConfirmInfoBarGtk ----------------------------------------------------------- | 23 // ConfirmInfoBarGtk ----------------------------------------------------------- |
23 | 24 |
24 ConfirmInfoBarGtk::ConfirmInfoBarGtk(InfoBarTabHelper* owner, | 25 ConfirmInfoBarGtk::ConfirmInfoBarGtk(InfoBarTabHelper* owner, |
25 ConfirmInfoBarDelegate* delegate) | 26 ConfirmInfoBarDelegate* delegate) |
26 : InfoBarGtk(owner, delegate), | 27 : InfoBarGtk(owner, delegate), |
27 size_group_(NULL) { | 28 size_group_(NULL) { |
28 confirm_hbox_ = gtk_chrome_shrinkable_hbox_new(FALSE, FALSE, | 29 confirm_hbox_ = gtk_chrome_shrinkable_hbox_new(FALSE, FALSE, |
29 kEndOfLabelSpacing); | 30 kEndOfLabelSpacing); |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 void ConfirmInfoBarGtk::OnCancelButton(GtkWidget* widget) { | 92 void ConfirmInfoBarGtk::OnCancelButton(GtkWidget* widget) { |
92 if (delegate()->AsConfirmInfoBarDelegate()->Cancel()) | 93 if (delegate()->AsConfirmInfoBarDelegate()->Cancel()) |
93 RemoveSelf(); | 94 RemoveSelf(); |
94 } | 95 } |
95 | 96 |
96 void ConfirmInfoBarGtk::OnLinkClicked(GtkWidget* widget) { | 97 void ConfirmInfoBarGtk::OnLinkClicked(GtkWidget* widget) { |
97 if (delegate()->AsConfirmInfoBarDelegate()->LinkClicked( | 98 if (delegate()->AsConfirmInfoBarDelegate()->LinkClicked( |
98 event_utils::DispositionForCurrentButtonPressEvent())) | 99 event_utils::DispositionForCurrentButtonPressEvent())) |
99 RemoveSelf(); | 100 RemoveSelf(); |
100 } | 101 } |
OLD | NEW |