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

Unified Diff: content/renderer/render_view_impl.cc

Issue 658183002: Add support for DOM3 KeyboardEvent keycode (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: "Updated to return WebString and int instead of long" Created 5 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: content/renderer/render_view_impl.cc
diff --git a/content/renderer/render_view_impl.cc b/content/renderer/render_view_impl.cc
index 324bbdfa98204918472e73b0ba2e8236f154119b..106f4a15a4576f1dcfae3d9c7fec580e4b5e1e84 100644
--- a/content/renderer/render_view_impl.cc
+++ b/content/renderer/render_view_impl.cc
@@ -182,6 +182,7 @@
#include "third_party/icu/source/common/unicode/uscript.h"
#include "ui/base/clipboard/clipboard.h"
#include "ui/base/ui_base_switches_util.h"
+#include "ui/events/keycodes/dom4/keycode_converter.h"
#include "ui/events/latency_info.h"
#include "ui/gfx/native_widget_types.h"
#include "ui/gfx/point.h"
@@ -1725,6 +1726,16 @@ bool RenderViewImpl::handleCurrentKeyboardEvent() {
return did_execute_command;
}
+WebString RenderViewImpl::domCodeStringFromEnum(int dom_code) {
+ return WebString::fromUTF8(ui::KeycodeConverter::DomCodeToCodeString(
+ static_cast<ui::DomCode>(dom_code)));
+}
+
+int RenderViewImpl::domEnumFromCodeString(const WebString& code) {
+ return static_cast<int>(ui::KeycodeConverter::CodeStringToDomCode(
+ code.utf8().data()));
+}
+
bool RenderViewImpl::runFileChooser(
const blink::WebFileChooserParams& params,
WebFileChooserCompletion* chooser_completion) {

Powered by Google App Engine
This is Rietveld 408576698