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