webengine/osswebengine/WebKit/s60/plugins/PluginSkin.cpp
changeset 1 7c90e6132015
parent 0 dd21522fd290
child 5 10e98eab6f85
equal deleted inserted replaced
0:dd21522fd290 1:7c90e6132015
   278     
   278     
   279     if (m_handle >= 0) {
   279     if (m_handle >= 0) {
   280         PluginHandler* pluginhandler = WebCore::StaticObjectsContainer::instance()->pluginHandler();
   280         PluginHandler* pluginhandler = WebCore::StaticObjectsContainer::instance()->pluginHandler();
   281         if ( pluginhandler) {
   281         if ( pluginhandler) {
   282             pluginhandler->unloadPlugin( m_handle );
   282             pluginhandler->unloadPlugin( m_handle );
       
   283             pluginhandler->removePluginObject(this);
       
   284             if (this == pluginhandler->activePlugin()) {
       
   285                 pluginhandler->setActivePlugin(NULL);
       
   286             }
   283         }
   287         }
   284         m_handle = -1;
   288         m_handle = -1;
   285     }
   289     }
   286     
   290     
   287     User::Free(m_instance); m_instance = 0;
   291     User::Free(m_instance); m_instance = 0;
   425         m_active = EFalse;
   429         m_active = EFalse;
   426         m_frame->frameView()->topView()->setFocusedElementType(TBrCtlDefs::EElementObjectBox);
   430         m_frame->frameView()->topView()->setFocusedElementType(TBrCtlDefs::EElementObjectBox);
   427         // Set right soft key
   431         // Set right soft key
   428         m_frame->frameView()->topView()->brCtl()->updateDefaultSoftkeys();
   432         m_frame->frameView()->topView()->brCtl()->updateDefaultSoftkeys();
   429         }
   433         }
       
   434     PluginHandler* pluginHandler = WebCore::StaticObjectsContainer::instance()->pluginHandler();
       
   435     pluginHandler->setPluginToActivate(NULL);
       
   436     pluginHandler->setActivePlugin(NULL);
   430     }
   437     }
   431 
   438 
   432 // ----------------------------------------------------------------------------
   439 // ----------------------------------------------------------------------------
   433 // PluginSkin::activate
   440 // PluginSkin::activate
   434 // From MWebCoreObjectWidget
   441 // From MWebCoreObjectWidget
   437 void PluginSkin::activate()
   444 void PluginSkin::activate()
   438 {
   445 {
   439     if (m_pluginClosed)
   446     if (m_pluginClosed)
   440         return;
   447         return;
   441 
   448 
       
   449     PluginHandler* pluginHandler = WebCore::StaticObjectsContainer::instance()->pluginHandler();
   442     TBool consumed(EFalse);
   450     TBool consumed(EFalse);
   443     if(m_pluginwin)
   451     if(m_pluginwin)
   444     {
   452     {
   445         if(m_canInteract)
   453         if(m_canInteract)
   446             {
   454             {
   449                 {
   457                 {
   450                 m_active = ETrue;
   458                 m_active = ETrue;
   451                 m_frame->frameView()->topView()->setFocusedElementType(TBrCtlDefs::EElementActivatedObjectBox);
   459                 m_frame->frameView()->topView()->setFocusedElementType(TBrCtlDefs::EElementActivatedObjectBox);
   452                 // Set right soft key
   460                 // Set right soft key
   453                 m_frame->frameView()->topView()->brCtl()->updateDefaultSoftkeys();
   461                 m_frame->frameView()->topView()->brCtl()->updateDefaultSoftkeys();
       
   462                 pluginHandler->setActivePlugin(this);
   454                 }
   463                 }
   455             }
   464             }
   456         else
   465         else
   457             {
   466             {
   458             m_active = ETrue;
   467             m_active = ETrue;
       
   468             pluginHandler->setActivePlugin(this);
   459             m_frame->frameView()->topView()->openPluginPlayer(m_pluginwin);
   469             m_frame->frameView()->topView()->openPluginPlayer(m_pluginwin);
   460             consumed = ETrue;
   470             consumed = ETrue;
   461             m_active = EFalse;
   471             m_active = EFalse;
       
   472             pluginHandler->setActivePlugin(NULL);
   462             }
   473             }
   463     } else {
   474     } else {
   464         if ( m_pluginSupported ) {
   475         if ( m_pluginSupported ) {
   465             NetscapePlugInStreamLoaderClient* pluginloader = NetscapePlugInStreamLoaderClient::NewL(*m_url, this, core(m_frame));
   476             NetscapePlugInStreamLoaderClient* pluginloader = NetscapePlugInStreamLoaderClient::NewL(*m_url, this, core(m_frame));
   466             if (pluginloader) {
   477             if (pluginloader) {
   601     clipRect.Intersection(m_rect);
   612     clipRect.Intersection(m_rect);
   602     setClipRect(clipRect);
   613     setClipRect(clipRect);
   603     // Create the PluginWin, if it doesn't exist,
   614     // Create the PluginWin, if it doesn't exist,
   604     m_pluginSupported = true;
   615     m_pluginSupported = true;
   605     m_pluginwin = PluginWin::NewL(this, *m_frame->frameView()->topView());
   616     m_pluginwin = PluginWin::NewL(this, *m_frame->frameView()->topView());
       
   617     pluginHandler->storePluginObject(this);
   606     m_frame->frameView()->invalidateRect(m_rect, EFalse);    
   618     m_frame->frameView()->invalidateRect(m_rect, EFalse);    
   607 }
   619 }
   608 
   620 
   609 
   621 
   610 // -----------------------------------------------------------------------------
   622 // -----------------------------------------------------------------------------