Index: webkit/plugins/ppapi/ppapi_plugin_instance.cc |
diff --git a/webkit/plugins/ppapi/ppapi_plugin_instance.cc b/webkit/plugins/ppapi/ppapi_plugin_instance.cc |
index 11378904d637a7e86fd18a7db0a6c42dd43b9cca..aa174789db277d9143fb429004ecc007d1e972e1 100644 |
--- a/webkit/plugins/ppapi/ppapi_plugin_instance.cc |
+++ b/webkit/plugins/ppapi/ppapi_plugin_instance.cc |
@@ -333,6 +333,16 @@ PluginInstance* PluginInstance::Create(PluginDelegate* delegate, |
return new PluginInstance(delegate, module, ppp_instance_combined); |
} |
+PluginInstance::GamepadImpl::GamepadImpl(PluginDelegate* delegate) |
+ : delegate_(delegate) { |
+} |
+ |
+void PluginInstance::GamepadImpl::Sample(PP_GamepadsSampleData* data) { |
+ WebKit::WebGamepads webkit_data; |
+ delegate_->SampleGamepads(&webkit_data); |
+ ConvertWebKitGamepadData(webkit_data, data); |
+} |
+ |
PluginInstance::PluginInstance( |
PluginDelegate* delegate, |
PluginModule* module, |
@@ -360,6 +370,7 @@ PluginInstance::PluginInstance( |
plugin_zoom_interface_(NULL), |
checked_for_plugin_input_event_interface_(false), |
checked_for_plugin_messaging_interface_(false), |
+ gamepad_impl_(delegate), |
plugin_print_interface_(NULL), |
plugin_graphics_3d_interface_(NULL), |
always_on_top_(false), |
@@ -1551,13 +1562,6 @@ bool PluginInstance::IsRectTopmost(const gfx::Rect& rect) { |
#endif |
} |
-void PluginInstance::SampleGamepads(PP_Instance instance, |
- PP_GamepadsSampleData* data) { |
- WebKit::WebGamepads webkit_data; |
- delegate()->SampleGamepads(&webkit_data); |
- ConvertWebKitGamepadData(webkit_data, data); |
-} |
- |
bool PluginInstance::IsViewAccelerated() { |
if (!container_) |
return false; |
@@ -2085,6 +2089,11 @@ PP_Bool PluginInstance::GetScreenSize(PP_Instance instance, PP_Size* size) { |
return &flash_impl_; |
} |
+::ppapi::thunk::PPB_Gamepad_API* PluginInstance::GetGamepadAPI( |
+ PP_Instance /* instance */) { |
+ return &gamepad_impl_; |
+} |
+ |
int32_t PluginInstance::RequestInputEvents(PP_Instance instance, |
uint32_t event_classes) { |
input_event_mask_ |= event_classes; |