webengine/osswebengine/WebKit/s60/plugins/NpnImplementation.cpp
branchRCL_3
changeset 93 79859ed3eea9
parent 91 30342f40acbf
child 94 919f36ff910f
equal deleted inserted replaced
92:e1bea15f9a39 93:79859ed3eea9
    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 = NULL;
   335         WebCore::Element* pluginElement;
   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 && (pluginElement->hasTagName(appletTag) || pluginElement->hasTagName(embedTag) || pluginElement->hasTagName(objectTag)))
   341         if (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         }
       
   380             break;
   379             break;
   381             
   380             
   382        case NPNVGenericParameter: {   
   381        case NPNVGenericParameter: {   
   383             PluginWin* pluginWin = (PluginWin*)aInstance->ndata;
   382             PluginWin* pluginWin = (PluginWin*)aInstance->ndata;
   384             if (pluginWin) {
   383             if (pluginWin) {
   476                     pluginWin->HandlePointerEventFromPluginL(*event);
   475                     pluginWin->HandlePointerEventFromPluginL(*event);
   477                 }
   476                 }
   478             }
   477             }
   479             break;
   478             break;
   480             }
   479             }
   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; 
       
   497         case NPPVPluginDeactivate:
   480         case NPPVPluginDeactivate:
   498             {
   481             {
   499             PluginWin* pluginWin = (PluginWin*)aInstance->ndata;
   482             PluginWin* pluginWin = (PluginWin*)aInstance->ndata;
   500             if (pluginWin) {
   483             if (pluginWin) {
   501             TPoint* cursorPos; 
   484                 TPoint* cursorPos = static_cast<TPoint*>(aSetValue);
   502             
   485                 pluginWin->pluginDeactivate(*cursorPos);
   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);
       
   515             }
   486             }
   516         }
   487         }
   517         break;
   488         break;
   518         case NPPVpluginFullScreenBool:
   489         case NPPVpluginFullScreenBool:
   519             {
   490             {