Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(391)

Side by Side Diff: chrome/browser/ui/gtk/infobars/infobar_gtk.cc

Issue 15067008: [InfoBar] Add InfoBarDelegate::GetIconID() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Nit fixes redux Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 0, 0, kLeftPadding, kRightPadding); 84 0, 0, kLeftPadding, kRightPadding);
85 85
86 bg_box_ = gtk_event_box_new(); 86 bg_box_ = gtk_event_box_new();
87 gtk_widget_set_app_paintable(bg_box_, TRUE); 87 gtk_widget_set_app_paintable(bg_box_, TRUE);
88 g_signal_connect(bg_box_, "expose-event", 88 g_signal_connect(bg_box_, "expose-event",
89 G_CALLBACK(OnBackgroundExposeThunk), this); 89 G_CALLBACK(OnBackgroundExposeThunk), this);
90 gtk_container_add(GTK_CONTAINER(padding), hbox_); 90 gtk_container_add(GTK_CONTAINER(padding), hbox_);
91 gtk_container_add(GTK_CONTAINER(bg_box_), padding); 91 gtk_container_add(GTK_CONTAINER(bg_box_), padding);
92 92
93 // Add the icon on the left, if any. 93 // Add the icon on the left, if any.
94 gfx::Image* icon = delegate()->GetIcon(); 94 gfx::Image icon = delegate()->GetIcon();
95 if (icon) { 95 if (!icon.IsEmpty()) {
96 GtkWidget* image = gtk_image_new_from_pixbuf(icon->ToGdkPixbuf()); 96 GtkWidget* image = gtk_image_new_from_pixbuf(icon.ToGdkPixbuf());
97 97
98 gtk_misc_set_alignment(GTK_MISC(image), 0.5, 0.5); 98 gtk_misc_set_alignment(GTK_MISC(image), 0.5, 0.5);
99 99
100 gtk_box_pack_start(GTK_BOX(hbox_), image, FALSE, FALSE, 0); 100 gtk_box_pack_start(GTK_BOX(hbox_), image, FALSE, FALSE, 0);
101 } 101 }
102 102
103 close_button_.reset(CustomDrawButton::CloseButtonBar(theme_service_)); 103 close_button_.reset(CustomDrawButton::CloseButtonBar(theme_service_));
104 gtk_util::CenterWidgetInHBox(hbox_, close_button_->widget(), true, 0); 104 gtk_util::CenterWidgetInHBox(hbox_, close_button_->widget(), true, 0);
105 signals_->Connect(close_button_->widget(), "clicked", 105 signals_->Connect(close_button_->widget(), "clicked",
106 G_CALLBACK(OnCloseButtonThunk), this); 106 G_CALLBACK(OnCloseButtonThunk), this);
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after
334 } 334 }
335 335
336 return FALSE; 336 return FALSE;
337 } 337 }
338 338
339 void InfoBarGtk::OnChildSizeRequest(GtkWidget* expanded, 339 void InfoBarGtk::OnChildSizeRequest(GtkWidget* expanded,
340 GtkWidget* child, 340 GtkWidget* child,
341 GtkRequisition* requisition) { 341 GtkRequisition* requisition) {
342 requisition->height = -1; 342 requisition->height = -1;
343 } 343 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/extensions/app_metro_infobar_delegate_win.cc ('k') | chrome/browser/ui/hung_plugin_tab_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698