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

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..863b28a62f77ebfaaed6cd0dbb5bab7760744ff8
--- /dev/null
+++ b/chrome/browser/extensions/api/input_ime/input_ime_event_router_base.h
@@ -0,0 +1,56 @@
+// 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"
Devlin 2016/01/07 23:08:29 forward declare
Azure Wei 2016/01/08 06:40:55 Done.
+#include "extensions/browser/extension_function.h"
Devlin 2016/01/07 23:08:29 needed?
Azure Wei 2016/01/08 06:40:55 Deleted.
+#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);
+ virtual ~InputImeEventRouterBase();
+
+ // 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:
Devlin 2016/01/07 23:08:29 indentation. Also, probably prefer a profile() acc
Azure Wei 2016/01/08 06:40:55 Done.
+ Profile* profile_;
+
+ private:
+ using RequestMap =
+ std::map<std::string,
+ std::pair<std::string,
+ ui::IMEEngineHandlerInterface::KeyEventDoneCallback>>;
+
+ unsigned int next_request_id_;
+ RequestMap request_map_;
+
+ 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