OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_EXTENSIONS_INPUT_METHOD_API_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_EXTENSIONS_INPUT_METHOD_API_H_ |
6 #define CHROME_BROWSER_CHROMEOS_EXTENSIONS_INPUT_METHOD_API_H_ | 6 #define CHROME_BROWSER_CHROMEOS_EXTENSIONS_INPUT_METHOD_API_H_ |
7 | 7 |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
11 #include "extensions/browser/browser_context_keyed_api_factory.h" | 11 #include "extensions/browser/browser_context_keyed_api_factory.h" |
12 #include "extensions/browser/event_router.h" | 12 #include "extensions/browser/event_router.h" |
13 #include "extensions/browser/extension_function.h" | 13 #include "extensions/browser/extension_function.h" |
14 | 14 |
15 namespace chromeos { | 15 namespace chromeos { |
16 class ExtensionDictionaryEventRouter; | 16 class ExtensionDictionaryEventRouter; |
17 class ExtensionInputMethodEventRouter; | 17 class ExtensionInputMethodEventRouter; |
| 18 class ExtensionImeMenuEventRouter; |
18 } | 19 } |
19 | 20 |
20 namespace extensions { | 21 namespace extensions { |
21 | 22 |
22 // Implements the inputMethodPrivate.getInputMethodConfig method. | 23 // Implements the inputMethodPrivate.getInputMethodConfig method. |
23 class GetInputMethodConfigFunction : public UIThreadExtensionFunction { | 24 class GetInputMethodConfigFunction : public UIThreadExtensionFunction { |
24 public: | 25 public: |
25 GetInputMethodConfigFunction() {} | 26 GetInputMethodConfigFunction() {} |
26 | 27 |
27 protected: | 28 protected: |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 INPUTMETHODPRIVATE_GETENCRYPTSYNCENABLED) | 131 INPUTMETHODPRIVATE_GETENCRYPTSYNCENABLED) |
131 DISALLOW_COPY_AND_ASSIGN(GetEncryptSyncEnabledFunction); | 132 DISALLOW_COPY_AND_ASSIGN(GetEncryptSyncEnabledFunction); |
132 }; | 133 }; |
133 | 134 |
134 class InputMethodAPI : public BrowserContextKeyedAPI, | 135 class InputMethodAPI : public BrowserContextKeyedAPI, |
135 public extensions::EventRouter::Observer { | 136 public extensions::EventRouter::Observer { |
136 public: | 137 public: |
137 static const char kOnDictionaryChanged[]; | 138 static const char kOnDictionaryChanged[]; |
138 static const char kOnDictionaryLoaded[]; | 139 static const char kOnDictionaryLoaded[]; |
139 static const char kOnInputMethodChanged[]; | 140 static const char kOnInputMethodChanged[]; |
| 141 static const char kOnImeMenuActivationChanged[]; |
140 | 142 |
141 explicit InputMethodAPI(content::BrowserContext* context); | 143 explicit InputMethodAPI(content::BrowserContext* context); |
142 ~InputMethodAPI() override; | 144 ~InputMethodAPI() override; |
143 | 145 |
144 // Returns input method name for the given XKB (X keyboard extensions in X | 146 // Returns input method name for the given XKB (X keyboard extensions in X |
145 // Window System) id. | 147 // Window System) id. |
146 static std::string GetInputMethodForXkb(const std::string& xkb_id); | 148 static std::string GetInputMethodForXkb(const std::string& xkb_id); |
147 | 149 |
148 // BrowserContextKeyedAPI implementation. | 150 // BrowserContextKeyedAPI implementation. |
149 static BrowserContextKeyedAPIFactory<InputMethodAPI>* GetFactoryInstance(); | 151 static BrowserContextKeyedAPIFactory<InputMethodAPI>* GetFactoryInstance(); |
(...skipping 13 matching lines...) Expand all Loading... |
163 } | 165 } |
164 static const bool kServiceIsNULLWhileTesting = true; | 166 static const bool kServiceIsNULLWhileTesting = true; |
165 | 167 |
166 content::BrowserContext* const context_; | 168 content::BrowserContext* const context_; |
167 | 169 |
168 // Created lazily upon OnListenerAdded. | 170 // Created lazily upon OnListenerAdded. |
169 scoped_ptr<chromeos::ExtensionInputMethodEventRouter> | 171 scoped_ptr<chromeos::ExtensionInputMethodEventRouter> |
170 input_method_event_router_; | 172 input_method_event_router_; |
171 scoped_ptr<chromeos::ExtensionDictionaryEventRouter> | 173 scoped_ptr<chromeos::ExtensionDictionaryEventRouter> |
172 dictionary_event_router_; | 174 dictionary_event_router_; |
| 175 scoped_ptr<chromeos::ExtensionImeMenuEventRouter> ime_menu_event_router_; |
173 | 176 |
174 DISALLOW_COPY_AND_ASSIGN(InputMethodAPI); | 177 DISALLOW_COPY_AND_ASSIGN(InputMethodAPI); |
175 }; | 178 }; |
176 | 179 |
177 } // namespace extensions | 180 } // namespace extensions |
178 | 181 |
179 #endif // CHROME_BROWSER_CHROMEOS_EXTENSIONS_INPUT_METHOD_API_H_ | 182 #endif // CHROME_BROWSER_CHROMEOS_EXTENSIONS_INPUT_METHOD_API_H_ |
OLD | NEW |