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

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

Issue 2873373005: Add custom action support (Closed)
Patch Set: Fix a few files. 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 187 matching lines...) Expand 10 before | Expand all | Expand 10 after
198 if (event_data->event_type != 198 if (event_data->event_type !=
199 arc::mojom::AccessibilityEventType::VIEW_FOCUSED) 199 arc::mojom::AccessibilityEventType::VIEW_FOCUSED)
200 return; 200 return;
201 201
202 CHECK_EQ(1U, event_data.get()->node_data.size()); 202 CHECK_EQ(1U, event_data.get()->node_data.size());
203 DispatchFocusChange(event_data.get()->node_data[0].get()); 203 DispatchFocusChange(event_data.get()->node_data[0].get());
204 } 204 }
205 205
206 void ArcAccessibilityHelperBridge::OnAction( 206 void ArcAccessibilityHelperBridge::OnAction(
207 const ui::AXActionData& data) const { 207 const ui::AXActionData& data) const {
208 if (data.action == ui::AX_ACTION_CUSTOM_ACTION) {
209 auto* instance = ARC_GET_INSTANCE_FOR_METHOD(
210 arc_bridge_service()->accessibility_helper(), PerformCustomAction);
211 instance->PerformCustomAction(data.target_node_id, data.custom_action_id);
212 return;
213 }
214
208 arc::mojom::AccessibilityActionType mojo_action; 215 arc::mojom::AccessibilityActionType mojo_action;
209 switch (data.action) { 216 switch (data.action) {
210 case ui::AX_ACTION_DO_DEFAULT: 217 case ui::AX_ACTION_DO_DEFAULT:
211 mojo_action = arc::mojom::AccessibilityActionType::CLICK; 218 mojo_action = arc::mojom::AccessibilityActionType::CLICK;
212 break; 219 break;
213 default: 220 default:
214 return; 221 return;
215 } 222 }
216 223
217 auto* instance = ARC_GET_INSTANCE_FOR_METHOD( 224 auto* instance = ARC_GET_INSTANCE_FOR_METHOD(
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
264 break; 271 break;
265 } 272 }
266 } 273 }
267 } 274 }
268 275
269 void ArcAccessibilityHelperBridge::OnTaskSetActive(int32_t task_id) { 276 void ArcAccessibilityHelperBridge::OnTaskSetActive(int32_t task_id) {
270 current_task_id_ = task_id; 277 current_task_id_ = task_id;
271 } 278 }
272 279
273 } // namespace arc 280 } // namespace arc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698