Chromium Code Reviews| 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 class Profile; | |
|
Devlin
2016/01/11 22:18:57
#include'd things don't have to be forward declare
Azure Wei
2016/01/12 01:55:53
Done.
| |
| 17 | |
| 18 namespace ui { | |
| 19 class IMEEngineHandlerInterface; | |
| 20 } // namespace ui | |
| 21 | |
| 22 namespace extensions { | |
| 23 | |
| 24 class InputImeEventRouterBase { | |
| 25 public: | |
| 26 explicit InputImeEventRouterBase(Profile* profile); | |
| 27 virtual ~InputImeEventRouterBase(); | |
| 28 | |
| 29 // Called when a key event was handled. | |
| 30 void OnKeyEventHandled(const std::string& extension_id, | |
| 31 const std::string& request_id, | |
| 32 bool handled); | |
| 33 | |
| 34 std::string AddRequest( | |
| 35 const std::string& component_id, | |
| 36 ui::IMEEngineHandlerInterface::KeyEventDoneCallback& key_data); | |
| 37 | |
| 38 Profile* profile() const { return profile_; } | |
| 39 | |
| 40 private: | |
| 41 using RequestMap = | |
| 42 std::map<std::string, | |
| 43 std::pair<std::string, | |
| 44 ui::IMEEngineHandlerInterface::KeyEventDoneCallback>>; | |
| 45 | |
| 46 unsigned int next_request_id_; | |
| 47 RequestMap request_map_; | |
| 48 Profile* profile_; | |
| 49 | |
| 50 DISALLOW_COPY_AND_ASSIGN(InputImeEventRouterBase); | |
| 51 }; | |
| 52 | |
| 53 } // namespace extensions | |
| 54 | |
| 55 #endif // CHROME_BROWSER_EXTENSIONS_API_INPUT_IME_INPUT_IME_EVENT_ROUTER_BASE_H _ | |
| OLD | NEW |