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

Side by Side Diff: ui/views/controls/button/custom_button.cc

Issue 2863703003: A11y: Rename AXSupportedAction to AXDefaultActionVerb. (Closed)
Patch Set: Rebase. Created 3 years, 7 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
« no previous file with comments | « ui/views/controls/button/checkbox.cc ('k') | ui/views/controls/button/menu_button.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 "ui/views/controls/button/custom_button.h" 5 #include "ui/views/controls/button/custom_button.h"
6 6
7 #include "ui/accessibility/ax_node_data.h" 7 #include "ui/accessibility/ax_node_data.h"
8 #include "ui/events/event.h" 8 #include "ui/events/event.h"
9 #include "ui/events/event_utils.h" 9 #include "ui/events/event_utils.h"
10 #include "ui/events/keycodes/keyboard_codes.h" 10 #include "ui/events/keycodes/keyboard_codes.h"
(...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after
363 break; 363 break;
364 case STATE_DISABLED: 364 case STATE_DISABLED:
365 node_data->AddState(ui::AX_STATE_DISABLED); 365 node_data->AddState(ui::AX_STATE_DISABLED);
366 break; 366 break;
367 case STATE_NORMAL: 367 case STATE_NORMAL:
368 case STATE_COUNT: 368 case STATE_COUNT:
369 // No additional accessibility node_data set for this button node_data. 369 // No additional accessibility node_data set for this button node_data.
370 break; 370 break;
371 } 371 }
372 if (enabled()) { 372 if (enabled()) {
373 node_data->AddIntAttribute(ui::AX_ATTR_ACTION, 373 node_data->AddIntAttribute(ui::AX_ATTR_DEFAULT_ACTION_VERB,
374 ui::AX_SUPPORTED_ACTION_PRESS); 374 ui::AX_DEFAULT_ACTION_VERB_PRESS);
375 } 375 }
376 } 376 }
377 377
378 void CustomButton::VisibilityChanged(View* starting_from, bool visible) { 378 void CustomButton::VisibilityChanged(View* starting_from, bool visible) {
379 Button::VisibilityChanged(starting_from, visible); 379 Button::VisibilityChanged(starting_from, visible);
380 if (state_ == STATE_DISABLED) 380 if (state_ == STATE_DISABLED)
381 return; 381 return;
382 SetState(visible && ShouldEnterHoveredState() ? STATE_HOVERED : STATE_NORMAL); 382 SetState(visible && ShouldEnterHoveredState() ? STATE_HOVERED : STATE_NORMAL);
383 } 383 }
384 384
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
491 views::InkDropState::ACTION_PENDING || 491 views::InkDropState::ACTION_PENDING ||
492 GetInkDrop()->GetTargetInkDropState() == 492 GetInkDrop()->GetTargetInkDropState() ==
493 views::InkDropState::ALTERNATE_ACTION_PENDING) { 493 views::InkDropState::ALTERNATE_ACTION_PENDING) {
494 AnimateInkDrop(views::InkDropState::HIDDEN, 494 AnimateInkDrop(views::InkDropState::HIDDEN,
495 ui::LocatedEvent::FromIfValid(&event)); 495 ui::LocatedEvent::FromIfValid(&event));
496 } 496 }
497 Button::OnClickCanceled(event); 497 Button::OnClickCanceled(event);
498 } 498 }
499 499
500 } // namespace views 500 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/controls/button/checkbox.cc ('k') | ui/views/controls/button/menu_button.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698