Save errno for logging before potentially overwriting it.
[chromium-blink-merge.git] / content / browser / renderer_host / native_web_keyboard_event_win.cc
blob4a800a0e78ec49d6b4877c94497cb89bb3ac9a26
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "content/public/browser/native_web_keyboard_event.h"
7 #include "third_party/WebKit/public/web/win/WebInputEventFactory.h"
9 using WebKit::WebInputEventFactory;
10 using WebKit::WebKeyboardEvent;
12 namespace content {
14 NativeWebKeyboardEvent::NativeWebKeyboardEvent()
15 : skip_in_browser(false) {
16 memset(&os_event, 0, sizeof(os_event));
19 NativeWebKeyboardEvent::NativeWebKeyboardEvent(gfx::NativeEvent native_event)
20 : WebKeyboardEvent(
21 WebInputEventFactory::keyboardEvent(native_event.hwnd,
22 native_event.message,
23 native_event.wParam,
24 native_event.lParam)),
25 os_event(native_event),
26 skip_in_browser(false) {
29 NativeWebKeyboardEvent::NativeWebKeyboardEvent(
30 const NativeWebKeyboardEvent& other)
31 : WebKeyboardEvent(other),
32 os_event(other.os_event),
33 skip_in_browser(other.skip_in_browser) {
36 NativeWebKeyboardEvent& NativeWebKeyboardEvent::operator=(
37 const NativeWebKeyboardEvent& other) {
38 WebKeyboardEvent::operator=(other);
40 os_event = other.os_event;
41 skip_in_browser = other.skip_in_browser;
43 return *this;
46 NativeWebKeyboardEvent::~NativeWebKeyboardEvent() {
47 // Noop under windows
50 } // namespace content