| OLD | NEW |
| (Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_INPUT_IME_INPUT_IME_EVENT_ROUTER_BASE_H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_API_INPUT_IME_INPUT_IME_EVENT_ROUTER_BASE_H_ |
| 7 |
| 8 #include <map> |
| 9 #include <string> |
| 10 #include <utility> |
| 11 |
| 12 #include "base/macros.h" |
| 13 #include "chrome/browser/profiles/profile.h" |
| 14 #include "ui/base/ime/ime_engine_handler_interface.h" |
| 15 |
| 16 namespace extensions { |
| 17 |
| 18 class InputImeEventRouterBase { |
| 19 public: |
| 20 explicit InputImeEventRouterBase(Profile* profile); |
| 21 virtual ~InputImeEventRouterBase(); |
| 22 |
| 23 // Called when a key event was handled. |
| 24 void OnKeyEventHandled(const std::string& extension_id, |
| 25 const std::string& request_id, |
| 26 bool handled); |
| 27 |
| 28 std::string AddRequest( |
| 29 const std::string& component_id, |
| 30 ui::IMEEngineHandlerInterface::KeyEventDoneCallback& key_data); |
| 31 |
| 32 Profile* profile() const { return profile_; } |
| 33 |
| 34 private: |
| 35 using RequestMap = |
| 36 std::map<std::string, |
| 37 std::pair<std::string, |
| 38 ui::IMEEngineHandlerInterface::KeyEventDoneCallback>>; |
| 39 |
| 40 unsigned int next_request_id_; |
| 41 RequestMap request_map_; |
| 42 Profile* profile_; |
| 43 |
| 44 DISALLOW_COPY_AND_ASSIGN(InputImeEventRouterBase); |
| 45 }; |
| 46 |
| 47 } // namespace extensions |
| 48 |
| 49 #endif // CHROME_BROWSER_EXTENSIONS_API_INPUT_IME_INPUT_IME_EVENT_ROUTER_BASE_H
_ |
| OLD | NEW |