| 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/system/ime_menu/ime_list_view.h" | 5 #include "ash/system/ime_menu/ime_list_view.h" |
| 6 | 6 |
| 7 #include "ash/resources/grit/ash_resources.h" | 7 #include "ash/resources/grit/ash_resources.h" |
| 8 #include "ash/resources/vector_icons/vector_icons.h" | 8 #include "ash/resources/vector_icons/vector_icons.h" |
| 9 #include "ash/shell.h" | 9 #include "ash/shell.h" |
| 10 #include "ash/shell_port.h" | 10 #include "ash/shell_port.h" |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 | 112 |
| 113 void OnFocus() override { | 113 void OnFocus() override { |
| 114 ActionableView::OnFocus(); | 114 ActionableView::OnFocus(); |
| 115 if (ime_list_view_ && ime_list_view_->scroll_content()) | 115 if (ime_list_view_ && ime_list_view_->scroll_content()) |
| 116 ime_list_view_->scroll_content()->ScrollRectToVisible(bounds()); | 116 ime_list_view_->scroll_content()->ScrollRectToVisible(bounds()); |
| 117 } | 117 } |
| 118 | 118 |
| 119 void GetAccessibleNodeData(ui::AXNodeData* node_data) override { | 119 void GetAccessibleNodeData(ui::AXNodeData* node_data) override { |
| 120 ActionableView::GetAccessibleNodeData(node_data); | 120 ActionableView::GetAccessibleNodeData(node_data); |
| 121 node_data->role = ui::AX_ROLE_CHECK_BOX; | 121 node_data->role = ui::AX_ROLE_CHECK_BOX; |
| 122 node_data->AddStateFlag(selected_ ? ui::AX_STATE_CHECKED | 122 const ui::AXCheckedState checked_state = |
| 123 : ui::AX_STATE_NONE); | 123 selected_ ? ui::AX_CHECKED_STATE_TRUE : ui::AX_CHECKED_STATE_FALSE; |
| 124 node_data->AddIntAttribute(ui::AX_ATTR_CHECKED_STATE, checked_state); |
| 124 } | 125 } |
| 125 | 126 |
| 126 private: | 127 private: |
| 127 ImeListView* ime_list_view_; | 128 ImeListView* ime_list_view_; |
| 128 bool selected_; | 129 bool selected_; |
| 129 | 130 |
| 130 DISALLOW_COPY_AND_ASSIGN(ImeListItemView); | 131 DISALLOW_COPY_AND_ASSIGN(ImeListItemView); |
| 131 }; | 132 }; |
| 132 | 133 |
| 133 } // namespace | 134 } // namespace |
| (...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 349 ImeListViewTestApi::ImeListViewTestApi(ImeListView* ime_list_view) | 350 ImeListViewTestApi::ImeListViewTestApi(ImeListView* ime_list_view) |
| 350 : ime_list_view_(ime_list_view) {} | 351 : ime_list_view_(ime_list_view) {} |
| 351 | 352 |
| 352 ImeListViewTestApi::~ImeListViewTestApi() {} | 353 ImeListViewTestApi::~ImeListViewTestApi() {} |
| 353 | 354 |
| 354 views::View* ImeListViewTestApi::GetToggleView() const { | 355 views::View* ImeListViewTestApi::GetToggleView() const { |
| 355 return ime_list_view_->keyboard_status_row_->toggle(); | 356 return ime_list_view_->keyboard_status_row_->toggle(); |
| 356 } | 357 } |
| 357 | 358 |
| 358 } // namespace ash | 359 } // namespace ash |
| OLD | NEW |