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 3163a1c3d74c023e0195e0466f81b1ec18c8189a..79e4e412415d278672a84d65c172372a675f4f7d 100644 |
--- a/webkit/plugins/ppapi/ppapi_plugin_instance.cc |
+++ b/webkit/plugins/ppapi/ppapi_plugin_instance.cc |
@@ -200,6 +200,18 @@ PluginInstance* PluginInstance::Create0_5(PluginDelegate* delegate, |
new ::ppapi::PPP_Instance_Combined(*interface)); |
} |
+// static |
+PluginInstance* PluginInstance::Create1_0(PluginDelegate* delegate, |
+ PluginModule* module, |
+ const void* ppp_instance_if_1_0) { |
+ const PPP_Instance_1_0* interface = |
+ static_cast<const PPP_Instance_1_0*>(ppp_instance_if_1_0); |
+ return new PluginInstance( |
+ delegate, |
+ module, |
+ new ::ppapi::PPP_Instance_Combined(*interface)); |
+} |
+ |
PluginInstance::PluginInstance( |
PluginDelegate* delegate, |
PluginModule* module, |
@@ -468,15 +480,19 @@ bool PluginInstance::HandleInputEvent(const WebKit::WebInputEvent& event, |
} |
} |
- // For compatibility, also send all input events through the old interface. |
+ // For compatibility, also send all input events through the old interface, |
+ // if it exists. |
// TODO(brettw) remove this. |
- std::vector<PP_InputEvent> pp_events; |
- CreatePPEvent(event, &pp_events); |
- |
- // Each input event may generate more than one PP_InputEvent. |
- for (size_t i = 0; i < pp_events.size(); i++) { |
- rv |= PPBoolToBool(instance_interface_->HandleInputEvent(pp_instance(), |
- &pp_events[i])); |
+ if (instance_interface_->HandleInputEvent_0_5) { |
+ std::vector<PP_InputEvent> pp_events; |
+ CreatePPEvent(event, &pp_events); |
+ |
+ // Each input event may generate more than one PP_InputEvent. |
+ for (size_t i = 0; i < pp_events.size(); i++) { |
+ rv |= PPBoolToBool( |
brettw
2011/07/20 04:18:48
This should be PP_ToBool now.
|
+ instance_interface_->HandleInputEvent_0_5(pp_instance(), |
+ &pp_events[i])); |
+ } |
} |
if (cursor_.get()) |