| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_INPUT_IME_INPUT_IME_API_H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_API_INPUT_IME_INPUT_IME_API_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_API_INPUT_IME_INPUT_IME_API_H_ |
| 7 | 7 |
| 8 #include "chrome/browser/extensions/extension_function.h" | 8 #include "chrome/browser/extensions/extension_function.h" |
| 9 | 9 |
| 10 #include "base/memory/singleton.h" | 10 #include "base/memory/singleton.h" |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 bool RegisterIme(Profile* profile, | 33 bool RegisterIme(Profile* profile, |
| 34 const std::string& extension_id, | 34 const std::string& extension_id, |
| 35 const extensions::Extension::InputComponentInfo& component); | 35 const extensions::Extension::InputComponentInfo& component); |
| 36 void UnregisterAllImes(Profile* profile, const std::string& extension_id); | 36 void UnregisterAllImes(Profile* profile, const std::string& extension_id); |
| 37 chromeos::InputMethodEngine* GetEngine(const std::string& extension_id, | 37 chromeos::InputMethodEngine* GetEngine(const std::string& extension_id, |
| 38 const std::string& engine_id); | 38 const std::string& engine_id); |
| 39 chromeos::InputMethodEngine* GetActiveEngine(const std::string& extension_id); | 39 chromeos::InputMethodEngine* GetActiveEngine(const std::string& extension_id); |
| 40 | 40 |
| 41 | 41 |
| 42 // Called when a key event was handled. | 42 // Called when a key event was handled. |
| 43 void OnEventHandled(const std::string& extension_id, | 43 void OnKeyEventHandled(const std::string& extension_id, |
| 44 const std::string& request_id, | 44 const std::string& request_id, |
| 45 bool handled); | 45 bool handled); |
| 46 | 46 |
| 47 std::string AddRequest(const std::string& engine_id, | 47 std::string AddRequest(const std::string& engine_id, |
| 48 chromeos::input_method::KeyEventHandle* key_data); | 48 chromeos::input_method::KeyEventHandle* key_data); |
| 49 | 49 |
| 50 private: | 50 private: |
| 51 friend struct DefaultSingletonTraits<InputImeEventRouter>; | 51 friend struct DefaultSingletonTraits<InputImeEventRouter>; |
| 52 typedef std::map<std::string, std::pair<std::string, | 52 typedef std::map<std::string, std::pair<std::string, |
| 53 chromeos::input_method::KeyEventHandle*> > RequestMap; | 53 chromeos::input_method::KeyEventHandle*> > RequestMap; |
| 54 | 54 |
| 55 InputImeEventRouter(); | 55 InputImeEventRouter(); |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 152 public: | 152 public: |
| 153 DECLARE_EXTENSION_FUNCTION_NAME("input.ime.updateMenuItems"); | 153 DECLARE_EXTENSION_FUNCTION_NAME("input.ime.updateMenuItems"); |
| 154 | 154 |
| 155 protected: | 155 protected: |
| 156 virtual ~UpdateMenuItemsFunction() {} | 156 virtual ~UpdateMenuItemsFunction() {} |
| 157 | 157 |
| 158 // ExtensionFunction: | 158 // ExtensionFunction: |
| 159 virtual bool RunImpl() OVERRIDE; | 159 virtual bool RunImpl() OVERRIDE; |
| 160 }; | 160 }; |
| 161 | 161 |
| 162 class InputEventHandled : public AsyncExtensionFunction { | 162 class KeyEventHandled : public AsyncExtensionFunction { |
| 163 public: | 163 public: |
| 164 DECLARE_EXTENSION_FUNCTION_NAME("input.ime.eventHandled"); | 164 DECLARE_EXTENSION_FUNCTION_NAME("input.ime.keyEventHandled"); |
| 165 | 165 |
| 166 protected: | 166 protected: |
| 167 virtual ~InputEventHandled() {} | 167 virtual ~KeyEventHandled() {} |
| 168 | 168 |
| 169 // ExtensionFunction: | 169 // ExtensionFunction: |
| 170 virtual bool RunImpl() OVERRIDE; | 170 virtual bool RunImpl() OVERRIDE; |
| 171 }; | 171 }; |
| 172 | 172 |
| 173 } // namespace extensions | 173 } // namespace extensions |
| 174 | 174 |
| 175 #endif // CHROME_BROWSER_EXTENSIONS_API_INPUT_IME_INPUT_IME_API_H_ | 175 #endif // CHROME_BROWSER_EXTENSIONS_API_INPUT_IME_INPUT_IME_API_H_ |
| OLD | NEW |