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

Side by Side Diff: content/renderer/accessibility/render_accessibility_impl.cc

Issue 2474363002: MacViews/a11y: Accessibility actions use AXActionData in AXPlatformNodeDelegate. (Closed)
Patch Set: Review comments. Created 4 years 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 (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 "content/renderer/accessibility/render_accessibility_impl.h" 5 #include "content/renderer/accessibility/render_accessibility_impl.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <queue> 10 #include <queue>
(...skipping 432 matching lines...) Expand 10 before | Expand all | Expand 10 after
443 443
444 WebAXObject root = document.accessibilityObject(); 444 WebAXObject root = document.accessibilityObject();
445 if (!root.updateLayoutAndCheckValidity()) 445 if (!root.updateLayoutAndCheckValidity())
446 return; 446 return;
447 447
448 WebAXObject target = document.accessibilityObjectFromID(data.target_node_id); 448 WebAXObject target = document.accessibilityObjectFromID(data.target_node_id);
449 WebAXObject anchor = document.accessibilityObjectFromID(data.anchor_node_id); 449 WebAXObject anchor = document.accessibilityObjectFromID(data.anchor_node_id);
450 WebAXObject focus = document.accessibilityObjectFromID(data.focus_node_id); 450 WebAXObject focus = document.accessibilityObjectFromID(data.focus_node_id);
451 451
452 switch (data.action) { 452 switch (data.action) {
453 case ui::AX_ACTION_BLUR:
454 target.setFocused(false);
455 break;
453 case ui::AX_ACTION_DECREMENT: 456 case ui::AX_ACTION_DECREMENT:
454 target.decrement(); 457 target.decrement();
455 break; 458 break;
456 case ui::AX_ACTION_DO_DEFAULT: 459 case ui::AX_ACTION_DO_DEFAULT:
457 target.performDefaultAction(); 460 target.performDefaultAction();
458 break; 461 break;
459 case ui::AX_ACTION_HIT_TEST: 462 case ui::AX_ACTION_HIT_TEST:
460 OnHitTest(data.target_point); 463 OnHitTest(data.target_point);
461 break; 464 break;
462 case ui::AX_ACTION_INCREMENT: 465 case ui::AX_ACTION_INCREMENT:
463 target.increment(); 466 target.increment();
464 break; 467 break;
465 case ui::AX_ACTION_SCROLL_TO_MAKE_VISIBLE: 468 case ui::AX_ACTION_SCROLL_TO_MAKE_VISIBLE:
466 target.scrollToMakeVisibleWithSubFocus( 469 target.scrollToMakeVisibleWithSubFocus(
467 WebRect(data.target_rect.x(), data.target_rect.y(), 470 WebRect(data.target_rect.x(), data.target_rect.y(),
468 data.target_rect.width(), data.target_rect.height())); 471 data.target_rect.width(), data.target_rect.height()));
469 break; 472 break;
470 case ui::AX_ACTION_SCROLL_TO_POINT: 473 case ui::AX_ACTION_SCROLL_TO_POINT:
471 target.scrollToGlobalPoint( 474 target.scrollToGlobalPoint(
472 WebPoint(data.target_point.x(), data.target_point.y())); 475 WebPoint(data.target_point.x(), data.target_point.y()));
473 break; 476 break;
474 case ui::AX_ACTION_SET_ACCESSIBILITY_FOCUS: 477 case ui::AX_ACTION_SET_ACCESSIBILITY_FOCUS:
475 OnSetAccessibilityFocus(target); 478 OnSetAccessibilityFocus(target);
476 break; 479 break;
477 case ui::AX_ACTION_SET_FOCUS: 480 case ui::AX_ACTION_FOCUS:
478 // By convention, calling SetFocus on the root of the tree should 481 // By convention, calling SetFocus on the root of the tree should
479 // clear the current focus. Otherwise set the focus to the new node. 482 // clear the current focus. Otherwise set the focus to the new node.
480 if (data.target_node_id == root.axID()) 483 if (data.target_node_id == root.axID())
481 render_frame_->GetRenderView()->GetWebView()->clearFocusedElement(); 484 render_frame_->GetRenderView()->GetWebView()->clearFocusedElement();
482 else 485 else
483 target.setFocused(true); 486 target.setFocused(true);
484 break; 487 break;
485 case ui::AX_ACTION_SET_SCROLL_OFFSET: 488 case ui::AX_ACTION_SET_SCROLL_OFFSET:
486 target.setScrollOffset( 489 target.setScrollOffset(
487 WebPoint(data.target_point.x(), data.target_point.y())); 490 WebPoint(data.target_point.x(), data.target_point.y()));
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
635 638
636 const WebDocument& document = GetMainDocument(); 639 const WebDocument& document = GetMainDocument();
637 if (document.isNull()) 640 if (document.isNull())
638 return; 641 return;
639 642
640 document.accessibilityObject().scrollToMakeVisibleWithSubFocus( 643 document.accessibilityObject().scrollToMakeVisibleWithSubFocus(
641 WebRect(bounds.x(), bounds.y(), bounds.width(), bounds.height())); 644 WebRect(bounds.x(), bounds.y(), bounds.width(), bounds.height()));
642 } 645 }
643 646
644 } // namespace content 647 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/accessibility/browser_accessibility_manager.cc ('k') | ui/accessibility/ax_enums.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698