Chromium Code Reviews| 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 #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> | |
| 9 | |
| 8 #include "components/arc/arc_service.h" | 10 #include "components/arc/arc_service.h" |
| 9 #include "components/arc/common/accessibility_helper.mojom.h" | 11 #include "components/arc/common/accessibility_helper.mojom.h" |
| 10 #include "components/arc/instance_holder.h" | 12 #include "components/arc/instance_holder.h" |
| 13 #include "components/exo/wm_helper.h" | |
|
oshima
2017/02/16 04:16:45
Hmm, I think you're not supposed to use this outsi
David Tseng
2017/02/16 18:36:40
It's also being used to get the focused window.
Peng
2017/02/16 18:51:04
I added WMHelper to avoid using ash code in exo di
David Tseng
2017/02/16 19:14:37
For getting the focused window, we need ash (Shell
| |
| 11 #include "mojo/public/cpp/bindings/binding.h" | 14 #include "mojo/public/cpp/bindings/binding.h" |
| 12 | 15 |
| 16 namespace views { | |
| 17 | |
| 18 class View; | |
| 19 | |
| 20 } // namespace views | |
| 21 | |
| 13 namespace arc { | 22 namespace arc { |
| 14 | 23 |
| 15 class ArcBridgeService; | 24 class ArcBridgeService; |
| 25 class AXTreeSourceArc; | |
| 16 | 26 |
| 17 // ArcAccessibilityHelperBridge is an instance to receive converted Android | 27 // ArcAccessibilityHelperBridge is an instance to receive converted Android |
| 18 // accessibility events and info via mojo interface and dispatch them to chrome | 28 // accessibility events and info via mojo interface and dispatch them to chrome |
| 19 // os components. | 29 // os components. |
| 20 class ArcAccessibilityHelperBridge | 30 class ArcAccessibilityHelperBridge |
| 21 : public ArcService, | 31 : public ArcService, |
| 22 public mojom::AccessibilityHelperHost, | 32 public mojom::AccessibilityHelperHost, |
| 23 public InstanceHolder<mojom::AccessibilityHelperInstance>::Observer { | 33 public InstanceHolder<mojom::AccessibilityHelperInstance>::Observer, |
| 34 public exo::WMHelper::ActivationObserver { | |
| 24 public: | 35 public: |
| 25 explicit ArcAccessibilityHelperBridge(ArcBridgeService* bridge_service); | 36 explicit ArcAccessibilityHelperBridge(ArcBridgeService* bridge_service); |
| 26 ~ArcAccessibilityHelperBridge() override; | 37 ~ArcAccessibilityHelperBridge() override; |
| 27 | 38 |
| 28 // InstanceHolder<mojom::AccessibilityHelperInstance>::Observer overrides. | 39 // InstanceHolder<mojom::AccessibilityHelperInstance>::Observer overrides. |
| 29 void OnInstanceReady() override; | 40 void OnInstanceReady() override; |
| 30 | 41 |
| 31 // mojom::AccessibilityHelperHost overrides. | 42 // mojom::AccessibilityHelperHost overrides. |
| 32 void OnAccessibilityEvent( | 43 void OnAccessibilityEventDeprecated( |
| 33 mojom::AccessibilityEventType event_type, | 44 mojom::AccessibilityEventType event_type, |
| 34 mojom::AccessibilityNodeInfoDataPtr event_source) override; | 45 mojom::AccessibilityNodeInfoDataPtr event_source) override; |
| 46 void OnAccessibilityEvent( | |
| 47 mojom::AccessibilityEventDataPtr event_data) override; | |
| 35 | 48 |
| 36 private: | 49 private: |
| 50 // exo::WMHelper::ActivationObserver overrides. | |
| 51 void OnWindowActivated(aura::Window* gained_active, | |
| 52 aura::Window* lost_active) override; | |
| 53 | |
| 37 mojo::Binding<mojom::AccessibilityHelperHost> binding_; | 54 mojo::Binding<mojom::AccessibilityHelperHost> binding_; |
| 38 | 55 |
| 56 std::unique_ptr<AXTreeSourceArc> tree_source_; | |
| 57 std::unique_ptr<views::View> focus_stealer_; | |
| 58 | |
| 39 DISALLOW_COPY_AND_ASSIGN(ArcAccessibilityHelperBridge); | 59 DISALLOW_COPY_AND_ASSIGN(ArcAccessibilityHelperBridge); |
| 40 }; | 60 }; |
| 41 | 61 |
| 42 } // namespace arc | 62 } // namespace arc |
| 43 | 63 |
| 44 #endif // CHROME_BROWSER_CHROMEOS_ARC_ACCESSIBILITY_ARC_ACCESSIBILITY_HELPER_BR IDGE_H_ | 64 #endif // CHROME_BROWSER_CHROMEOS_ARC_ACCESSIBILITY_ARC_ACCESSIBILITY_HELPER_BR IDGE_H_ |
| OLD | NEW |