| 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 "base/memory/singleton.h" | 9 #include "base/memory/singleton.h" |
| 10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 views::AXAuraObjWrapper* obj = | 78 views::AXAuraObjWrapper* obj = |
| 79 static_cast<AXRootObjWrapper*>(current_tree_->GetRoot()) | 79 static_cast<AXRootObjWrapper*>(current_tree_->GetRoot()) |
| 80 ->GetAlertForText(text); | 80 ->GetAlertForText(text); |
| 81 SendEvent(context, obj, ui::AX_EVENT_ALERT); | 81 SendEvent(context, obj, ui::AX_EVENT_ALERT); |
| 82 } | 82 } |
| 83 | 83 |
| 84 void AutomationManagerAura::PerformAction( | 84 void AutomationManagerAura::PerformAction( |
| 85 const ui::AXActionData& data) { | 85 const ui::AXActionData& data) { |
| 86 CHECK(enabled_); | 86 CHECK(enabled_); |
| 87 | 87 |
| 88 if (current_tree_->HandleAccessibleAction(data)) { |
| 89 // This accessible action is handled by custom action implemented by the |
| 90 // target view. |
| 91 return; |
| 92 } |
| 93 |
| 88 switch (data.action) { | 94 switch (data.action) { |
| 89 case ui::AX_ACTION_DO_DEFAULT: | 95 case ui::AX_ACTION_DO_DEFAULT: |
| 90 current_tree_->DoDefault(data.target_node_id); | 96 current_tree_->DoDefault(data.target_node_id); |
| 91 break; | 97 break; |
| 92 case ui::AX_ACTION_FOCUS: | 98 case ui::AX_ACTION_FOCUS: |
| 93 current_tree_->Focus(data.target_node_id); | 99 current_tree_->Focus(data.target_node_id); |
| 94 break; | 100 break; |
| 95 case ui::AX_ACTION_SCROLL_TO_MAKE_VISIBLE: | 101 case ui::AX_ACTION_SCROLL_TO_MAKE_VISIBLE: |
| 96 current_tree_->MakeVisible(data.target_node_id); | 102 current_tree_->MakeVisible(data.target_node_id); |
| 97 break; | 103 break; |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 196 | 202 |
| 197 processing_events_ = false; | 203 processing_events_ = false; |
| 198 auto pending_events_copy = pending_events_; | 204 auto pending_events_copy = pending_events_; |
| 199 pending_events_.clear(); | 205 pending_events_.clear(); |
| 200 for (size_t i = 0; i < pending_events_copy.size(); ++i) { | 206 for (size_t i = 0; i < pending_events_copy.size(); ++i) { |
| 201 SendEvent(context, | 207 SendEvent(context, |
| 202 pending_events_copy[i].first, | 208 pending_events_copy[i].first, |
| 203 pending_events_copy[i].second); | 209 pending_events_copy[i].second); |
| 204 } | 210 } |
| 205 } | 211 } |
| OLD | NEW |