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/views/infobars/before_translate_infobar.h" | 5 #include "chrome/browser/views/infobars/before_translate_infobar.h" |
6 | 6 |
7 #include "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
8 #include "app/resource_bundle.h" | |
9 #include "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
10 #include "chrome/browser/translate/options_menu_model.h" | 9 #include "chrome/browser/translate/options_menu_model.h" |
11 #include "chrome/browser/translate/translate_infobar_delegate.h" | 10 #include "chrome/browser/translate/translate_infobar_delegate.h" |
12 #include "chrome/browser/views/infobars/infobar_text_button.h" | 11 #include "chrome/browser/views/infobars/infobar_text_button.h" |
13 #include "grit/generated_resources.h" | 12 #include "grit/generated_resources.h" |
14 #include "views/controls/button/menu_button.h" | 13 #include "views/controls/button/menu_button.h" |
15 #include "views/controls/image_view.h" | 14 #include "views/controls/image_view.h" |
16 #include "views/controls/menu/menu_2.h" | 15 #include "views/controls/menu/menu_2.h" |
17 | 16 |
18 BeforeTranslateInfoBar::BeforeTranslateInfoBar( | 17 BeforeTranslateInfoBar::BeforeTranslateInfoBar( |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
165 void BeforeTranslateInfoBar::UpdateOriginalButtonText() { | 164 void BeforeTranslateInfoBar::UpdateOriginalButtonText() { |
166 string16 language = GetDelegate()->GetLanguageDisplayableNameAt( | 165 string16 language = GetDelegate()->GetLanguageDisplayableNameAt( |
167 GetDelegate()->original_language_index()); | 166 GetDelegate()->original_language_index()); |
168 language_menu_button_->SetText(UTF16ToWideHack(language)); | 167 language_menu_button_->SetText(UTF16ToWideHack(language)); |
169 // The following line is necessary for the preferred size to be recomputed. | 168 // The following line is necessary for the preferred size to be recomputed. |
170 language_menu_button_->ClearMaxTextSize(); | 169 language_menu_button_->ClearMaxTextSize(); |
171 // The button may have to grow to show the new text. | 170 // The button may have to grow to show the new text. |
172 Layout(); | 171 Layout(); |
173 SchedulePaint(); | 172 SchedulePaint(); |
174 } | 173 } |
OLD | NEW |