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

Unified Diff: content/browser/renderer_host/input/web_input_event_util.cc

Issue 1331013004: [KeyEvent Mac] Move WebInputEventFactory into chromium. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove forward declare as the bot got updated Created 5 years, 3 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/browser/renderer_host/input/web_input_event_util.cc
diff --git a/content/browser/renderer_host/input/web_input_event_util.cc b/content/browser/renderer_host/input/web_input_event_util.cc
index 973856df317f56eae24bd53967ecc08fc58ba346..40077bcf5350419748adbc0e69ada5f8a9e8b870 100644
--- a/content/browser/renderer_host/input/web_input_event_util.cc
+++ b/content/browser/renderer_host/input/web_input_event_util.cc
@@ -15,6 +15,7 @@
#include "ui/events/event_constants.h"
#include "ui/events/gesture_detection/gesture_event_data.h"
#include "ui/events/gesture_detection/motion_event.h"
+#include "ui/events/keycodes/dom/keycode_converter.h"
#include "ui/gfx/geometry/safe_integer_conversions.h"
using blink::WebGestureEvent;
@@ -187,4 +188,19 @@ int WebEventModifiersToEventFlags(int modifiers) {
return flags;
}
+blink::WebInputEvent::Modifiers DomCodeToWebInputEventModifiers(
+ ui::DomCode code) {
+ switch (ui::KeycodeConverter::DomCodeToLocation(code)) {
+ case ui::DomKeyLocation::LEFT:
+ return blink::WebInputEvent::IsLeft;
+ case ui::DomKeyLocation::RIGHT:
+ return blink::WebInputEvent::IsRight;
+ case ui::DomKeyLocation::NUMPAD:
+ return blink::WebInputEvent::IsKeyPad;
+ case ui::DomKeyLocation::STANDARD:
+ break;
+ }
+ return static_cast<blink::WebInputEvent::Modifiers>(0);
+}
+
} // namespace content

Powered by Google App Engine
This is Rietveld 408576698