| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 // Pepper API support should be turned on for this module. | 5 // Pepper API support should be turned on for this module. |
| 6 #define PEPPER_APIS_ENABLED | 6 #define PEPPER_APIS_ENABLED |
| 7 | 7 |
| 8 #include "webkit/glue/plugins/plugin_host.h" | 8 #include "webkit/glue/plugins/plugin_host.h" |
| 9 | 9 |
| 10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 host_funcs_.pushpopupsenabledstate = NPN_PushPopupsEnabledState; | 104 host_funcs_.pushpopupsenabledstate = NPN_PushPopupsEnabledState; |
| 105 host_funcs_.poppopupsenabledstate = NPN_PopPopupsEnabledState; | 105 host_funcs_.poppopupsenabledstate = NPN_PopPopupsEnabledState; |
| 106 host_funcs_.enumerate = WebBindings::enumerate; | 106 host_funcs_.enumerate = WebBindings::enumerate; |
| 107 host_funcs_.pluginthreadasynccall = NPN_PluginThreadAsyncCall; | 107 host_funcs_.pluginthreadasynccall = NPN_PluginThreadAsyncCall; |
| 108 host_funcs_.construct = WebBindings::construct; | 108 host_funcs_.construct = WebBindings::construct; |
| 109 host_funcs_.getvalueforurl = NPN_GetValueForURL; | 109 host_funcs_.getvalueforurl = NPN_GetValueForURL; |
| 110 host_funcs_.setvalueforurl = NPN_SetValueForURL; | 110 host_funcs_.setvalueforurl = NPN_SetValueForURL; |
| 111 host_funcs_.getauthenticationinfo = NPN_GetAuthenticationInfo; | 111 host_funcs_.getauthenticationinfo = NPN_GetAuthenticationInfo; |
| 112 host_funcs_.scheduletimer = NPN_ScheduleTimer; | 112 host_funcs_.scheduletimer = NPN_ScheduleTimer; |
| 113 host_funcs_.unscheduletimer = NPN_UnscheduleTimer; | 113 host_funcs_.unscheduletimer = NPN_UnscheduleTimer; |
| 114 host_funcs_.popupcontextmenu = NPN_PopUpContextMenu; |
| 115 host_funcs_.convertpoint = NPN_ConvertPoint; |
| 114 } | 116 } |
| 115 | 117 |
| 116 void PluginHost::PatchNPNetscapeFuncs(NPNetscapeFuncs* overrides) { | 118 void PluginHost::PatchNPNetscapeFuncs(NPNetscapeFuncs* overrides) { |
| 117 // When running in the plugin process, we need to patch the NPN functions | 119 // When running in the plugin process, we need to patch the NPN functions |
| 118 // that the plugin calls to interact with NPObjects that we give. Otherwise | 120 // that the plugin calls to interact with NPObjects that we give. Otherwise |
| 119 // the plugin will call the v8 NPN functions, which won't work since we have | 121 // the plugin will call the v8 NPN functions, which won't work since we have |
| 120 // an NPObjectProxy and not a real v8 implementation. | 122 // an NPObjectProxy and not a real v8 implementation. |
| 121 if (overrides->invoke) | 123 if (overrides->invoke) |
| 122 host_funcs_.invoke = overrides->invoke; | 124 host_funcs_.invoke = overrides->invoke; |
| 123 | 125 |
| (...skipping 1058 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1182 return 0; | 1184 return 0; |
| 1183 | 1185 |
| 1184 return plugin->ScheduleTimer(interval, repeat, func); | 1186 return plugin->ScheduleTimer(interval, repeat, func); |
| 1185 } | 1187 } |
| 1186 | 1188 |
| 1187 void NPN_UnscheduleTimer(NPP id, uint32 timer_id) { | 1189 void NPN_UnscheduleTimer(NPP id, uint32 timer_id) { |
| 1188 scoped_refptr<NPAPI::PluginInstance> plugin = FindInstance(id); | 1190 scoped_refptr<NPAPI::PluginInstance> plugin = FindInstance(id); |
| 1189 if (plugin) | 1191 if (plugin) |
| 1190 plugin->UnscheduleTimer(timer_id); | 1192 plugin->UnscheduleTimer(timer_id); |
| 1191 } | 1193 } |
| 1194 |
| 1195 NPError NPN_PopUpContextMenu(NPP instance, NPMenu* menu) { |
| 1196 NOTIMPLEMENTED(); |
| 1197 return NPERR_GENERIC_ERROR; |
| 1198 } |
| 1199 |
| 1200 NPBool NPN_ConvertPoint(NPP instance, double sourceX, double sourceY, |
| 1201 NPCoordinateSpace sourceSpace, |
| 1202 double *destX, double *destY, |
| 1203 NPCoordinateSpace destSpace) { |
| 1204 NOTIMPLEMENTED(); |
| 1205 if (destX) |
| 1206 *destX = sourceX; |
| 1207 if (destY) |
| 1208 *destY = sourceY; |
| 1209 return FALSE; |
| 1210 } |
| 1192 } // extern "C" | 1211 } // extern "C" |
| OLD | NEW |