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

Unified Diff: chrome/browser/ui/gtk/infobars/infobar_gtk.cc

Issue 9602007: GTK: Move TranslateInfoBarBase::BuildOptionsMenuButton to InfoBarGtk::CreateMenuButton (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Fix Evan's comments Created 8 years, 10 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 side-by-side diff with in-line comments
Download patch
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..daf48d4c5664d2fb987c14fe4a0b3d85730dbe3b 100644
--- a/chrome/browser/ui/gtk/infobars/infobar_gtk.cc
+++ b/chrome/browser/ui/gtk/infobars/infobar_gtk.cc
@@ -128,6 +128,26 @@ GtkWidget* InfoBarGtk::CreateLinkButton(const std::string& text) {
return theme_service_->BuildChromeLinkButton(text);
}
+// static
+GtkWidget* InfoBarGtk::CreateMenuButton(const std::string& text) {
+ 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);
« no previous file with comments | « chrome/browser/ui/gtk/infobars/infobar_gtk.h ('k') | chrome/browser/ui/gtk/infobars/translate_infobar_base_gtk.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698