equal
deleted
inserted
replaced
19 #include "../../bidi.h" |
19 #include "../../bidi.h" |
20 #include "HttpDefs.h" |
20 #include "HttpDefs.h" |
21 #include "NpnImplementation.h" |
21 #include "NpnImplementation.h" |
22 #include "PluginWin.h" |
22 #include "PluginWin.h" |
23 #include "PluginSkin.h" |
23 #include "PluginSkin.h" |
24 #include <CUserAgent.h> |
24 #include <cuseragent.h> |
25 #include <Element.h> |
25 #include <Element.h> |
26 #include <HTMLPlugInElement.h> |
26 #include <HTMLPlugInElement.h> |
27 #include <HTMLNames.h> |
27 #include <HTMLNames.h> |
28 |
28 |
29 using namespace WebCore::HTMLNames; |
29 using namespace WebCore::HTMLNames; |
330 } |
330 } |
331 break; |
331 break; |
332 |
332 |
333 case NPNVPluginElementNPObject: { |
333 case NPNVPluginElementNPObject: { |
334 PluginWin* pluginWin = (PluginWin*)aInstance->ndata; |
334 PluginWin* pluginWin = (PluginWin*)aInstance->ndata; |
335 WebCore::Element* pluginElement; |
335 WebCore::Element* pluginElement = NULL; |
336 if (pluginWin) { |
336 if (pluginWin) { |
337 pluginElement = pluginWin->pluginSkin()->getElement(); |
337 pluginElement = pluginWin->pluginSkin()->getElement(); |
338 } |
338 } |
339 |
339 |
340 NPObject* pluginScriptObject = 0; |
340 NPObject* pluginScriptObject = 0; |
341 if (pluginElement->hasTagName(appletTag) || pluginElement->hasTagName(embedTag) || pluginElement->hasTagName(objectTag)) |
341 if (pluginElement && (pluginElement->hasTagName(appletTag) || pluginElement->hasTagName(embedTag) || pluginElement->hasTagName(objectTag))) |
342 pluginScriptObject = static_cast<WebCore::HTMLPlugInElement*>(pluginElement)->getNPObject(); |
342 pluginScriptObject = static_cast<WebCore::HTMLPlugInElement*>(pluginElement)->getNPObject(); |
343 |
343 |
344 if (pluginScriptObject) |
344 if (pluginScriptObject) |
345 _NPN_RetainObject(pluginScriptObject); |
345 _NPN_RetainObject(pluginScriptObject); |
346 |
346 |
367 case NPNVasdEnabledBool: // Tells whether SmartUpdate (former name: ASD) is enabled; |
367 case NPNVasdEnabledBool: // Tells whether SmartUpdate (former name: ASD) is enabled; |
368 // true=SmartUpdate enabled, false=not enabled |
368 // true=SmartUpdate enabled, false=not enabled |
369 case NPNVisOfflineBool: // Tells whether offline mode is enabled; |
369 case NPNVisOfflineBool: // Tells whether offline mode is enabled; |
370 // true=offline mode enabled, false=not enabled |
370 // true=offline mode enabled, false=not enabled |
371 |
371 |
372 case NPNNetworkAccess: |
372 case NPNNetworkAccess: { |
373 PluginWin* pluginWin = (PluginWin*)aInstance->ndata; |
373 PluginWin* pluginWin = (PluginWin*)aInstance->ndata; |
374 TInt apId = -1; |
374 TInt apId = -1; |
375 if (pluginWin) { |
375 if (pluginWin) { |
376 apId = pluginWin->pluginSkin()->handleNetworkAccess(); |
376 apId = pluginWin->pluginSkin()->handleNetworkAccess(); |
377 } |
377 } |
378 *((TInt*) aRetValue) = apId; |
378 *((TInt*) aRetValue) = apId; |
|
379 } |
379 break; |
380 break; |
380 |
381 |
381 case NPNVGenericParameter: { |
382 case NPNVGenericParameter: { |
382 PluginWin* pluginWin = (PluginWin*)aInstance->ndata; |
383 PluginWin* pluginWin = (PluginWin*)aInstance->ndata; |
383 if (pluginWin) { |
384 if (pluginWin) { |
475 pluginWin->HandlePointerEventFromPluginL(*event); |
476 pluginWin->HandlePointerEventFromPluginL(*event); |
476 } |
477 } |
477 } |
478 } |
478 break; |
479 break; |
479 } |
480 } |
|
481 case NPPVPluginBitmap : |
|
482 { |
|
483 PluginWin* pluginWin = (PluginWin*)aInstance->ndata; |
|
484 if (pluginWin) { |
|
485 TInt* bitMapHandle = (TInt*)aSetValue; |
|
486 if (*bitMapHandle) { |
|
487 TInt handle = *bitMapHandle; |
|
488 pluginWin->SetBitmapFromPlugin(handle); |
|
489 } |
|
490 else |
|
491 { |
|
492 pluginWin->SetBitmapFromPlugin(KErrNone); |
|
493 } |
|
494 } |
|
495 } |
|
496 break; |
480 case NPPVPluginDeactivate: |
497 case NPPVPluginDeactivate: |
481 { |
498 { |
482 PluginWin* pluginWin = (PluginWin*)aInstance->ndata; |
499 PluginWin* pluginWin = (PluginWin*)aInstance->ndata; |
483 if (pluginWin) { |
500 if (pluginWin) { |
484 TPoint* cursorPos = static_cast<TPoint*>(aSetValue); |
501 TPoint* cursorPos; |
485 pluginWin->pluginDeactivate(*cursorPos); |
502 |
|
503 //EPMR-7XPHXV aSetValue is set as "(void*) 1" from |
|
504 //"CBrowserPluginControl::GoNormalScreenL" from the flash plugin |
|
505 //to avoid the Invalid pointer access, we are checking for |
|
506 //aSetValue and setting point as (0,0) and also for NULL Value |
|
507 if((aSetValue == (void*)1) || (!aSetValue)) { |
|
508 TPoint position(0,0); |
|
509 cursorPos = static_cast<TPoint*>(&position); |
|
510 } |
|
511 else { |
|
512 cursorPos = static_cast<TPoint*>(aSetValue); |
|
513 } |
|
514 pluginWin->pluginDeactivate(*cursorPos); |
486 } |
515 } |
487 } |
516 } |
488 break; |
517 break; |
489 case NPPVpluginFullScreenBool: |
518 case NPPVpluginFullScreenBool: |
490 { |
519 { |