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

Side by Side Diff: chrome/browser/chromeos/arc/accessibility/arc_accessibility_helper_bridge.cc

Issue 2873373005: Add custom action support (Closed)
Patch Set: Fix format. Created 3 years, 6 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
OLDNEW
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
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 if (data.action == ui::AX_ACTION_CUSTOM_ACTION) {
212 auto* instance = ARC_GET_INSTANCE_FOR_METHOD(
213 arc_bridge_service()->accessibility_helper(), PerformCustomAction);
214 instance->PerformCustomAction(data.target_node_id, data.custom_action_id);
215 return;
216 }
217
211 arc::mojom::AccessibilityActionType mojo_action; 218 arc::mojom::AccessibilityActionType mojo_action;
212 switch (data.action) { 219 switch (data.action) {
213 case ui::AX_ACTION_DO_DEFAULT: 220 case ui::AX_ACTION_DO_DEFAULT:
214 mojo_action = arc::mojom::AccessibilityActionType::CLICK; 221 mojo_action = arc::mojom::AccessibilityActionType::CLICK;
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(
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698