| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "chrome/browser/ui/aura/accessibility/automation_manager_aura.h" | 5 #include "chrome/browser/ui/aura/accessibility/automation_manager_aura.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 } | 85 } |
| 86 | 86 |
| 87 void AutomationManagerAura::PerformAction( | 87 void AutomationManagerAura::PerformAction( |
| 88 const ui::AXActionData& data) { | 88 const ui::AXActionData& data) { |
| 89 CHECK(enabled_); | 89 CHECK(enabled_); |
| 90 | 90 |
| 91 switch (data.action) { | 91 switch (data.action) { |
| 92 case ui::AX_ACTION_DO_DEFAULT: | 92 case ui::AX_ACTION_DO_DEFAULT: |
| 93 current_tree_->DoDefault(data.target_node_id); | 93 current_tree_->DoDefault(data.target_node_id); |
| 94 break; | 94 break; |
| 95 case ui::AX_ACTION_SET_FOCUS: | 95 case ui::AX_ACTION_FOCUS: |
| 96 current_tree_->Focus(data.target_node_id); | 96 current_tree_->Focus(data.target_node_id); |
| 97 break; | 97 break; |
| 98 case ui::AX_ACTION_SCROLL_TO_MAKE_VISIBLE: | 98 case ui::AX_ACTION_SCROLL_TO_MAKE_VISIBLE: |
| 99 current_tree_->MakeVisible(data.target_node_id); | 99 current_tree_->MakeVisible(data.target_node_id); |
| 100 break; | 100 break; |
| 101 case ui::AX_ACTION_SET_SELECTION: | 101 case ui::AX_ACTION_SET_SELECTION: |
| 102 if (data.anchor_node_id != data.focus_node_id) { | 102 if (data.anchor_node_id != data.focus_node_id) { |
| 103 NOTREACHED(); | 103 NOTREACHED(); |
| 104 return; | 104 return; |
| 105 } | 105 } |
| 106 current_tree_->SetSelection( | 106 current_tree_->SetSelection( |
| 107 data.anchor_node_id, data.anchor_offset, data.focus_offset); | 107 data.anchor_node_id, data.anchor_offset, data.focus_offset); |
| 108 break; | 108 break; |
| 109 case ui::AX_ACTION_SHOW_CONTEXT_MENU: | 109 case ui::AX_ACTION_SHOW_CONTEXT_MENU: |
| 110 current_tree_->ShowContextMenu(data.target_node_id); | 110 current_tree_->ShowContextMenu(data.target_node_id); |
| 111 break; | 111 break; |
| 112 case ui::AX_ACTION_SET_ACCESSIBILITY_FOCUS: | 112 case ui::AX_ACTION_SET_ACCESSIBILITY_FOCUS: |
| 113 // Sent by ChromeVox but doesn't need to be handled by aura. | 113 // Sent by ChromeVox but doesn't need to be handled by aura. |
| 114 break; | 114 break; |
| 115 case ui::AX_ACTION_SET_SEQUENTIAL_FOCUS_NAVIGATION_STARTING_POINT: | 115 case ui::AX_ACTION_SET_SEQUENTIAL_FOCUS_NAVIGATION_STARTING_POINT: |
| 116 // Sent by ChromeVox but doesn't need to be handled by aura. | 116 // Sent by ChromeVox but doesn't need to be handled by aura. |
| 117 break; | 117 break; |
| 118 case ui::AX_ACTION_BLUR: |
| 118 case ui::AX_ACTION_DECREMENT: | 119 case ui::AX_ACTION_DECREMENT: |
| 119 case ui::AX_ACTION_HIT_TEST: | 120 case ui::AX_ACTION_HIT_TEST: |
| 120 case ui::AX_ACTION_INCREMENT: | 121 case ui::AX_ACTION_INCREMENT: |
| 121 case ui::AX_ACTION_REPLACE_SELECTED_TEXT: | 122 case ui::AX_ACTION_REPLACE_SELECTED_TEXT: |
| 122 case ui::AX_ACTION_SCROLL_TO_POINT: | 123 case ui::AX_ACTION_SCROLL_TO_POINT: |
| 123 case ui::AX_ACTION_SET_SCROLL_OFFSET: | 124 case ui::AX_ACTION_SET_SCROLL_OFFSET: |
| 124 case ui::AX_ACTION_SET_VALUE: | 125 case ui::AX_ACTION_SET_VALUE: |
| 125 // Not implemented yet. | 126 // Not implemented yet. |
| 126 NOTREACHED(); | 127 NOTREACHED(); |
| 127 break; | 128 break; |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 192 | 193 |
| 193 processing_events_ = false; | 194 processing_events_ = false; |
| 194 auto pending_events_copy = pending_events_; | 195 auto pending_events_copy = pending_events_; |
| 195 pending_events_.clear(); | 196 pending_events_.clear(); |
| 196 for (size_t i = 0; i < pending_events_copy.size(); ++i) { | 197 for (size_t i = 0; i < pending_events_copy.size(); ++i) { |
| 197 SendEvent(context, | 198 SendEvent(context, |
| 198 pending_events_copy[i].first, | 199 pending_events_copy[i].first, |
| 199 pending_events_copy[i].second); | 200 pending_events_copy[i].second); |
| 200 } | 201 } |
| 201 } | 202 } |
| OLD | NEW |