Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(176)

Side by Side Diff: ash/system/tray/hover_highlight_view.cc

Issue 2694903010: AX checked state changes (Closed)
Patch Set: git cl try Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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/tray/hover_highlight_view.h" 5 #include "ash/system/tray/hover_highlight_view.h"
6 6
7 #include "ash/resources/vector_icons/vector_icons.h" 7 #include "ash/resources/vector_icons/vector_icons.h"
8 #include "ash/system/tray/tray_constants.h" 8 #include "ash/system/tray/tray_constants.h"
9 #include "ash/system/tray/tray_popup_utils.h" 9 #include "ash/system/tray/tray_popup_utils.h"
10 #include "ash/system/tray/tri_view.h" 10 #include "ash/system/tray/tri_view.h"
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after
206 bool HoverHighlightView::PerformAction(const ui::Event& event) { 206 bool HoverHighlightView::PerformAction(const ui::Event& event) {
207 if (!listener_) 207 if (!listener_)
208 return false; 208 return false;
209 listener_->OnViewClicked(this); 209 listener_->OnViewClicked(this);
210 return true; 210 return true;
211 } 211 }
212 212
213 void HoverHighlightView::GetAccessibleNodeData(ui::AXNodeData* node_data) { 213 void HoverHighlightView::GetAccessibleNodeData(ui::AXNodeData* node_data) {
214 ActionableView::GetAccessibleNodeData(node_data); 214 ActionableView::GetAccessibleNodeData(node_data);
215 215
216 if (accessibility_state_ == AccessibilityState::CHECKED_CHECKBOX || 216 ui::AXCheckedState checked_state;
217 accessibility_state_ == AccessibilityState::UNCHECKED_CHECKBOX) {
218 node_data->role = ui::AX_ROLE_CHECK_BOX;
219 }
220 217
221 if (accessibility_state_ == AccessibilityState::CHECKED_CHECKBOX) 218 if (accessibility_state_ == AccessibilityState::CHECKED_CHECKBOX)
222 node_data->AddStateFlag(ui::AX_STATE_CHECKED); 219 checked_state = ui::AX_CHECKED_STATE_TRUE;
220 else if (accessibility_state_ == AccessibilityState::UNCHECKED_CHECKBOX)
221 checked_state = ui::AX_CHECKED_STATE_FALSE;
222 else
223 return; // Not a checkbox
224
225 // Checkbox
226 node_data->role = ui::AX_ROLE_CHECK_BOX;
227 node_data->AddIntAttribute(ui::AX_ATTR_CHECKED_STATE, checked_state);
223 } 228 }
224 229
225 gfx::Size HoverHighlightView::GetPreferredSize() const { 230 gfx::Size HoverHighlightView::GetPreferredSize() const {
226 gfx::Size size = ActionableView::GetPreferredSize(); 231 gfx::Size size = ActionableView::GetPreferredSize();
227 232
228 if (custom_height_) 233 if (custom_height_)
229 size.set_height(custom_height_); 234 size.set_height(custom_height_);
230 else if (!expandable_ || size.height() < kTrayPopupItemMinHeight) 235 else if (!expandable_ || size.height() < kTrayPopupItemMinHeight)
231 size.set_height(kTrayPopupItemMinHeight); 236 size.set_height(kTrayPopupItemMinHeight);
232 237
(...skipping 12 matching lines...) Expand all
245 if (right_view_) 250 if (right_view_)
246 right_view_->SetEnabled(enabled()); 251 right_view_->SetEnabled(enabled());
247 } 252 }
248 253
249 void HoverHighlightView::OnFocus() { 254 void HoverHighlightView::OnFocus() {
250 ScrollRectToVisible(gfx::Rect(gfx::Point(), size())); 255 ScrollRectToVisible(gfx::Rect(gfx::Point(), size()));
251 ActionableView::OnFocus(); 256 ActionableView::OnFocus();
252 } 257 }
253 258
254 } // namespace ash 259 } // namespace ash
OLDNEW
« no previous file with comments | « ash/system/ime_menu/ime_menu_tray_unittest.cc ('k') | chrome/browser/chromeos/arc/accessibility/ax_tree_source_arc.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698