diff options
author | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-10-18 21:29:00 +0000 |
---|---|---|
committer | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-10-18 21:29:00 +0000 |
commit | 0b5781a63246fb4abf31f871b445a6d85970b19f (patch) | |
tree | 9a60d5eaa75093e26b73ac162dd14b6399c0e473 /content/browser/renderer_host/native_web_keyboard_event_win.cc | |
parent | 836c4164547c4c2fcb863f74126c47befbeac767 (diff) | |
download | chromium_src-0b5781a63246fb4abf31f871b445a6d85970b19f.zip chromium_src-0b5781a63246fb4abf31f871b445a6d85970b19f.tar.gz chromium_src-0b5781a63246fb4abf31f871b445a6d85970b19f.tar.bz2 |
Refactors NativeWebKeyboardEvent to be less ugly.
Replaces #ifdefs in the source file with use of a new gfx::NativeEvent typedef.
Adds NativeWebKeyboardEventAura.
http://crbug.com/99757
TEST=none
Review URL: http://codereview.chromium.org/8302013
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@106135 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/browser/renderer_host/native_web_keyboard_event_win.cc')
-rw-r--r-- | content/browser/renderer_host/native_web_keyboard_event_win.cc | 26 |
1 files changed, 9 insertions, 17 deletions
diff --git a/content/browser/renderer_host/native_web_keyboard_event_win.cc b/content/browser/renderer_host/native_web_keyboard_event_win.cc index c913d26..d72bb52 100644 --- a/content/browser/renderer_host/native_web_keyboard_event_win.cc +++ b/content/browser/renderer_host/native_web_keyboard_event_win.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 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. @@ -14,36 +14,28 @@ NativeWebKeyboardEvent::NativeWebKeyboardEvent() memset(&os_event, 0, sizeof(os_event)); } -NativeWebKeyboardEvent::NativeWebKeyboardEvent( - HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam) +NativeWebKeyboardEvent::NativeWebKeyboardEvent(gfx::NativeEvent native_event) : WebKeyboardEvent( - WebInputEventFactory::keyboardEvent(hwnd, message, wparam, lparam)), + WebInputEventFactory::keyboardEvent(native_event.hwnd, + native_event.message, + native_event.wParam, + native_event.lParam)), + os_event(native_event), skip_in_browser(false) { - os_event.hwnd = hwnd; - os_event.message = message; - os_event.wParam = wparam; - os_event.lParam = lparam; } NativeWebKeyboardEvent::NativeWebKeyboardEvent( const NativeWebKeyboardEvent& other) : WebKeyboardEvent(other), + os_event(other.os_event), skip_in_browser(other.skip_in_browser) { - os_event.hwnd = other.os_event.hwnd; - os_event.message = other.os_event.message; - os_event.wParam = other.os_event.wParam; - os_event.lParam = other.os_event.lParam; } NativeWebKeyboardEvent& NativeWebKeyboardEvent::operator=( const NativeWebKeyboardEvent& other) { WebKeyboardEvent::operator=(other); - os_event.hwnd = other.os_event.hwnd; - os_event.message = other.os_event.message; - os_event.wParam = other.os_event.wParam; - os_event.lParam = other.os_event.lParam; - + os_event = other.os_event; skip_in_browser = other.skip_in_browser; return *this; |