OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 COMPONENTS_ARC_IME_ARC_IME_BRIDGE_H_ | 5 #ifndef COMPONENTS_ARC_IME_ARC_IME_BRIDGE_H_ |
6 #define COMPONENTS_ARC_IME_ARC_IME_BRIDGE_H_ | 6 #define COMPONENTS_ARC_IME_ARC_IME_BRIDGE_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "components/arc/arc_service.h" |
10 #include "components/arc/ime/arc_ime_ipc_host.h" | 11 #include "components/arc/ime/arc_ime_ipc_host.h" |
11 #include "ui/aura/client/focus_change_observer.h" | 12 #include "ui/aura/client/focus_change_observer.h" |
12 #include "ui/aura/env_observer.h" | 13 #include "ui/aura/env_observer.h" |
13 #include "ui/aura/window_observer.h" | 14 #include "ui/aura/window_observer.h" |
14 #include "ui/aura/window_tracker.h" | 15 #include "ui/aura/window_tracker.h" |
15 #include "ui/base/ime/text_input_client.h" | 16 #include "ui/base/ime/text_input_client.h" |
16 #include "ui/base/ime/text_input_flags.h" | 17 #include "ui/base/ime/text_input_flags.h" |
17 #include "ui/base/ime/text_input_type.h" | 18 #include "ui/base/ime/text_input_type.h" |
18 #include "ui/gfx/geometry/rect.h" | 19 #include "ui/gfx/geometry/rect.h" |
19 | 20 |
20 namespace aura { | 21 namespace aura { |
21 class Window; | 22 class Window; |
22 } | 23 } |
23 | 24 |
24 namespace ui { | 25 namespace ui { |
25 class InputMethod; | 26 class InputMethod; |
26 } | 27 } |
27 | 28 |
28 namespace arc { | 29 namespace arc { |
29 | 30 |
30 class ArcBridgeService; | 31 class ArcBridgeService; |
31 | 32 |
32 // This class implements ui::TextInputClient and makes ARC windows behave | 33 // This class implements ui::TextInputClient and makes ARC windows behave |
33 // as a text input target in Chrome OS environment. | 34 // as a text input target in Chrome OS environment. |
34 class ArcImeBridge : public ArcImeIpcHost::Delegate, | 35 class ArcImeBridge : public ArcService, |
| 36 public ArcImeIpcHost::Delegate, |
35 public aura::EnvObserver, | 37 public aura::EnvObserver, |
36 public aura::WindowObserver, | 38 public aura::WindowObserver, |
37 public aura::client::FocusChangeObserver, | 39 public aura::client::FocusChangeObserver, |
38 public ui::TextInputClient { | 40 public ui::TextInputClient { |
39 public: | 41 public: |
40 explicit ArcImeBridge(ArcBridgeService* arc_bridge_service); | 42 explicit ArcImeBridge(ArcBridgeService* bridge_service); |
41 ~ArcImeBridge() override; | 43 ~ArcImeBridge() override; |
42 | 44 |
43 // Injects the custom IPC host object for testing purpose only. | 45 // Injects the custom IPC host object for testing purpose only. |
44 void SetIpcHostForTesting(scoped_ptr<ArcImeIpcHost> test_ipc_host); | 46 void SetIpcHostForTesting(scoped_ptr<ArcImeIpcHost> test_ipc_host); |
45 | 47 |
46 // Overridden from aura::EnvObserver: | 48 // Overridden from aura::EnvObserver: |
47 void OnWindowInitialized(aura::Window* new_window) override; | 49 void OnWindowInitialized(aura::Window* new_window) override; |
48 | 50 |
49 // Overridden from aura::WindowObserver: | 51 // Overridden from aura::WindowObserver: |
50 void OnWindowAddedToRootWindow(aura::Window* window) override; | 52 void OnWindowAddedToRootWindow(aura::Window* window) override; |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 aura::WindowTracker observing_root_windows_; | 103 aura::WindowTracker observing_root_windows_; |
102 aura::WindowTracker arc_windows_; | 104 aura::WindowTracker arc_windows_; |
103 aura::WindowTracker focused_arc_window_; | 105 aura::WindowTracker focused_arc_window_; |
104 | 106 |
105 DISALLOW_COPY_AND_ASSIGN(ArcImeBridge); | 107 DISALLOW_COPY_AND_ASSIGN(ArcImeBridge); |
106 }; | 108 }; |
107 | 109 |
108 } // namespace arc | 110 } // namespace arc |
109 | 111 |
110 #endif // COMPONENTS_ARC_IME_ARC_IME_BRIDGE_H_ | 112 #endif // COMPONENTS_ARC_IME_ARC_IME_BRIDGE_H_ |
OLD | NEW |