Home | History | Annotate | Download | only in renderer_host
      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.
      4 
      5 #include "content/public/browser/native_web_keyboard_event.h"
      6 
      7 #include "content/browser/renderer_host/input/web_input_event_builders_win.h"
      8 
      9 using WebKit::WebKeyboardEvent;
     10 
     11 namespace content {
     12 
     13 NativeWebKeyboardEvent::NativeWebKeyboardEvent()
     14     : skip_in_browser(false) {
     15   memset(&os_event, 0, sizeof(os_event));
     16 }
     17 
     18 NativeWebKeyboardEvent::NativeWebKeyboardEvent(gfx::NativeEvent native_event)
     19     : WebKeyboardEvent(
     20           WebKeyboardEventBuilder::Build(native_event.hwnd,
     21                                          native_event.message,
     22                                          native_event.wParam,
     23                                          native_event.lParam)),
     24       os_event(native_event),
     25       skip_in_browser(false) {
     26 }
     27 
     28 NativeWebKeyboardEvent::NativeWebKeyboardEvent(
     29     const NativeWebKeyboardEvent& other)
     30     : WebKeyboardEvent(other),
     31       os_event(other.os_event),
     32       skip_in_browser(other.skip_in_browser) {
     33 }
     34 
     35 NativeWebKeyboardEvent& NativeWebKeyboardEvent::operator=(
     36     const NativeWebKeyboardEvent& other) {
     37   WebKeyboardEvent::operator=(other);
     38 
     39   os_event = other.os_event;
     40   skip_in_browser = other.skip_in_browser;
     41 
     42   return *this;
     43 }
     44 
     45 NativeWebKeyboardEvent::~NativeWebKeyboardEvent() {
     46   // Noop under windows
     47 }
     48 
     49 }  // namespace content
     50