webengine/osswebengine/WebKit/s60/plugins/PluginWin.cpp
branchRCL_3
changeset 47 e1bea15f9a39
parent 46 30342f40acbf
child 48 79859ed3eea9
equal deleted inserted replaced
46:30342f40acbf 47:e1bea15f9a39
   392     
   392     
   393     if((!m_pluginHasBitmap) && (IsVisible() != visible) && (!view->isPinchZoom()))
   393     if((!m_pluginHasBitmap) && (IsVisible() != visible) && (!view->isPinchZoom()))
   394     {
   394     {
   395         CCoeControl::MakeVisible(visible);
   395         CCoeControl::MakeVisible(visible);
   396     }
   396     }
   397     TPluginLoadMode loadmode = m_pluginskin->getLoadMode();
       
   398     if(loadmode == ELoadModeNew ){
       
   399         m_pluginskin->setLoadMode(ELoadModeNone);
       
   400         if(visible)
       
   401             HandleGainingForeground();
       
   402         else
       
   403             HandleLosingForeground();
       
   404     }
       
   405     
   397     
   406     PluginHandler* pluginHandler = WebCore::StaticObjectsContainer::instance()->pluginHandler();
   398     PluginHandler* pluginHandler = WebCore::StaticObjectsContainer::instance()->pluginHandler();
   407     int index = pluginHandler->getVisiblePlugins().Find(m_pluginskin);
   399     int index = pluginHandler->getVisiblePlugins().Find(m_pluginskin);
   408     if (visible && (m_visibilty != visible) && (index == KErrNotFound)) {
   400     if (visible && (m_visibilty != visible) && (index == KErrNotFound)) {
   409         pluginHandler->getVisiblePlugins().AppendL(m_pluginskin);
   401         pluginHandler->getVisiblePlugins().AppendL(m_pluginskin);
   582     if (m_pluginskin->pluginPlayer()) {
   574     if (m_pluginskin->pluginPlayer()) {
   583         DrawNow();
   575         DrawNow();
   584     }
   576     }
   585     else {
   577     else {
   586         WebFrame* mf = (m_pluginskin->frame());
   578         WebFrame* mf = (m_pluginskin->frame());
   587         WebFrameView* fv = mf->frameView();
   579         if (mf && mf->frameView()) {
   588         TRect rect(Rect());
   580             WebFrameView* fv = mf->frameView();
   589         rect = TRect(fv->viewCoordsInFrameCoords(Rect().iTl), fv->viewCoordsInFrameCoords(Rect().iBr));
   581             TRect rect(Rect());
   590     if (mf && mf->frameView())
   582             rect = TRect(fv->viewCoordsInFrameCoords(Rect().iTl), fv->viewCoordsInFrameCoords(Rect().iBr));
   591             mf->frameView()->invalidateRect(rect, drawNow);
   583             fv->invalidateRect(rect, drawNow);
       
   584         }
   592     }
   585     }
   593 }
   586 }
   594 
   587 
   595 // -----------------------------------------------------------------------------
   588 // -----------------------------------------------------------------------------
   596 // CPluginWin::MoveWindow
   589 // CPluginWin::MoveWindow
   770 
   763 
   771 void PluginWin::GetBitmapFromPlugin (bool status)
   764 void PluginWin::GetBitmapFromPlugin (bool status)
   772     {
   765     {
   773     if(m_notifier) {
   766     if(m_notifier) {
   774          if (status) {
   767          if (status) {
       
   768              //if plugin fails to send bitmap even though the "ECollectBitmapSupported"
       
   769              CBrCtl*   brCtl = control(m_pluginskin->frame());    
       
   770              WebView*  view = brCtl->webView();
       
   771              
       
   772              if(view && view->isPinchZoom())
       
   773                  m_PluginInvisibleOnPinchZoom = ETrue; 
   775              m_notifier->NotifyL( MPluginNotifier::ECollectBitmap, (void*)1 );
   774              m_notifier->NotifyL( MPluginNotifier::ECollectBitmap, (void*)1 );
       
   775 			 
       
   776 			 //if Notify CollectBitmap failed to send bitmap to SetBitmapFromPlugin, 
       
   777 			 //Then forcefully make the plugin window invisible for pinch zoom 
       
   778              if(m_PluginInvisibleOnPinchZoom)
       
   779                  { 
       
   780                  m_PluginInvisibleOnPinchZoom = EFalse; 
       
   781                  if (IsVisible())
       
   782                      {
       
   783                      MakeVisible(false);
       
   784                      }
       
   785                  }
   776          }
   786          }
   777          else {
   787          else {
   778              m_notifier->NotifyL( MPluginNotifier::ECollectBitmap, (void*)0 );
   788              m_notifier->NotifyL( MPluginNotifier::ECollectBitmap, (void*)0 );
   779              
   789              
   780              m_pluginHasBitmap = 0;
   790              m_pluginHasBitmap = 0;
   925 // Plugin video is captured in CFBsBitmap and handle is passed to plugin window 
   935 // Plugin video is captured in CFBsBitmap and handle is passed to plugin window 
   926 // Duplicate the bitmap handle and use it to draw while Panning or Pinch zoom
   936 // Duplicate the bitmap handle and use it to draw while Panning or Pinch zoom
   927 // -----------------------------------------------------------------------------
   937 // -----------------------------------------------------------------------------
   928 void PluginWin::SetBitmapFromPlugin(TInt aHandle)
   938 void PluginWin::SetBitmapFromPlugin(TInt aHandle)
   929     {
   939     {
   930 
   940     m_PluginInvisibleOnPinchZoom = EFalse;
   931 //    m_pluginfocus = 1;
       
   932 
   941 
   933     if (aHandle)
   942     if (aHandle)
   934         {
   943         {
   935         if (m_pausedBitmap)
   944         if (m_pausedBitmap)
   936             {
   945             {
   992         context->setClippingRect(plWinRect);
  1001         context->setClippingRect(plWinRect);
   993         }
  1002         }
   994     gc.DrawBitmap(plWinRect, m_pausedBitmap);
  1003     gc.DrawBitmap(plWinRect, m_pausedBitmap);
   995     context->restore(saved);
  1004     context->restore(saved);
   996     }
  1005     }
       
  1006 
       
  1007 // Notify Plugins about the change in Access Point during Upgrade / Downgrade
       
  1008 void PluginWin::notifyAPChange(void* ap)
       
  1009 {
       
  1010     if (m_notifier) {
       
  1011         m_notifier->NotifyL( MPluginNotifier::EAccesPointChanged, ap );
       
  1012     }
       
  1013 }