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

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: 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..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);

Powered by Google App Engine
This is Rietveld 408576698