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

Unified Diff: chrome/browser/ui/gtk/infobars/translate_infobar_base_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
« no previous file with comments | « chrome/browser/ui/gtk/infobars/translate_infobar_base_gtk.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/gtk/infobars/translate_infobar_base_gtk.cc
diff --git a/chrome/browser/ui/gtk/infobars/translate_infobar_base_gtk.cc b/chrome/browser/ui/gtk/infobars/translate_infobar_base_gtk.cc
index bc33058e558d0a8d180bc6e2342f2802fdb9417d..07ffb5a24f62b072b0951d845e6a3bc80b5afbdf 100644
--- a/chrome/browser/ui/gtk/infobars/translate_infobar_base_gtk.cc
+++ b/chrome/browser/ui/gtk/infobars/translate_infobar_base_gtk.cc
@@ -63,7 +63,8 @@ void TranslateInfoBarBase::Init() {
// The options button sits outside the translate_box so that it can be end
// packed in hbox_.
- GtkWidget* options_menu_button = BuildOptionsMenuButton();
+ GtkWidget* options_menu_button = CreateMenuButton(
+ l10n_util::GetStringUTF8(IDS_TRANSLATE_INFOBAR_OPTIONS));
Signals()->Connect(options_menu_button, "clicked",
G_CALLBACK(&OnOptionsClickedThunk), this);
gtk_widget_show_all(options_menu_button);
@@ -188,27 +189,6 @@ TranslateInfoBarDelegate* TranslateInfoBarBase::GetDelegate() {
return static_cast<TranslateInfoBarDelegate*>(delegate());
}
-// static
-GtkWidget* TranslateInfoBarBase::BuildOptionsMenuButton() {
- 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(
- l10n_util::GetStringUTF8(IDS_TRANSLATE_INFOBAR_OPTIONS).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;
-}
-
void TranslateInfoBarBase::OnOptionsClicked(GtkWidget* sender) {
ShowMenuWithModel(sender, NULL, new OptionsMenuModel(GetDelegate()));
}
« no previous file with comments | « chrome/browser/ui/gtk/infobars/translate_infobar_base_gtk.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698