| 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_tab_helper.h" | 9 #include "chrome/browser/infobars/infobar_tab_helper.h" |
| 10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 bg_box_ = gtk_event_box_new(); | 69 bg_box_ = gtk_event_box_new(); |
| 70 gtk_widget_set_app_paintable(bg_box_, TRUE); | 70 gtk_widget_set_app_paintable(bg_box_, TRUE); |
| 71 g_signal_connect(bg_box_, "expose-event", | 71 g_signal_connect(bg_box_, "expose-event", |
| 72 G_CALLBACK(OnBackgroundExposeThunk), this); | 72 G_CALLBACK(OnBackgroundExposeThunk), this); |
| 73 gtk_container_add(GTK_CONTAINER(padding), hbox_); | 73 gtk_container_add(GTK_CONTAINER(padding), hbox_); |
| 74 gtk_container_add(GTK_CONTAINER(bg_box_), padding); | 74 gtk_container_add(GTK_CONTAINER(bg_box_), padding); |
| 75 | 75 |
| 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); | 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::CloseButton(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); |
| (...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 308 const content::NotificationSource& source, | 308 const content::NotificationSource& source, |
| 309 const content::NotificationDetails& details) { | 309 const content::NotificationDetails& details) { |
| 310 UpdateBorderColor(); | 310 UpdateBorderColor(); |
| 311 } | 311 } |
| 312 | 312 |
| 313 void InfoBarGtk::OnChildSizeRequest(GtkWidget* expanded, | 313 void InfoBarGtk::OnChildSizeRequest(GtkWidget* expanded, |
| 314 GtkWidget* child, | 314 GtkWidget* child, |
| 315 GtkRequisition* requisition) { | 315 GtkRequisition* requisition) { |
| 316 requisition->height = -1; | 316 requisition->height = -1; |
| 317 } | 317 } |
| OLD | NEW |