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_SERVICE_H_ | 5 #ifndef COMPONENTS_ARC_IME_ARC_IME_SERVICE_H_ |
6 #define COMPONENTS_ARC_IME_ARC_IME_SERVICE_H_ | 6 #define COMPONENTS_ARC_IME_ARC_IME_SERVICE_H_ |
7 | 7 |
| 8 #include <memory> |
| 9 |
8 #include "base/macros.h" | 10 #include "base/macros.h" |
9 #include "base/memory/scoped_ptr.h" | |
10 #include "components/arc/arc_service.h" | 11 #include "components/arc/arc_service.h" |
11 #include "components/arc/ime/arc_ime_bridge.h" | 12 #include "components/arc/ime/arc_ime_bridge.h" |
12 #include "ui/aura/client/focus_change_observer.h" | 13 #include "ui/aura/client/focus_change_observer.h" |
13 #include "ui/aura/env_observer.h" | 14 #include "ui/aura/env_observer.h" |
14 #include "ui/aura/window_observer.h" | 15 #include "ui/aura/window_observer.h" |
15 #include "ui/aura/window_tracker.h" | 16 #include "ui/aura/window_tracker.h" |
16 #include "ui/base/ime/text_input_client.h" | 17 #include "ui/base/ime/text_input_client.h" |
17 #include "ui/base/ime/text_input_flags.h" | 18 #include "ui/base/ime/text_input_flags.h" |
18 #include "ui/base/ime/text_input_type.h" | 19 #include "ui/base/ime/text_input_type.h" |
19 #include "ui/gfx/geometry/rect.h" | 20 #include "ui/gfx/geometry/rect.h" |
(...skipping 16 matching lines...) Expand all Loading... |
36 public ArcImeBridge::Delegate, | 37 public ArcImeBridge::Delegate, |
37 public aura::EnvObserver, | 38 public aura::EnvObserver, |
38 public aura::WindowObserver, | 39 public aura::WindowObserver, |
39 public aura::client::FocusChangeObserver, | 40 public aura::client::FocusChangeObserver, |
40 public ui::TextInputClient { | 41 public ui::TextInputClient { |
41 public: | 42 public: |
42 explicit ArcImeService(ArcBridgeService* bridge_service); | 43 explicit ArcImeService(ArcBridgeService* bridge_service); |
43 ~ArcImeService() override; | 44 ~ArcImeService() override; |
44 | 45 |
45 // Injects the custom IPC bridge object for testing purpose only. | 46 // Injects the custom IPC bridge object for testing purpose only. |
46 void SetImeBridgeForTesting(scoped_ptr<ArcImeBridge> test_ime_bridge); | 47 void SetImeBridgeForTesting(std::unique_ptr<ArcImeBridge> test_ime_bridge); |
47 | 48 |
48 // Injects the custom IME for testing purpose only. | 49 // Injects the custom IME for testing purpose only. |
49 void SetInputMethodForTesting(ui::InputMethod* test_input_method); | 50 void SetInputMethodForTesting(ui::InputMethod* test_input_method); |
50 | 51 |
51 // Overridden from aura::EnvObserver: | 52 // Overridden from aura::EnvObserver: |
52 void OnWindowInitialized(aura::Window* new_window) override; | 53 void OnWindowInitialized(aura::Window* new_window) override; |
53 | 54 |
54 // Overridden from aura::WindowObserver: | 55 // Overridden from aura::WindowObserver: |
55 void OnWindowAddedToRootWindow(aura::Window* window) override; | 56 void OnWindowAddedToRootWindow(aura::Window* window) override; |
56 | 57 |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 bool ChangeTextDirectionAndLayoutAlignment( | 93 bool ChangeTextDirectionAndLayoutAlignment( |
93 base::i18n::TextDirection direction) override; | 94 base::i18n::TextDirection direction) override; |
94 void ExtendSelectionAndDelete(size_t before, size_t after) override {} | 95 void ExtendSelectionAndDelete(size_t before, size_t after) override {} |
95 void EnsureCaretInRect(const gfx::Rect& rect) override {} | 96 void EnsureCaretInRect(const gfx::Rect& rect) override {} |
96 bool IsEditCommandEnabled(int command_id) override; | 97 bool IsEditCommandEnabled(int command_id) override; |
97 void SetEditCommandForNextKeyEvent(int command_id) override {} | 98 void SetEditCommandForNextKeyEvent(int command_id) override {} |
98 | 99 |
99 private: | 100 private: |
100 ui::InputMethod* GetInputMethod(); | 101 ui::InputMethod* GetInputMethod(); |
101 | 102 |
102 scoped_ptr<ArcImeBridge> ime_bridge_; | 103 std::unique_ptr<ArcImeBridge> ime_bridge_; |
103 ui::TextInputType ime_type_; | 104 ui::TextInputType ime_type_; |
104 gfx::Rect cursor_rect_; | 105 gfx::Rect cursor_rect_; |
105 bool has_composition_text_; | 106 bool has_composition_text_; |
106 | 107 |
107 aura::WindowTracker observing_root_windows_; | 108 aura::WindowTracker observing_root_windows_; |
108 aura::WindowTracker arc_windows_; | 109 aura::WindowTracker arc_windows_; |
109 aura::WindowTracker focused_arc_window_; | 110 aura::WindowTracker focused_arc_window_; |
110 | 111 |
111 ui::InputMethod* test_input_method_; | 112 ui::InputMethod* test_input_method_; |
112 | 113 |
113 DISALLOW_COPY_AND_ASSIGN(ArcImeService); | 114 DISALLOW_COPY_AND_ASSIGN(ArcImeService); |
114 }; | 115 }; |
115 | 116 |
116 } // namespace arc | 117 } // namespace arc |
117 | 118 |
118 #endif // COMPONENTS_ARC_IME_ARC_IME_SERVICE_H_ | 119 #endif // COMPONENTS_ARC_IME_ARC_IME_SERVICE_H_ |
OLD | NEW |