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

Unified Diff: content/browser/renderer_host/native_web_keyboard_event_aura.cc

Issue 2569273002: Add constructors to WebInputEvents and setters so we can work at cleaning up these public structs. (Closed)
Patch Set: Rebase Created 3 years, 12 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/native_web_keyboard_event_aura.cc
diff --git a/content/browser/renderer_host/native_web_keyboard_event_aura.cc b/content/browser/renderer_host/native_web_keyboard_event_aura.cc
index 4ae4a65f60120b9b13f89d00bdc1e8b589e74be8..10368f357aec5c3cae7c5274f78caad9fb3a1ef1 100644
--- a/content/browser/renderer_host/native_web_keyboard_event_aura.cc
+++ b/content/browser/renderer_host/native_web_keyboard_event_aura.cc
@@ -25,10 +25,19 @@ using blink::WebKeyboardEvent;
namespace content {
-NativeWebKeyboardEvent::NativeWebKeyboardEvent()
- : os_event(NULL),
- skip_in_browser(false) {
-}
+NativeWebKeyboardEvent::NativeWebKeyboardEvent(blink::WebInputEvent::Type type,
+ int modifiers,
+ base::TimeTicks timestamp)
+ : NativeWebKeyboardEvent(type,
+ modifiers,
+ ui::EventTimeStampToSeconds(timestamp)) {}
+
+NativeWebKeyboardEvent::NativeWebKeyboardEvent(blink::WebInputEvent::Type type,
+ int modifiers,
+ double timestampSeconds)
+ : WebKeyboardEvent(type, modifiers, timestampSeconds),
+ os_event(nullptr),
+ skip_in_browser(false) {}
NativeWebKeyboardEvent::NativeWebKeyboardEvent(gfx::NativeEvent native_event)
: NativeWebKeyboardEvent(static_cast<ui::KeyEvent&>(*native_event)) {
@@ -49,7 +58,7 @@ NativeWebKeyboardEvent::NativeWebKeyboardEvent(
NativeWebKeyboardEvent::NativeWebKeyboardEvent(const ui::KeyEvent& key_event,
base::char16 character)
: WebKeyboardEvent(ui::MakeWebKeyboardEvent(key_event)),
- os_event(NULL),
+ os_event(nullptr),
skip_in_browser(false) {
type = blink::WebInputEvent::Char;
windowsKeyCode = character;

Powered by Google App Engine
This is Rietveld 408576698