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/infobar_gtk.h" | 5 #include "chrome/browser/ui/gtk/infobars/infobar_gtk.h" |
6 | 6 |
7 #include "base/debug/trace_event.h" | 7 #include "base/debug/trace_event.h" |
8 #include "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
9 #include "chrome/browser/infobars/infobar_service.h" | 9 #include "chrome/browser/infobars/infobar_service.h" |
10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 // Add the icon on the left, if any. | 76 // Add the icon on the left, if any. |
77 gfx::Image* icon = delegate->GetIcon(); | 77 gfx::Image* icon = delegate->GetIcon(); |
78 if (icon) { | 78 if (icon) { |
79 GtkWidget* image = gtk_image_new_from_pixbuf(icon->ToGdkPixbuf()); | 79 GtkWidget* image = gtk_image_new_from_pixbuf(icon->ToGdkPixbuf()); |
80 | 80 |
81 gtk_misc_set_alignment(GTK_MISC(image), 0.5, 0.5); | 81 gtk_misc_set_alignment(GTK_MISC(image), 0.5, 0.5); |
82 | 82 |
83 gtk_box_pack_start(GTK_BOX(hbox_), image, FALSE, FALSE, 0); | 83 gtk_box_pack_start(GTK_BOX(hbox_), image, FALSE, FALSE, 0); |
84 } | 84 } |
85 | 85 |
86 close_button_.reset(CustomDrawButton::CloseButton(theme_service_)); | 86 close_button_.reset(CustomDrawButton::CloseButtonBar(theme_service_)); |
87 gtk_util::CenterWidgetInHBox(hbox_, close_button_->widget(), true, 0); | 87 gtk_util::CenterWidgetInHBox(hbox_, close_button_->widget(), true, 0); |
88 signals_->Connect(close_button_->widget(), "clicked", | 88 signals_->Connect(close_button_->widget(), "clicked", |
89 G_CALLBACK(OnCloseButtonThunk), this); | 89 G_CALLBACK(OnCloseButtonThunk), this); |
90 | 90 |
91 widget_.Own(gtk_expanded_container_new()); | 91 widget_.Own(gtk_expanded_container_new()); |
92 gtk_container_add(GTK_CONTAINER(widget_.get()), bg_box_); | 92 gtk_container_add(GTK_CONTAINER(widget_.get()), bg_box_); |
93 gtk_widget_set_size_request(widget_.get(), -1, 0); | 93 gtk_widget_set_size_request(widget_.get(), -1, 0); |
94 | 94 |
95 g_signal_connect(widget_.get(), "child-size-request", | 95 g_signal_connect(widget_.get(), "child-size-request", |
96 G_CALLBACK(OnChildSizeRequestThunk), | 96 G_CALLBACK(OnChildSizeRequestThunk), |
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
306 const content::NotificationSource& source, | 306 const content::NotificationSource& source, |
307 const content::NotificationDetails& details) { | 307 const content::NotificationDetails& details) { |
308 UpdateBorderColor(); | 308 UpdateBorderColor(); |
309 } | 309 } |
310 | 310 |
311 void InfoBarGtk::OnChildSizeRequest(GtkWidget* expanded, | 311 void InfoBarGtk::OnChildSizeRequest(GtkWidget* expanded, |
312 GtkWidget* child, | 312 GtkWidget* child, |
313 GtkRequisition* requisition) { | 313 GtkRequisition* requisition) { |
314 requisition->height = -1; | 314 requisition->height = -1; |
315 } | 315 } |
OLD | NEW |