| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/gtk/translate/translate_infobar_base_gtk.h" | 5 #include "chrome/browser/gtk/translate/translate_infobar_base_gtk.h" |
| 6 | 6 |
| 7 #include "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
| 8 #include "app/slide_animation.h" | 8 #include "app/slide_animation.h" |
| 9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
| 10 #include "chrome/browser/translate/options_menu_model.h" | 10 #include "chrome/browser/translate/options_menu_model.h" |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 } | 117 } |
| 118 } | 118 } |
| 119 | 119 |
| 120 void TranslateInfoBarBase::AnimationProgressed(const Animation* animation) { | 120 void TranslateInfoBarBase::AnimationProgressed(const Animation* animation) { |
| 121 DCHECK(animation == background_color_animation_.get()); | 121 DCHECK(animation == background_color_animation_.get()); |
| 122 background_error_percent_ = animation->GetCurrentValue(); | 122 background_error_percent_ = animation->GetCurrentValue(); |
| 123 // Queue the info bar widget for redisplay so it repaints its background. | 123 // Queue the info bar widget for redisplay so it repaints its background. |
| 124 gtk_widget_queue_draw(widget()); | 124 gtk_widget_queue_draw(widget()); |
| 125 } | 125 } |
| 126 | 126 |
| 127 bool TranslateInfoBarBase::ShowOptionsMenuButton() const { |
| 128 return false; |
| 129 } |
| 130 |
| 127 GtkWidget* TranslateInfoBarBase::CreateLabel(const std::string& text) { | 131 GtkWidget* TranslateInfoBarBase::CreateLabel(const std::string& text) { |
| 128 GtkWidget* label = gtk_label_new(text.c_str()); | 132 GtkWidget* label = gtk_label_new(text.c_str()); |
| 129 gtk_widget_modify_fg(label, GTK_STATE_NORMAL, >k_util::kGdkBlack); | 133 gtk_widget_modify_fg(label, GTK_STATE_NORMAL, >k_util::kGdkBlack); |
| 130 return label; | 134 return label; |
| 131 } | 135 } |
| 132 | 136 |
| 133 GtkWidget* TranslateInfoBarBase::CreateLanguageCombobox(int selected_language, | 137 GtkWidget* TranslateInfoBarBase::CreateLanguageCombobox(int selected_language, |
| 134 int exclude_language) { | 138 int exclude_language) { |
| 135 GtkListStore* model = gtk_list_store_new(LANGUAGE_COMBO_COLUMN_COUNT, | 139 GtkListStore* model = gtk_list_store_new(LANGUAGE_COMBO_COLUMN_COUNT, |
| 136 G_TYPE_INT, G_TYPE_STRING); | 140 G_TYPE_INT, G_TYPE_STRING); |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 228 break; | 232 break; |
| 229 default: | 233 default: |
| 230 NOTREACHED(); | 234 NOTREACHED(); |
| 231 } | 235 } |
| 232 infobar->Init(); | 236 infobar->Init(); |
| 233 // Set |infobar_view_| so that the model can notify the infobar when it | 237 // Set |infobar_view_| so that the model can notify the infobar when it |
| 234 // changes. | 238 // changes. |
| 235 infobar_view_ = infobar; | 239 infobar_view_ = infobar; |
| 236 return infobar; | 240 return infobar; |
| 237 } | 241 } |
| OLD | NEW |