OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_EXTENSIONS_API_INPUT_IME_INPUT_IME_API_CHROMEOS_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_INPUT_IME_INPUT_IME_API_CHROMEOS_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_API_INPUT_IME_INPUT_IME_API_CHROMEOS_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_API_INPUT_IME_INPUT_IME_API_CHROMEOS_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
11 | 11 |
12 #include "chrome/browser/extensions/api/input_ime/input_ime_event_router_base.h" | 12 #include "chrome/browser/extensions/api/input_ime/input_ime_event_router_base.h" |
13 #include "chrome/common/extensions/api/input_ime/input_components_handler.h" | 13 #include "chrome/common/extensions/api/input_ime/input_components_handler.h" |
14 #include "extensions/browser/extension_function.h" | 14 #include "extensions/browser/extension_function.h" |
15 | 15 |
16 namespace chromeos { | 16 namespace chromeos { |
17 | 17 |
18 class InputMethodEngine; | 18 class InputMethodEngine; |
19 | 19 |
20 } // namespace chromeos | 20 } // namespace chromeos |
21 | 21 |
22 namespace extensions { | 22 namespace extensions { |
23 | 23 |
24 class InputImeClearCompositionFunction : public SyncExtensionFunction { | 24 class InputImeClearCompositionFunction : public UIThreadExtensionFunction { |
25 public: | 25 public: |
26 DECLARE_EXTENSION_FUNCTION("input.ime.clearComposition", | 26 DECLARE_EXTENSION_FUNCTION("input.ime.clearComposition", |
27 INPUT_IME_CLEARCOMPOSITION) | 27 INPUT_IME_CLEARCOMPOSITION) |
28 | 28 |
29 protected: | 29 protected: |
30 ~InputImeClearCompositionFunction() override {} | 30 ~InputImeClearCompositionFunction() override {} |
31 | 31 |
32 // ExtensionFunction: | 32 // ExtensionFunction: |
33 bool RunSync() override; | 33 ResponseAction Run() override; |
34 }; | 34 }; |
35 | 35 |
36 class InputImeSetCandidateWindowPropertiesFunction | 36 class InputImeSetCandidateWindowPropertiesFunction |
37 : public SyncExtensionFunction { | 37 : public UIThreadExtensionFunction { |
38 public: | 38 public: |
39 DECLARE_EXTENSION_FUNCTION("input.ime.setCandidateWindowProperties", | 39 DECLARE_EXTENSION_FUNCTION("input.ime.setCandidateWindowProperties", |
40 INPUT_IME_SETCANDIDATEWINDOWPROPERTIES) | 40 INPUT_IME_SETCANDIDATEWINDOWPROPERTIES) |
41 | 41 |
42 protected: | 42 protected: |
43 ~InputImeSetCandidateWindowPropertiesFunction() override {} | 43 ~InputImeSetCandidateWindowPropertiesFunction() override {} |
44 | 44 |
45 // ExtensionFunction: | 45 // ExtensionFunction: |
46 bool RunSync() override; | 46 ResponseAction Run() override; |
47 }; | 47 }; |
48 | 48 |
49 class InputImeSetCandidatesFunction : public SyncExtensionFunction { | 49 class InputImeSetCandidatesFunction : public UIThreadExtensionFunction { |
50 public: | 50 public: |
51 DECLARE_EXTENSION_FUNCTION("input.ime.setCandidates", INPUT_IME_SETCANDIDATES) | 51 DECLARE_EXTENSION_FUNCTION("input.ime.setCandidates", INPUT_IME_SETCANDIDATES) |
52 | 52 |
53 protected: | 53 protected: |
54 ~InputImeSetCandidatesFunction() override {} | 54 ~InputImeSetCandidatesFunction() override {} |
55 | 55 |
56 // ExtensionFunction: | 56 // ExtensionFunction: |
57 bool RunSync() override; | 57 ResponseAction Run() override; |
58 }; | 58 }; |
59 | 59 |
60 class InputImeSetCursorPositionFunction : public SyncExtensionFunction { | 60 class InputImeSetCursorPositionFunction : public UIThreadExtensionFunction { |
61 public: | 61 public: |
62 DECLARE_EXTENSION_FUNCTION("input.ime.setCursorPosition", | 62 DECLARE_EXTENSION_FUNCTION("input.ime.setCursorPosition", |
63 INPUT_IME_SETCURSORPOSITION) | 63 INPUT_IME_SETCURSORPOSITION) |
64 | 64 |
65 protected: | 65 protected: |
66 ~InputImeSetCursorPositionFunction() override {} | 66 ~InputImeSetCursorPositionFunction() override {} |
67 | 67 |
68 // ExtensionFunction: | 68 // ExtensionFunction: |
69 bool RunSync() override; | 69 ResponseAction Run() override; |
70 }; | 70 }; |
71 | 71 |
72 class InputImeSetMenuItemsFunction : public SyncExtensionFunction { | 72 class InputImeSetMenuItemsFunction : public UIThreadExtensionFunction { |
73 public: | 73 public: |
74 DECLARE_EXTENSION_FUNCTION("input.ime.setMenuItems", INPUT_IME_SETMENUITEMS) | 74 DECLARE_EXTENSION_FUNCTION("input.ime.setMenuItems", INPUT_IME_SETMENUITEMS) |
75 | 75 |
76 protected: | 76 protected: |
77 ~InputImeSetMenuItemsFunction() override {} | 77 ~InputImeSetMenuItemsFunction() override {} |
78 | 78 |
79 // ExtensionFunction: | 79 // ExtensionFunction: |
80 bool RunSync() override; | 80 ResponseAction Run() override; |
81 }; | 81 }; |
82 | 82 |
83 class InputImeUpdateMenuItemsFunction : public SyncExtensionFunction { | 83 class InputImeUpdateMenuItemsFunction : public UIThreadExtensionFunction { |
84 public: | 84 public: |
85 DECLARE_EXTENSION_FUNCTION("input.ime.updateMenuItems", | 85 DECLARE_EXTENSION_FUNCTION("input.ime.updateMenuItems", |
86 INPUT_IME_UPDATEMENUITEMS) | 86 INPUT_IME_UPDATEMENUITEMS) |
87 | 87 |
88 protected: | 88 protected: |
89 ~InputImeUpdateMenuItemsFunction() override {} | 89 ~InputImeUpdateMenuItemsFunction() override {} |
90 | 90 |
91 // ExtensionFunction: | 91 // ExtensionFunction: |
92 bool RunSync() override; | 92 ResponseAction Run() override; |
93 }; | 93 }; |
94 | 94 |
95 class InputImeDeleteSurroundingTextFunction : public SyncExtensionFunction { | 95 class InputImeDeleteSurroundingTextFunction : public UIThreadExtensionFunction { |
96 public: | 96 public: |
97 DECLARE_EXTENSION_FUNCTION("input.ime.deleteSurroundingText", | 97 DECLARE_EXTENSION_FUNCTION("input.ime.deleteSurroundingText", |
98 INPUT_IME_DELETESURROUNDINGTEXT) | 98 INPUT_IME_DELETESURROUNDINGTEXT) |
99 protected: | 99 protected: |
100 ~InputImeDeleteSurroundingTextFunction() override {} | 100 ~InputImeDeleteSurroundingTextFunction() override {} |
101 | 101 |
102 // ExtensionFunction: | 102 // ExtensionFunction: |
103 bool RunSync() override; | 103 ResponseAction Run() override; |
104 }; | 104 }; |
105 | 105 |
106 class InputImeHideInputViewFunction : public AsyncExtensionFunction { | 106 class InputImeHideInputViewFunction : public AsyncExtensionFunction { |
107 public: | 107 public: |
108 DECLARE_EXTENSION_FUNCTION("input.ime.hideInputView", | 108 DECLARE_EXTENSION_FUNCTION("input.ime.hideInputView", |
109 INPUT_IME_HIDEINPUTVIEW) | 109 INPUT_IME_HIDEINPUTVIEW) |
110 | 110 |
111 protected: | 111 protected: |
112 ~InputImeHideInputViewFunction() override {} | 112 ~InputImeHideInputViewFunction() override {} |
113 | 113 |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
151 private: | 151 private: |
152 // The engine map from extension_id to an engine. | 152 // The engine map from extension_id to an engine. |
153 std::map<std::string, chromeos::InputMethodEngine*> engine_map_; | 153 std::map<std::string, chromeos::InputMethodEngine*> engine_map_; |
154 | 154 |
155 DISALLOW_COPY_AND_ASSIGN(InputImeEventRouter); | 155 DISALLOW_COPY_AND_ASSIGN(InputImeEventRouter); |
156 }; | 156 }; |
157 | 157 |
158 } // namespace extensions | 158 } // namespace extensions |
159 | 159 |
160 #endif // CHROME_BROWSER_EXTENSIONS_API_INPUT_IME_INPUT_IME_API_CHROMEOS_H_ | 160 #endif // CHROME_BROWSER_EXTENSIONS_API_INPUT_IME_INPUT_IME_API_CHROMEOS_H_ |
OLD | NEW |