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

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

Issue 2700103004: Initial support for accessibility actions on ARC. (Closed)
Patch Set: Use desktop tree id. Created 3 years, 10 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
« no previous file with comments | « no previous file | chrome/browser/chromeos/arc/accessibility/arc_accessibility_helper_bridge.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #ifndef CHROME_BROWSER_CHROMEOS_ARC_ACCESSIBILITY_ARC_ACCESSIBILITY_HELPER_BRIDG E_H_ 5 #ifndef CHROME_BROWSER_CHROMEOS_ARC_ACCESSIBILITY_ARC_ACCESSIBILITY_HELPER_BRIDG E_H_
6 #define CHROME_BROWSER_CHROMEOS_ARC_ACCESSIBILITY_ARC_ACCESSIBILITY_HELPER_BRIDG E_H_ 6 #define CHROME_BROWSER_CHROMEOS_ARC_ACCESSIBILITY_ARC_ACCESSIBILITY_HELPER_BRIDG E_H_
7 7
8 #include <memory> 8 #include <memory>
9 9
10 #include "components/arc/arc_service.h" 10 #include "components/arc/arc_service.h"
11 #include "components/arc/common/accessibility_helper.mojom.h" 11 #include "components/arc/common/accessibility_helper.mojom.h"
12 #include "components/arc/instance_holder.h" 12 #include "components/arc/instance_holder.h"
13 #include "components/exo/wm_helper.h" 13 #include "components/exo/wm_helper.h"
14 #include "mojo/public/cpp/bindings/binding.h" 14 #include "mojo/public/cpp/bindings/binding.h"
15 #include "ui/accessibility/ax_host_delegate.h"
15 16
16 namespace views { 17 namespace views {
17 18
18 class View; 19 class View;
19 20
20 } // namespace views 21 } // namespace views
21 22
22 namespace arc { 23 namespace arc {
23 24
24 class ArcBridgeService; 25 class ArcBridgeService;
25 class AXTreeSourceArc; 26 class AXTreeSourceArc;
26 27
27 // ArcAccessibilityHelperBridge is an instance to receive converted Android 28 // ArcAccessibilityHelperBridge is an instance to receive converted Android
28 // accessibility events and info via mojo interface and dispatch them to chrome 29 // accessibility events and info via mojo interface and dispatch them to chrome
29 // os components. 30 // os components.
30 class ArcAccessibilityHelperBridge 31 class ArcAccessibilityHelperBridge
31 : public ArcService, 32 : public ArcService,
32 public mojom::AccessibilityHelperHost, 33 public mojom::AccessibilityHelperHost,
33 public InstanceHolder<mojom::AccessibilityHelperInstance>::Observer, 34 public InstanceHolder<mojom::AccessibilityHelperInstance>::Observer,
34 public exo::WMHelper::ActivationObserver { 35 public exo::WMHelper::ActivationObserver,
36 public ui::AXHostDelegate {
35 public: 37 public:
36 explicit ArcAccessibilityHelperBridge(ArcBridgeService* bridge_service); 38 explicit ArcAccessibilityHelperBridge(ArcBridgeService* bridge_service);
37 ~ArcAccessibilityHelperBridge() override; 39 ~ArcAccessibilityHelperBridge() override;
38 40
39 // InstanceHolder<mojom::AccessibilityHelperInstance>::Observer overrides. 41 // InstanceHolder<mojom::AccessibilityHelperInstance>::Observer overrides.
40 void OnInstanceReady() override; 42 void OnInstanceReady() override;
41 43
42 // mojom::AccessibilityHelperHost overrides. 44 // mojom::AccessibilityHelperHost overrides.
43 void OnAccessibilityEventDeprecated( 45 void OnAccessibilityEventDeprecated(
44 mojom::AccessibilityEventType event_type, 46 mojom::AccessibilityEventType event_type,
45 mojom::AccessibilityNodeInfoDataPtr event_source) override; 47 mojom::AccessibilityNodeInfoDataPtr event_source) override;
46 void OnAccessibilityEvent( 48 void OnAccessibilityEvent(
47 mojom::AccessibilityEventDataPtr event_data) override; 49 mojom::AccessibilityEventDataPtr event_data) override;
48 50
49 private: 51 private:
50 // exo::WMHelper::ActivationObserver overrides. 52 // exo::WMHelper::ActivationObserver overrides.
51 void OnWindowActivated(aura::Window* gained_active, 53 void OnWindowActivated(aura::Window* gained_active,
52 aura::Window* lost_active) override; 54 aura::Window* lost_active) override;
53 55
56 // AXHostDelegate overrides.
57 void PerformAction(const ui::AXActionData& data) override;
58
54 mojo::Binding<mojom::AccessibilityHelperHost> binding_; 59 mojo::Binding<mojom::AccessibilityHelperHost> binding_;
55 60
56 std::unique_ptr<AXTreeSourceArc> tree_source_; 61 std::unique_ptr<AXTreeSourceArc> tree_source_;
57 std::unique_ptr<views::View> focus_stealer_; 62 std::unique_ptr<views::View> focus_stealer_;
58 63
59 DISALLOW_COPY_AND_ASSIGN(ArcAccessibilityHelperBridge); 64 DISALLOW_COPY_AND_ASSIGN(ArcAccessibilityHelperBridge);
60 }; 65 };
61 66
62 } // namespace arc 67 } // namespace arc
63 68
64 #endif // CHROME_BROWSER_CHROMEOS_ARC_ACCESSIBILITY_ARC_ACCESSIBILITY_HELPER_BR IDGE_H_ 69 #endif // CHROME_BROWSER_CHROMEOS_ARC_ACCESSIBILITY_ARC_ACCESSIBILITY_HELPER_BR IDGE_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/chromeos/arc/accessibility/arc_accessibility_helper_bridge.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698