Chromium Code Reviews| Index: ui/app_list/views/speech_view.cc |
| diff --git a/ui/app_list/views/speech_view.cc b/ui/app_list/views/speech_view.cc |
| index c6bad7c4549b49784b51a01cca22d7698f78adab..e53fdf1a13bd80038e38a722223510d30f7aa95c 100644 |
| --- a/ui/app_list/views/speech_view.cc |
| +++ b/ui/app_list/views/speech_view.cc |
| @@ -27,7 +27,6 @@ namespace { |
| const int kShadowOffset = 1; |
| const int kShadowBlur = 4; |
| const int kSpeechViewMaxHeight = 300; |
| -const int kTextSize = 20; |
| const int kMicButtonMargin = 12; |
| const int kTextMargin = 32; |
| const int kIndicatorRadiusMax = 100; |
| @@ -116,10 +115,11 @@ SpeechView::SpeechView(AppListViewDelegate* delegate) |
| container->AddChildView(mic_button_); |
| // TODO(mukai): use BoundedLabel to cap 2 lines. |
| - speech_result_ = new views::Label(); |
| + ui::ResourceBundle* bundle = &ui::ResourceBundle::GetSharedInstance(); |
|
xiyuan
2014/01/30 03:49:27
Thought "ui::ResourceBundle& rb = ui::ResourceBund
Jun Mukai
2014/01/30 04:02:37
+1 to xiyuan
Yuki
2014/01/30 05:30:35
Our policy is to use a const reference or a pointe
Jun Mukai
2014/01/30 06:00:56
I don't want to argue here and I'm really happy if
Yuki
2014/01/30 06:29:56
Done.
|
| + speech_result_ = new views::Label( |
| + base::string16(), bundle->GetFontList(ui::ResourceBundle::LargeFont)); |
|
Jun Mukai
2014/01/30 04:02:37
Not sure how large is LargeFont. Could you give me
Jun Mukai
2014/01/30 04:10:10
note that the spec says that this text is 20sp. I
xiyuan
2014/01/30 05:18:36
My impression is that ChromeOS base font is define
Yuki
2014/01/30 05:30:35
The current definition of font sizes are as follow
Jun Mukai
2014/01/30 06:00:56
okay, go ahead.
|
| speech_result_->SetHorizontalAlignment(gfx::ALIGN_LEFT); |
| - const gfx::FontList& font_list = speech_result_->font_list(); |
| - speech_result_->SetFontList(font_list.DeriveFontListWithSize(kTextSize)); |
| + |
| speech_result_->SetMultiLine(true); |
| container->AddChildView(speech_result_); |
| @@ -138,12 +138,12 @@ SpeechView::~SpeechView() { |
| } |
| void SpeechView::Reset() { |
| - ui::ResourceBundle& bundle = ui::ResourceBundle::GetSharedInstance(); |
| + ui::ResourceBundle* bundle = &ui::ResourceBundle::GetSharedInstance(); |
|
Jun Mukai
2014/01/30 04:02:37
ditto
Yuki
2014/01/30 06:29:56
Done.
|
| speech_result_->SetText(l10n_util::GetStringUTF16( |
| IDS_APP_LIST_SPEECH_HINT_TEXT)); |
| speech_result_->SetEnabledColor(kHintTextColor); |
| - mic_button_->SetImage(views::Button::STATE_NORMAL, bundle.GetImageSkiaNamed( |
| - IDR_APP_LIST_SPEECH_MIC_ON)); |
| + mic_button_->SetImage(views::Button::STATE_NORMAL, |
| + bundle->GetImageSkiaNamed(IDR_APP_LIST_SPEECH_MIC_ON)); |
| } |
| int SpeechView::GetIndicatorRadius(uint8 level) { |
| @@ -214,9 +214,9 @@ void SpeechView::OnSpeechRecognitionStateChanged( |
| else if (new_state == SPEECH_RECOGNITION_IN_SPEECH) |
| resource_id = IDR_APP_LIST_SPEECH_MIC_RECORDING; |
| - ui::ResourceBundle& bundle = ui::ResourceBundle::GetSharedInstance(); |
| - mic_button_->SetImage(views::Button::STATE_NORMAL, bundle.GetImageSkiaNamed( |
| - resource_id)); |
| + ui::ResourceBundle* bundle = &ui::ResourceBundle::GetSharedInstance(); |
| + mic_button_->SetImage(views::Button::STATE_NORMAL, |
| + bundle->GetImageSkiaNamed(resource_id)); |
| } |
| } // namespace app_list |