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/system/tray/hover_highlight_view.h" | 8 #include "ash/common/system/tray/hover_highlight_view.h" |
9 #include "ash/common/system/tray/ime_info.h" | 9 #include "ash/common/system/tray/ime_info.h" |
10 #include "ash/common/system/tray/system_menu_button.h" | 10 #include "ash/common/system/tray/system_menu_button.h" |
11 #include "ash/common/system/tray/system_tray_delegate.h" | 11 #include "ash/common/system/tray/system_tray_delegate.h" |
12 #include "ash/common/system/tray/tray_constants.h" | 12 #include "ash/common/system/tray/tray_constants.h" |
13 #include "ash/common/system/tray/tray_details_view.h" | 13 #include "ash/common/system/tray/tray_details_view.h" |
14 #include "ash/common/system/tray/tray_popup_header_button.h" | 14 #include "ash/common/system/tray/tray_popup_header_button.h" |
15 #include "ash/common/system/tray/tray_popup_item_style.h" | 15 #include "ash/common/system/tray/tray_popup_item_style.h" |
16 #include "ash/common/system/tray/tray_popup_utils.h" | 16 #include "ash/common/system/tray/tray_popup_utils.h" |
17 #include "ash/common/system/tray/tri_view.h" | 17 #include "ash/common/system/tray/tri_view.h" |
18 #include "ash/common/wm_shell.h" | 18 #include "ash/common/wm_shell.h" |
19 #include "ash/resources/grit/ash_resources.h" | 19 #include "ash/resources/grit/ash_resources.h" |
| 20 #include "ash/resources/vector_icons/vector_icons.h" |
20 #include "ash/strings/grit/ash_strings.h" | 21 #include "ash/strings/grit/ash_strings.h" |
21 #include "ui/accessibility/ax_node_data.h" | 22 #include "ui/accessibility/ax_node_data.h" |
22 #include "ui/base/l10n/l10n_util.h" | 23 #include "ui/base/l10n/l10n_util.h" |
23 #include "ui/base/resource/resource_bundle.h" | 24 #include "ui/base/resource/resource_bundle.h" |
24 #include "ui/gfx/color_palette.h" | 25 #include "ui/gfx/color_palette.h" |
25 #include "ui/gfx/paint_vector_icon.h" | 26 #include "ui/gfx/paint_vector_icon.h" |
26 #include "ui/gfx/vector_icons_public.h" | |
27 #include "ui/keyboard/keyboard_util.h" | 27 #include "ui/keyboard/keyboard_util.h" |
28 #include "ui/views/background.h" | 28 #include "ui/views/background.h" |
29 #include "ui/views/border.h" | 29 #include "ui/views/border.h" |
30 #include "ui/views/controls/button/toggle_button.h" | 30 #include "ui/views/controls/button/toggle_button.h" |
31 #include "ui/views/controls/image_view.h" | 31 #include "ui/views/controls/image_view.h" |
32 #include "ui/views/controls/label.h" | 32 #include "ui/views/controls/label.h" |
33 #include "ui/views/controls/separator.h" | 33 #include "ui/views/controls/separator.h" |
34 #include "ui/views/layout/fill_layout.h" | 34 #include "ui/views/layout/fill_layout.h" |
35 #include "ui/views/painter.h" | 35 #include "ui/views/painter.h" |
36 #include "ui/views/view.h" | 36 #include "ui/views/view.h" |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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. |
128 views::ImageView* checked_image = TrayPopupUtils::CreateMainImageView(); | 128 views::ImageView* checked_image = TrayPopupUtils::CreateMainImageView(); |
129 checked_image->SetImage(gfx::CreateVectorIcon( | 129 checked_image->SetImage( |
130 gfx::VectorIconId::CHECK_CIRCLE, kMenuIconSize, button_color)); | 130 gfx::CreateVectorIcon(kCheckCircleIcon, kMenuIconSize, button_color)); |
131 tri_view->AddView(TriView::Container::END, checked_image); | 131 tri_view->AddView(TriView::Container::END, checked_image); |
132 } | 132 } |
133 SetAccessibleName(label_view->text()); | 133 SetAccessibleName(label_view->text()); |
134 } | 134 } |
135 | 135 |
136 ~ImeListItemView() override {} | 136 ~ImeListItemView() override {} |
137 | 137 |
138 // ActionableView: | 138 // ActionableView: |
139 bool PerformAction(const ui::Event& event) override { | 139 bool PerformAction(const ui::Event& event) override { |
140 if (ime_list_view_->should_focus_ime_after_selection_with_keyboard() && | 140 if (ime_list_view_->should_focus_ime_after_selection_with_keyboard() && |
(...skipping 319 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 |