| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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/chromeos/arc/accessibility/arc_accessibility_helper_bri
dge.h" | 5 #include "chrome/browser/chromeos/arc/accessibility/arc_accessibility_helper_bri
dge.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h" | 10 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h" |
| (...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 201 if (event_data->event_type != | 201 if (event_data->event_type != |
| 202 arc::mojom::AccessibilityEventType::VIEW_FOCUSED) | 202 arc::mojom::AccessibilityEventType::VIEW_FOCUSED) |
| 203 return; | 203 return; |
| 204 | 204 |
| 205 CHECK_EQ(1U, event_data.get()->node_data.size()); | 205 CHECK_EQ(1U, event_data.get()->node_data.size()); |
| 206 DispatchFocusChange(event_data.get()->node_data[0].get()); | 206 DispatchFocusChange(event_data.get()->node_data[0].get()); |
| 207 } | 207 } |
| 208 | 208 |
| 209 void ArcAccessibilityHelperBridge::OnAction( | 209 void ArcAccessibilityHelperBridge::OnAction( |
| 210 const ui::AXActionData& data) const { | 210 const ui::AXActionData& data) const { |
| 211 arc::mojom::AccessibilityActionType mojo_action; | 211 arc::mojom::AccessibilityActionDataPtr action_data = |
| 212 arc::mojom::AccessibilityActionData::New(); |
| 213 |
| 212 switch (data.action) { | 214 switch (data.action) { |
| 213 case ui::AX_ACTION_DO_DEFAULT: | 215 case ui::AX_ACTION_DO_DEFAULT: |
| 214 mojo_action = arc::mojom::AccessibilityActionType::CLICK; | 216 action_data->action_type = arc::mojom::AccessibilityActionType::CLICK; |
| 217 break; |
| 218 case ui::AX_ACTION_CUSTOM_ACTION: |
| 219 action_data->action_type = |
| 220 arc::mojom::AccessibilityActionType::CUSTOM_ACTION; |
| 221 action_data->custom_action_id = data.custom_action_id; |
| 215 break; | 222 break; |
| 216 default: | 223 default: |
| 217 return; | 224 return; |
| 218 } | 225 } |
| 219 | 226 |
| 220 auto* instance = ARC_GET_INSTANCE_FOR_METHOD( | 227 auto* instance = ARC_GET_INSTANCE_FOR_METHOD( |
| 221 arc_bridge_service()->accessibility_helper(), PerformAction); | 228 arc_bridge_service()->accessibility_helper(), PerformAction); |
| 222 instance->PerformAction(data.target_node_id, mojo_action); | 229 instance->PerformAction(data.target_node_id, std::move(action_data)); |
| 223 } | 230 } |
| 224 | 231 |
| 225 void ArcAccessibilityHelperBridge::OnWindowActivated( | 232 void ArcAccessibilityHelperBridge::OnWindowActivated( |
| 226 aura::Window* gained_active, | 233 aura::Window* gained_active, |
| 227 aura::Window* lost_active) { | 234 aura::Window* lost_active) { |
| 228 if (gained_active == lost_active) | 235 if (gained_active == lost_active) |
| 229 return; | 236 return; |
| 230 | 237 |
| 231 if (!GetArcSurface(gained_active)) | 238 if (!GetArcSurface(gained_active)) |
| 232 return; | 239 return; |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 267 break; | 274 break; |
| 268 } | 275 } |
| 269 } | 276 } |
| 270 } | 277 } |
| 271 | 278 |
| 272 void ArcAccessibilityHelperBridge::OnTaskSetActive(int32_t task_id) { | 279 void ArcAccessibilityHelperBridge::OnTaskSetActive(int32_t task_id) { |
| 273 current_task_id_ = task_id; | 280 current_task_id_ = task_id; |
| 274 } | 281 } |
| 275 | 282 |
| 276 } // namespace arc | 283 } // namespace arc |
| OLD | NEW |