OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "ash/common/system/chromeos/ime_menu/ime_list_view.h" | 5 #include "ash/common/system/chromeos/ime_menu/ime_list_view.h" |
6 | 6 |
7 #include "ash/common/material_design/material_design_controller.h" | 7 #include "ash/common/material_design/material_design_controller.h" |
8 #include "ash/common/strings/grit/ash_strings.h" | 8 #include "ash/common/strings/grit/ash_strings.h" |
9 #include "ash/common/system/tray/hover_highlight_view.h" | 9 #include "ash/common/system/tray/hover_highlight_view.h" |
10 #include "ash/common/system/tray/ime_info.h" | 10 #include "ash/common/system/tray/ime_info.h" |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 int size_delta = -1; | 107 int size_delta = -1; |
108 while ((id_label->GetPreferredSize().width() - | 108 while ((id_label->GetPreferredSize().width() - |
109 id_label->GetInsets().width()) > kMenuIconSize && | 109 id_label->GetInsets().width()) > kMenuIconSize && |
110 size_delta >= kMinFontSizeDelta) { | 110 size_delta >= kMinFontSizeDelta) { |
111 id_label->SetFontList(base_font_list.DeriveWithSizeDelta(size_delta)); | 111 id_label->SetFontList(base_font_list.DeriveWithSizeDelta(size_delta)); |
112 --size_delta; | 112 --size_delta; |
113 } | 113 } |
114 tri_view->AddView(TriView::Container::START, id_label); | 114 tri_view->AddView(TriView::Container::START, id_label); |
115 | 115 |
116 // The label shows the IME name. | 116 // The label shows the IME name. |
117 auto label_view = TrayPopupUtils::CreateDefaultLabel(); | 117 auto* label_view = TrayPopupUtils::CreateDefaultLabel(); |
118 label_view->SetText(label); | 118 label_view->SetText(label); |
119 TrayPopupItemStyle style( | 119 TrayPopupItemStyle style( |
120 TrayPopupItemStyle::FontStyle::DETAILED_VIEW_LABEL); | 120 TrayPopupItemStyle::FontStyle::DETAILED_VIEW_LABEL); |
121 style.SetupLabel(label_view); | 121 style.SetupLabel(label_view); |
122 | 122 |
123 label_view->SetHorizontalAlignment(gfx::ALIGN_LEFT); | 123 label_view->SetHorizontalAlignment(gfx::ALIGN_LEFT); |
124 tri_view->AddView(TriView::Container::CENTER, label_view); | 124 tri_view->AddView(TriView::Container::CENTER, label_view); |
125 | 125 |
126 if (selected) { | 126 if (selected) { |
127 // The checked button indicates the IME is selected. | 127 // The checked button indicates the IME is selected. |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
198 TriView* tri_view = TrayPopupUtils::CreateDefaultRowView(); | 198 TriView* tri_view = TrayPopupUtils::CreateDefaultRowView(); |
199 AddChildView(tri_view); | 199 AddChildView(tri_view); |
200 | 200 |
201 // The on-screen keyboard image button. | 201 // The on-screen keyboard image button. |
202 views::ImageView* keyboard_image = TrayPopupUtils::CreateMainImageView(); | 202 views::ImageView* keyboard_image = TrayPopupUtils::CreateMainImageView(); |
203 keyboard_image->SetImage(gfx::CreateVectorIcon( | 203 keyboard_image->SetImage(gfx::CreateVectorIcon( |
204 kImeMenuOnScreenKeyboardIcon, kMenuIconSize, kMenuIconColor)); | 204 kImeMenuOnScreenKeyboardIcon, kMenuIconSize, kMenuIconColor)); |
205 tri_view->AddView(TriView::Container::START, keyboard_image); | 205 tri_view->AddView(TriView::Container::START, keyboard_image); |
206 | 206 |
207 // The on-screen keyboard label ('On-screen keyboard'). | 207 // The on-screen keyboard label ('On-screen keyboard'). |
208 auto label = TrayPopupUtils::CreateDefaultLabel(); | 208 auto* label = TrayPopupUtils::CreateDefaultLabel(); |
209 label->SetText(ui::ResourceBundle::GetSharedInstance().GetLocalizedString( | 209 label->SetText(ui::ResourceBundle::GetSharedInstance().GetLocalizedString( |
210 IDS_ASH_STATUS_TRAY_ACCESSIBILITY_VIRTUAL_KEYBOARD)); | 210 IDS_ASH_STATUS_TRAY_ACCESSIBILITY_VIRTUAL_KEYBOARD)); |
211 TrayPopupItemStyle style( | 211 TrayPopupItemStyle style( |
212 TrayPopupItemStyle::FontStyle::DETAILED_VIEW_LABEL); | 212 TrayPopupItemStyle::FontStyle::DETAILED_VIEW_LABEL); |
213 style.SetupLabel(label); | 213 style.SetupLabel(label); |
214 tri_view->AddView(TriView::Container::CENTER, label); | 214 tri_view->AddView(TriView::Container::CENTER, label); |
215 | 215 |
216 // The on-screen keyboard toggle button. | 216 // The on-screen keyboard toggle button. |
217 toggle_ = TrayPopupUtils::CreateToggleButton( | 217 toggle_ = TrayPopupUtils::CreateToggleButton( |
218 listener_, IDS_ASH_STATUS_TRAY_ACCESSIBILITY_VIRTUAL_KEYBOARD); | 218 listener_, IDS_ASH_STATUS_TRAY_ACCESSIBILITY_VIRTUAL_KEYBOARD); |
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
460 ImeListViewTestApi::ImeListViewTestApi(ImeListView* ime_list_view) | 460 ImeListViewTestApi::ImeListViewTestApi(ImeListView* ime_list_view) |
461 : ime_list_view_(ime_list_view) {} | 461 : ime_list_view_(ime_list_view) {} |
462 | 462 |
463 ImeListViewTestApi::~ImeListViewTestApi() {} | 463 ImeListViewTestApi::~ImeListViewTestApi() {} |
464 | 464 |
465 views::View* ImeListViewTestApi::GetToggleView() const { | 465 views::View* ImeListViewTestApi::GetToggleView() const { |
466 return ime_list_view_->material_keyboard_status_view_->toggle(); | 466 return ime_list_view_->material_keyboard_status_view_->toggle(); |
467 } | 467 } |
468 | 468 |
469 } // namespace ash | 469 } // namespace ash |
OLD | NEW |