webengine/osswebengine/WebKit/s60/plugins/PluginSkin.cpp
branchRCL_3
changeset 64 ac77f89b1d9e
parent 62 c711bdda59f4
child 67 4917f9bf7995
equal deleted inserted replaced
62:c711bdda59f4 64:ac77f89b1d9e
   507 // PluginSkin::MakeVisible
   507 // PluginSkin::MakeVisible
   508 // From MWebCoreObjectWidget
   508 // From MWebCoreObjectWidget
   509 // ----------------------------------------------------------------------------
   509 // ----------------------------------------------------------------------------
   510 void PluginSkin::makeVisible( TBool visible )
   510 void PluginSkin::makeVisible( TBool visible )
   511     {
   511     {
       
   512     // if visible is true for a plugin, make sure that the plugin is actually visible in the window before proceeding 
       
   513     TBool visibility = EFalse;
       
   514     if (visible) {
       
   515         TRect fullRect(getPluginWinRect());
       
   516         TRect clipRect(getClipRect());
       
   517         TRect frameRect(m_frame->frameView()->rect());
       
   518         TRect viewRect = control(m_frame)->webView()->Rect();
       
   519         TBool isPageViewMode = control(m_frame)->webView()->inPageViewMode();
       
   520         WebFrame* pf = m_frame;
       
   521         TPoint p = frameRect.iTl;
       
   522 
       
   523         if (m_frame->parentFrame()) {
       
   524             pf = m_frame->parentFrame();
       
   525             p = pf->frameView()->frameCoordsInViewCoords(frameRect.iTl); 
       
   526         }
       
   527         TSize  sz = pf->frameView()->toViewCoords(frameRect.Size());
       
   528         TRect frameRectInViewCoord = TRect(p, sz);
       
   529         TBool isPluginVisible = frameRectInViewCoord.Intersects(fullRect); 
       
   530         TBool isFrameVisible = m_frame->frameView()->isVisible() && 
       
   531                                 frameRectInViewCoord.Intersects(viewRect);
       
   532         
       
   533         visibility = isFrameVisible && !isPageViewMode && isPluginVisible;
       
   534       
       
   535     }
   512     if ( m_pluginwin )
   536     if ( m_pluginwin )
   513         {
   537         {
       
   538         if (visible && !visibility)
       
   539             visible = EFalse;
       
   540         
   514         m_visible = visible;
   541         m_visible = visible;
   515         if(m_active)
   542         if(m_active && !visible)
   516             deActivate();
   543             deActivate();
   517         m_pluginwin->makeVisible(visible);
   544         m_pluginwin->makeVisible(visible);
   518         }
   545         }
   519     }
   546     }
   520 
   547 
  1240     NetscapePlugInStreamLoaderClient* pluginloader = NetscapePlugInStreamLoaderClient::NewL(m_url->Des(), this, core(m_frame));
  1267     NetscapePlugInStreamLoaderClient* pluginloader = NetscapePlugInStreamLoaderClient::NewL(m_url->Des(), this, core(m_frame));
  1241     if (pluginloader) {
  1268     if (pluginloader) {
  1242         pluginloader->start();                            
  1269         pluginloader->start();                            
  1243     }    
  1270     }    
  1244 }
  1271 }
       
  1272 
       
  1273 void PluginSkin::PlayPauseNotify(bool pause)
       
  1274 {
       
  1275     if(m_pluginwin)
       
  1276         m_pluginwin->PlayPausePluginL(pause);
       
  1277 }