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 #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/ui/gtk/gtk_chrome_link_button.h" | 10 #include "chrome/browser/ui/gtk/gtk_chrome_link_button.h" |
11 #include "chrome/browser/ui/gtk/gtk_chrome_shrinkable_hbox.h" | 11 #include "chrome/browser/ui/gtk/gtk_chrome_shrinkable_hbox.h" |
12 #include "chrome/browser/ui/gtk/gtk_util.h" | 12 #include "chrome/browser/ui/gtk/gtk_util.h" |
13 | 13 |
14 // ConfirmInfoBarDelegate ------------------------------------------------------ | 14 // ConfirmInfoBarDelegate ------------------------------------------------------ |
15 | 15 |
16 InfoBar* ConfirmInfoBarDelegate::CreateInfoBar() { | 16 InfoBar* ConfirmInfoBarDelegate::CreateInfoBar(TabContentsWrapper* owner) { |
17 return new ConfirmInfoBarGtk(this); | 17 return new ConfirmInfoBarGtk(this); |
18 } | 18 } |
19 | 19 |
20 // ConfirmInfoBarGtk ----------------------------------------------------------- | 20 // ConfirmInfoBarGtk ----------------------------------------------------------- |
21 | 21 |
22 ConfirmInfoBarGtk::ConfirmInfoBarGtk(ConfirmInfoBarDelegate* delegate) | 22 ConfirmInfoBarGtk::ConfirmInfoBarGtk(ConfirmInfoBarDelegate* delegate) |
23 : InfoBar(delegate) { | 23 : InfoBar(delegate) { |
24 confirm_hbox_ = gtk_chrome_shrinkable_hbox_new(FALSE, FALSE, | 24 confirm_hbox_ = gtk_chrome_shrinkable_hbox_new(FALSE, FALSE, |
25 kEndOfLabelSpacing); | 25 kEndOfLabelSpacing); |
26 // This alignment allocates the confirm hbox only as much space as it | 26 // This alignment allocates the confirm hbox only as much space as it |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 if (delegate_->AsConfirmInfoBarDelegate()->Cancel()) | 82 if (delegate_->AsConfirmInfoBarDelegate()->Cancel()) |
83 RemoveInfoBar(); | 83 RemoveInfoBar(); |
84 } | 84 } |
85 | 85 |
86 void ConfirmInfoBarGtk::OnLinkClicked(GtkWidget* widget) { | 86 void ConfirmInfoBarGtk::OnLinkClicked(GtkWidget* widget) { |
87 if (delegate_->AsConfirmInfoBarDelegate()->LinkClicked( | 87 if (delegate_->AsConfirmInfoBarDelegate()->LinkClicked( |
88 gtk_util::DispositionForCurrentButtonPressEvent())) { | 88 gtk_util::DispositionForCurrentButtonPressEvent())) { |
89 RemoveInfoBar(); | 89 RemoveInfoBar(); |
90 } | 90 } |
91 } | 91 } |
OLD | NEW |