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

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

Issue 14327008: Add InitWidgets() phase for GTK infobars. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 7 years, 8 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/translate_infobar_base_gtk.cc
===================================================================
--- chrome/browser/ui/gtk/infobars/translate_infobar_base_gtk.cc (revision 194662)
+++ chrome/browser/ui/gtk/infobars/translate_infobar_base_gtk.cc (working copy)
@@ -58,20 +58,6 @@
TranslateInfoBarBase::~TranslateInfoBarBase() {
}
-void TranslateInfoBarBase::Init() {
- if (!ShowOptionsMenuButton())
- return;
-
- // The options button sits outside the translate_box so that it can be end
- // packed in hbox_.
- 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);
- gtk_util::CenterWidgetInHBox(hbox_, options_menu_button, true, 0);
-}
-
void TranslateInfoBarBase::GetTopColor(InfoBarDelegate::Type type,
double* r, double* g, double* b) {
if (background_error_percent_ <= 0) {
@@ -122,7 +108,24 @@
}
}
+void TranslateInfoBarBase::InitWidgets() {
+ InfoBarGtk::InitWidgets();
+
+ if (!ShowOptionsMenuButton())
+ return;
+
+ // The options button sits outside the translate_box so that it can be end
+ // packed in hbox_.
+ 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);
+ gtk_util::CenterWidgetInHBox(hbox_, options_menu_button, true, 0);
+}
+
void TranslateInfoBarBase::AnimationProgressed(const ui::Animation* animation) {
+ DCHECK(widget());
if (animation == background_color_animation_.get()) {
background_error_percent_ = animation->GetCurrentValue();
// Queue the info bar widget for redisplay so it repaints its background.
@@ -214,6 +217,5 @@
default:
NOTREACHED();
}
- infobar->Init();
return infobar;
}

Powered by Google App Engine
This is Rietveld 408576698