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

Unified Diff: content/child/blink_platform_impl.cc

Issue 929053004: [KeyboardEvent] Add embedder APIs to translate between Dom |key| enum and strings (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: "API has been updated on the blink side" Created 5 years, 9 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: content/child/blink_platform_impl.cc
diff --git a/content/child/blink_platform_impl.cc b/content/child/blink_platform_impl.cc
index 0b8777cdc495c4766262d7604c9983b54c16640e..a22117f698eb6842167749414cf3fd51cc890ea6 100644
--- a/content/child/blink_platform_impl.cc
+++ b/content/child/blink_platform_impl.cc
@@ -1275,4 +1275,14 @@ int BlinkPlatformImpl::domEnumFromCodeString(const WebString& code) {
code.utf8().data()));
}
+WebString BlinkPlatformImpl::domKeyStringFromEnum(int dom_key) {
+ return WebString::fromUTF8(ui::KeycodeConverter::DomKeyToKeyString(
+ static_cast<ui::DomKey>(dom_key)));
Wez 2015/04/21 02:25:58 nit: Strictly speaking the behaviour of static_cas
Habib Virji 2015/04/29 16:05:18 Right wez,this issue was discussed in domCodeStrin
+}
+
+int BlinkPlatformImpl::domKeyEnumFromString(const WebString& key) {
+ return static_cast<int>(ui::KeycodeConverter::KeyStringToDomKey(
+ key.utf8().data()));
+}
+
} // namespace content

Powered by Google App Engine
This is Rietveld 408576698