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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
56 } | 56 } |
57 | 57 |
58 ~SelectableHoverHighlightView() override {} | 58 ~SelectableHoverHighlightView() override {} |
59 | 59 |
60 protected: | 60 protected: |
61 // views::View: | 61 // views::View: |
62 void GetAccessibleNodeData(ui::AXNodeData* node_data) override { | 62 void GetAccessibleNodeData(ui::AXNodeData* node_data) override { |
63 HoverHighlightView::GetAccessibleNodeData(node_data); | 63 HoverHighlightView::GetAccessibleNodeData(node_data); |
64 node_data->role = ui::AX_ROLE_CHECK_BOX; | 64 node_data->role = ui::AX_ROLE_CHECK_BOX; |
65 if (selected_) | 65 if (selected_) |
66 node_data->AddStateFlag(ui::AX_STATE_CHECKED); | 66 node_data->AddIntAttribute(ui::AX_ATTR_CHECKED_STATE, |
67 ui::AX_CHECKED_STATE_FALSE); | |
dmazzoni
2017/02/28 00:10:50
nit: line continuations are indented 4 spaces - bu
| |
67 } | 68 } |
68 | 69 |
69 private: | 70 private: |
70 bool selected_; | 71 bool selected_; |
71 | 72 |
72 DISALLOW_COPY_AND_ASSIGN(SelectableHoverHighlightView); | 73 DISALLOW_COPY_AND_ASSIGN(SelectableHoverHighlightView); |
73 }; | 74 }; |
74 | 75 |
75 // The IME list item view used in the material design. It contains IME info | 76 // The IME list item view used in the material design. It contains IME info |
76 // (name and label) and a check button if the item is selected. It's also used | 77 // (name and label) and a check button if the item is selected. It's also used |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
150 | 151 |
151 void OnFocus() override { | 152 void OnFocus() override { |
152 ActionableView::OnFocus(); | 153 ActionableView::OnFocus(); |
153 if (ime_list_view_ && ime_list_view_->scroll_content()) | 154 if (ime_list_view_ && ime_list_view_->scroll_content()) |
154 ime_list_view_->scroll_content()->ScrollRectToVisible(bounds()); | 155 ime_list_view_->scroll_content()->ScrollRectToVisible(bounds()); |
155 } | 156 } |
156 | 157 |
157 void GetAccessibleNodeData(ui::AXNodeData* node_data) override { | 158 void GetAccessibleNodeData(ui::AXNodeData* node_data) override { |
158 ActionableView::GetAccessibleNodeData(node_data); | 159 ActionableView::GetAccessibleNodeData(node_data); |
159 node_data->role = ui::AX_ROLE_CHECK_BOX; | 160 node_data->role = ui::AX_ROLE_CHECK_BOX; |
160 node_data->AddStateFlag(selected_ ? ui::AX_STATE_CHECKED | 161 if (selected_) { |
161 : ui::AX_STATE_NONE); | 162 node_data->AddIntAttribute(ui::AX_ATTR_CHECKED_STATE, |
163 ui::AX_CHECKED_STATE_FALSE); | |
164 } | |
162 } | 165 } |
163 | 166 |
164 private: | 167 private: |
165 ImeListView* ime_list_view_; | 168 ImeListView* ime_list_view_; |
166 bool selected_; | 169 bool selected_; |
167 | 170 |
168 DISALLOW_COPY_AND_ASSIGN(ImeListItemView); | 171 DISALLOW_COPY_AND_ASSIGN(ImeListItemView); |
169 }; | 172 }; |
170 | 173 |
171 } // namespace | 174 } // namespace |
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
460 ImeListViewTestApi::ImeListViewTestApi(ImeListView* ime_list_view) | 463 ImeListViewTestApi::ImeListViewTestApi(ImeListView* ime_list_view) |
461 : ime_list_view_(ime_list_view) {} | 464 : ime_list_view_(ime_list_view) {} |
462 | 465 |
463 ImeListViewTestApi::~ImeListViewTestApi() {} | 466 ImeListViewTestApi::~ImeListViewTestApi() {} |
464 | 467 |
465 views::View* ImeListViewTestApi::GetToggleView() const { | 468 views::View* ImeListViewTestApi::GetToggleView() const { |
466 return ime_list_view_->material_keyboard_status_view_->toggle(); | 469 return ime_list_view_->material_keyboard_status_view_->toggle(); |
467 } | 470 } |
468 | 471 |
469 } // namespace ash | 472 } // namespace ash |
OLD | NEW |