| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 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 | 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 "webkit/plugins/ppapi/ppb_input_event_impl.h" | 5 #include "webkit/plugins/ppapi/ppb_input_event_impl.h" |
| 6 | 6 |
| 7 #include "ppapi/shared_impl/var.h" | 7 #include "ppapi/shared_impl/var.h" |
| 8 #include "webkit/plugins/ppapi/plugin_module.h" | 8 #include "webkit/plugins/ppapi/plugin_module.h" |
| 9 #include "webkit/plugins/ppapi/ppapi_plugin_instance.h" | 9 #include "webkit/plugins/ppapi/ppapi_plugin_instance.h" |
| 10 | 10 |
| 11 using ppapi::InputEventData; | 11 using ppapi::InputEventData; |
| 12 using ppapi::InputEventImpl; | 12 using ppapi::InputEventImpl; |
| 13 using ppapi::StringVar; | 13 using ppapi::StringVar; |
| 14 using ppapi::thunk::PPB_InputEvent_API; | 14 using ppapi::thunk::PPB_InputEvent_API; |
| 15 | 15 |
| 16 namespace webkit { | 16 namespace webkit { |
| 17 namespace ppapi { | 17 namespace ppapi { |
| 18 | 18 |
| 19 PPB_InputEvent_Impl::PPB_InputEvent_Impl(PluginInstance* instance, | 19 PPB_InputEvent_Impl::PPB_InputEvent_Impl(PluginInstance* instance, |
| 20 const InputEventData& data) | 20 const InputEventData& data) |
| 21 : Resource(instance), | 21 : Resource(instance), |
| 22 InputEventImpl(data) { | 22 InputEventImpl(data) { |
| 23 } | 23 } |
| 24 | 24 |
| 25 // static | 25 // static |
| 26 PP_Resource PPB_InputEvent_Impl::Create(PluginInstance* instance, | 26 PP_Resource PPB_InputEvent_Impl::Create(PluginInstance* instance, |
| 27 const InputEventData& data) { | 27 const InputEventData& data) { |
| 28 scoped_refptr<PPB_InputEvent_Impl> event( | 28 return (new PPB_InputEvent_Impl(instance, data))->GetReference(); |
| 29 new PPB_InputEvent_Impl(instance, data)); | |
| 30 return event->GetReference(); | |
| 31 } | 29 } |
| 32 | 30 |
| 33 PPB_InputEvent_API* PPB_InputEvent_Impl::AsPPB_InputEvent_API() { | 31 PPB_InputEvent_API* PPB_InputEvent_Impl::AsPPB_InputEvent_API() { |
| 34 return this; | 32 return this; |
| 35 } | 33 } |
| 36 | 34 |
| 37 PP_Var PPB_InputEvent_Impl::StringToPPVar(const std::string& str) { | 35 PP_Var PPB_InputEvent_Impl::StringToPPVar(const std::string& str) { |
| 38 return StringVar::StringToPPVar(instance()->module()->pp_module(), str); | 36 return StringVar::StringToPPVar(instance()->module()->pp_module(), str); |
| 39 } | 37 } |
| 40 | 38 |
| 41 } // namespace ppapi | 39 } // namespace ppapi |
| 42 } // namespace webkit | 40 } // namespace webkit |
| OLD | NEW |