Chromium Code Reviews| Index: chrome/browser/ui/gtk/infobars/infobar_gtk.cc |
| diff --git a/chrome/browser/ui/gtk/infobars/infobar_gtk.cc b/chrome/browser/ui/gtk/infobars/infobar_gtk.cc |
| index c8d32c36f58dc3a428ad8d1007dba12fd399f736..117510102b9c49ef36b1c175f10e23ac5cde32f6 100644 |
| --- a/chrome/browser/ui/gtk/infobars/infobar_gtk.cc |
| +++ b/chrome/browser/ui/gtk/infobars/infobar_gtk.cc |
| @@ -128,6 +128,30 @@ GtkWidget* InfoBarGtk::CreateLinkButton(const std::string& text) { |
| return theme_service_->BuildChromeLinkButton(text); |
| } |
| +// static |
| +GtkWidget* InfoBarGtk::CreateMenuButton(const std::string& text) { |
| + // TODO(jeremy): This is a temporary solution, since media stream infobar |
|
Evan Stade
2012/03/05 22:13:51
remove the comment
|
| + // also need to create a device menu button, just copy these code from |
| + // TranslateInfoBarBase::BuildOptionsMenuButton, remove these code when |
| + // a gtk-theme chrome menu button is implemented. |
| + GtkWidget* button = gtk_button_new(); |
| + GtkWidget* former_child = gtk_bin_get_child(GTK_BIN(button)); |
| + if (former_child) |
| + gtk_container_remove(GTK_CONTAINER(button), former_child); |
| + |
| + GtkWidget* hbox = gtk_hbox_new(FALSE, 0); |
| + |
| + GtkWidget* label = gtk_label_new(text.c_str()); |
| + gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); |
| + |
| + GtkWidget* arrow = gtk_arrow_new(GTK_ARROW_DOWN, GTK_SHADOW_NONE); |
| + gtk_box_pack_start(GTK_BOX(hbox), arrow, FALSE, FALSE, 0); |
| + |
| + gtk_container_add(GTK_CONTAINER(button), hbox); |
| + |
| + return button; |
| +} |
| + |
| SkColor InfoBarGtk::ConvertGetColor(ColorGetter getter) { |
| double r, g, b; |
| (this->*getter)(delegate()->GetInfoBarType(), &r, &g, &b); |