| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "native_client/src/shared/ppapi_proxy/plugin_ppb_input_event.h" | 5 #include "native_client/src/shared/ppapi_proxy/plugin_ppb_input_event.h" |
| 6 | 6 |
| 7 #include <stdio.h> | 7 #include <stdio.h> |
| 8 #include <string.h> | 8 #include <string.h> |
| 9 | 9 |
| 10 #include "native_client/src/include/nacl_scoped_ptr.h" | 10 #include "native_client/src/include/nacl_scoped_ptr.h" |
| (...skipping 393 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 404 PluginInputEvent::PluginInputEvent() | 404 PluginInputEvent::PluginInputEvent() |
| 405 : character_text_(PP_MakeUndefined()) { | 405 : character_text_(PP_MakeUndefined()) { |
| 406 } | 406 } |
| 407 | 407 |
| 408 void PluginInputEvent::Init(const InputEventData& input_event_data, | 408 void PluginInputEvent::Init(const InputEventData& input_event_data, |
| 409 PP_Var character_text) { | 409 PP_Var character_text) { |
| 410 input_event_data_ = input_event_data; | 410 input_event_data_ = input_event_data; |
| 411 character_text_ = character_text; | 411 character_text_ = character_text; |
| 412 } | 412 } |
| 413 | 413 |
| 414 PluginInputEvent::~PluginInputEvent() { | |
| 415 // Release the character text. This is a no-op if it's not a string. | |
| 416 PPBVarInterface()->Release(character_text_); | |
| 417 } | |
| 418 | |
| 419 PP_InputEvent_Type PluginInputEvent::GetType() const { | 414 PP_InputEvent_Type PluginInputEvent::GetType() const { |
| 420 return input_event_data_.event_type; | 415 return input_event_data_.event_type; |
| 421 } | 416 } |
| 422 | 417 |
| 423 PP_TimeTicks PluginInputEvent::GetTimeStamp() const { | 418 PP_TimeTicks PluginInputEvent::GetTimeStamp() const { |
| 424 return input_event_data_.event_time_stamp; | 419 return input_event_data_.event_time_stamp; |
| 425 } | 420 } |
| 426 | 421 |
| 427 uint32_t PluginInputEvent::GetModifiers() const { | 422 uint32_t PluginInputEvent::GetModifiers() const { |
| 428 return input_event_data_.event_modifiers; | 423 return input_event_data_.event_modifiers; |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 467 | 462 |
| 468 PP_Bool PluginInputEvent::SetUsbKeyCode(uint32_t usb_key_code) { | 463 PP_Bool PluginInputEvent::SetUsbKeyCode(uint32_t usb_key_code) { |
| 469 input_event_data_.usb_key_code = usb_key_code; | 464 input_event_data_.usb_key_code = usb_key_code; |
| 470 return PP_TRUE; | 465 return PP_TRUE; |
| 471 } | 466 } |
| 472 | 467 |
| 473 uint32_t PluginInputEvent::GetUsbKeyCode() const { | 468 uint32_t PluginInputEvent::GetUsbKeyCode() const { |
| 474 return input_event_data_.usb_key_code; | 469 return input_event_data_.usb_key_code; |
| 475 } | 470 } |
| 476 | 471 |
| 472 PluginInputEvent::~PluginInputEvent() { |
| 473 // Release the character text. This is a no-op if it's not a string. |
| 474 PPBVarInterface()->Release(character_text_); |
| 475 } |
| 476 |
| 477 } // namespace ppapi_proxy | 477 } // namespace ppapi_proxy |
| OLD | NEW |