Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(33)

Unified Diff: chrome/browser/extensions/api/input_ime/input_ime_event_router_base.h

Issue 1554983002: Build chrome.input.ime.* API in GN mode. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/api/input_ime/input_ime_event_router_base.h
diff --git a/chrome/browser/extensions/api/input_ime/input_ime_event_router_base.h b/chrome/browser/extensions/api/input_ime/input_ime_event_router_base.h
new file mode 100644
index 0000000000000000000000000000000000000000..2b94a5982dafc98dde173a6672dbd23b056cccaf
--- /dev/null
+++ b/chrome/browser/extensions/api/input_ime/input_ime_event_router_base.h
@@ -0,0 +1,54 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_EXTENSIONS_API_INPUT_IME_INPUT_IME_EVENT_ROUTER_BASE_H_
+#define CHROME_BROWSER_EXTENSIONS_API_INPUT_IME_INPUT_IME_EVENT_ROUTER_BASE_H_
+
+#include <map>
+#include <string>
+#include <utility>
+
+#include "base/macros.h"
+#include "chrome/browser/profiles/profile.h"
+#include "extensions/browser/extension_function.h"
+#include "ui/base/ime/ime_engine_handler_interface.h"
+
+class Profile;
+
+namespace ui {
+class IMEEngineHandlerInterface;
+} // namespace ui
+
+namespace extensions {
+
+class InputImeEventRouterBase {
+ public:
+ explicit InputImeEventRouterBase(Profile* profile);
+ ~InputImeEventRouterBase();
Shu Chen 2016/01/06 07:00:08 virtual
Azure Wei 2016/01/06 08:00:01 Done.
+
+ // Called when a key event was handled.
+ void OnKeyEventHandled(const std::string& extension_id,
+ const std::string& request_id,
+ bool handled);
+
+ std::string AddRequest(
+ const std::string& component_id,
+ ui::IMEEngineHandlerInterface::KeyEventDoneCallback& key_data);
+
+ protected:
+ using RequestMap =
+ std::map<std::string,
+ std::pair<std::string,
+ ui::IMEEngineHandlerInterface::KeyEventDoneCallback>>;
+
+ unsigned int next_request_id_;
Shu Chen 2016/01/06 07:00:08 these should be private.
Azure Wei 2016/01/06 08:00:01 Done.
+ RequestMap request_map_;
+ Profile* profile_;
+
+ DISALLOW_COPY_AND_ASSIGN(InputImeEventRouterBase);
+};
+
+} // namespace extensions
+
+#endif // CHROME_BROWSER_EXTENSIONS_API_INPUT_IME_INPUT_IME_EVENT_ROUTER_BASE_H_

Powered by Google App Engine
This is Rietveld 408576698