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

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

Issue 19776016: Add files. Does not compile yet! (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: builders Created 7 years, 5 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_posix.cc
diff --git a/content/browser/renderer_host/input/web_input_event_posix.cc b/content/browser/renderer_host/input/web_input_event_posix.cc
new file mode 100644
index 0000000000000000000000000000000000000000..d7757ce4c91c88c4dd1d6245c39d4c5686cdb00e
--- /dev/null
+++ b/content/browser/renderer_host/input/web_input_event_posix.cc
@@ -0,0 +1,43 @@
+// Copyright (c) 2013 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.
+
+#include "content/browser/renderer_host/input/web_input_event_posix.h"
+
+namespace content {
+
+ui::KeyboardCode GetWindowsKeyCodeWithoutLocation(ui::KeyboardCode key_code) {
+ switch (key_code) {
+ case ui::VKEY_LCONTROL:
+ case ui::VKEY_RCONTROL:
+ return ui::VKEY_CONTROL;
+ case ui::VKEY_LSHIFT:
+ case ui::VKEY_RSHIFT:
+ return ui::VKEY_SHIFT;
+ case ui::VKEY_LMENU:
+ case ui::VKEY_RMENU:
+ return ui::VKEY_MENU;
+ default:
+ return key_code;
+ }
+}
+
+WebKit::WebInputEvent::Modifiers GetLocationModifiersFromWindowsKeyCode(
+ ui::KeyboardCode key_code) {
+ switch (key_code) {
+ case ui::VKEY_LCONTROL:
+ case ui::VKEY_LSHIFT:
+ case ui::VKEY_LMENU:
+ case ui::VKEY_LWIN:
+ return WebKit::WebInputEvent::IsLeft;
+ case ui::VKEY_RCONTROL:
+ case ui::VKEY_RSHIFT:
+ case ui::VKEY_RMENU:
+ case ui::VKEY_RWIN:
+ return WebKit::WebInputEvent::IsRight;
+ default:
+ return static_cast<WebKit::WebInputEvent::Modifiers>(0);
+ }
+}
+
+} // namespace content

Powered by Google App Engine
This is Rietveld 408576698