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_IPC_HOST_H_ | 5 #ifndef COMPONENTS_ARC_IME_ARC_IME_IPC_HOST_H_ |
6 #define COMPONENTS_ARC_IME_ARC_IME_IPC_HOST_H_ | 6 #define COMPONENTS_ARC_IME_ARC_IME_IPC_HOST_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "base/strings/string16.h" | 9 #include "base/strings/string16.h" |
10 #include "components/arc/arc_bridge_service.h" | 10 #include "components/arc/arc_bridge_service.h" |
(...skipping 17 matching lines...) Expand all Loading... |
28 class ArcImeIpcHost : public ImeHost, | 28 class ArcImeIpcHost : public ImeHost, |
29 public ArcBridgeService::Observer { | 29 public ArcBridgeService::Observer { |
30 public: | 30 public: |
31 // Received IPCs are deserialized and passed to this delegate. | 31 // Received IPCs are deserialized and passed to this delegate. |
32 class Delegate { | 32 class Delegate { |
33 public: | 33 public: |
34 virtual void OnTextInputTypeChanged(ui::TextInputType type) = 0; | 34 virtual void OnTextInputTypeChanged(ui::TextInputType type) = 0; |
35 virtual void OnCursorRectChanged(const gfx::Rect& rect) = 0; | 35 virtual void OnCursorRectChanged(const gfx::Rect& rect) = 0; |
36 }; | 36 }; |
37 | 37 |
38 ArcImeIpcHost(Delegate* delegate, ArcBridgeService* bridge_service); | 38 ArcImeIpcHost(Delegate* delegate, ArcBridgeService* arc_bridge_service); |
39 ~ArcImeIpcHost() override; | 39 ~ArcImeIpcHost() override; |
40 | 40 |
41 // arc::ArcBridgeService::Observer: | 41 // arc::ArcBridgeService::Observer: |
42 void OnImeInstanceReady() override; | 42 void OnImeInstanceReady() override; |
43 | 43 |
44 // Serializes and sends IME related requests through IPCs. | 44 // Serializes and sends IME related requests through IPCs. |
45 void SendSetCompositionText(const ui::CompositionText& composition); | 45 void SendSetCompositionText(const ui::CompositionText& composition); |
46 void SendConfirmCompositionText(); | 46 void SendConfirmCompositionText(); |
47 void SendInsertText(const base::string16& text); | 47 void SendInsertText(const base::string16& text); |
48 | 48 |
49 // arc::ImeHost: | 49 // arc::ImeHost: |
50 void OnTextInputTypeChanged(arc::TextInputType type) override; | 50 void OnTextInputTypeChanged(arc::TextInputType type) override; |
51 void OnCursorRectChanged(arc::CursorRectPtr rect) override; | 51 void OnCursorRectChanged(arc::CursorRectPtr rect) override; |
52 | 52 |
53 private: | 53 private: |
| 54 ArcBridgeService* const arc_bridge_service_; // owned by ArcServiceManager. |
| 55 |
54 mojo::Binding<ImeHost> binding_; | 56 mojo::Binding<ImeHost> binding_; |
55 Delegate* const delegate_; | 57 Delegate* const delegate_; |
56 ArcBridgeService* const bridge_service_; | |
57 | 58 |
58 DISALLOW_COPY_AND_ASSIGN(ArcImeIpcHost); | 59 DISALLOW_COPY_AND_ASSIGN(ArcImeIpcHost); |
59 }; | 60 }; |
60 | 61 |
61 } // namespace arc | 62 } // namespace arc |
62 | 63 |
63 #endif // COMPONENTS_ARC_IME_ARC_IME_IPC_HOST_H_ | 64 #endif // COMPONENTS_ARC_IME_ARC_IME_IPC_HOST_H_ |
OLD | NEW |