webengine/osswebengine/WebKit/s60/plugins/PluginSkin.cpp
changeset 5 10e98eab6f85
parent 1 7c90e6132015
child 10 a359256acfc6
equal deleted inserted replaced
1:7c90e6132015 5:10e98eab6f85
   304 // PluginSkin::pluginFocusChanged()
   304 // PluginSkin::pluginFocusChanged()
   305 // PluginSkin function to show/hide fullscreen sprite
   305 // PluginSkin function to show/hide fullscreen sprite
   306 // ----------------------------------------------------------------------------
   306 // ----------------------------------------------------------------------------
   307 void PluginSkin::pluginFocusChanged(TBool focus) 
   307 void PluginSkin::pluginFocusChanged(TBool focus) 
   308 { 
   308 { 
   309 	  //Trigger Webview to notify all plugins about current view set to foreground/background for playing/pausing swf files (resp.)
       
   310 	  control(m_frame)->webView()->notifyPlugins(focus);
       
   311     if (control(m_frame)->webView()->pageFullScreenHandler() && 
   309     if (control(m_frame)->webView()->pageFullScreenHandler() && 
   312         !control(m_frame)->webView()->pageFullScreenHandler()->isFullScreenMode()) 
   310         !control(m_frame)->webView()->pageFullScreenHandler()->isFullScreenMode()) 
   313             return;
   311             return;
   314     
   312     
   315     if (focus && !m_flashContent)
   313     if (focus && !m_flashContent)
   316         {
   314         {
       
   315         TRAP_IGNORE(
   317         control(m_frame)->webView()->LeaveFullscreenBrowsingL();
   316         control(m_frame)->webView()->LeaveFullscreenBrowsingL();
   318         control(m_frame)->webView()->notifyFullscreenModeChangeL( EFalse );        
   317         control(m_frame)->webView()->notifyFullscreenModeChangeL( EFalse );
       
   318         );
   319         }
   319         }
   320     else if (focus)
   320     else if (focus)
   321         {
   321         {
       
   322         TRAP_IGNORE(
   322         control(m_frame)->webView()->pageFullScreenHandler()->showEscBtnL();
   323         control(m_frame)->webView()->pageFullScreenHandler()->showEscBtnL();
       
   324         );
   323         }
   325         }
   324     else 
   326     else 
   325         {
   327         {
       
   328         TRAP_IGNORE(
   326         control(m_frame)->webView()->pageFullScreenHandler()->hideEscBtnL();
   329         control(m_frame)->webView()->pageFullScreenHandler()->hideEscBtnL();
       
   330         );
   327         }
   331         }
   328 }
   332 }
   329 
   333 
   330 
   334 
   331 // ----------------------------------------------------------------------------
   335 // ----------------------------------------------------------------------------
   458                 m_active = ETrue;
   462                 m_active = ETrue;
   459                 m_frame->frameView()->topView()->setFocusedElementType(TBrCtlDefs::EElementActivatedObjectBox);
   463                 m_frame->frameView()->topView()->setFocusedElementType(TBrCtlDefs::EElementActivatedObjectBox);
   460                 // Set right soft key
   464                 // Set right soft key
   461                 m_frame->frameView()->topView()->brCtl()->updateDefaultSoftkeys();
   465                 m_frame->frameView()->topView()->brCtl()->updateDefaultSoftkeys();
   462                 pluginHandler->setActivePlugin(this);
   466                 pluginHandler->setActivePlugin(this);
       
   467                 pluginHandler->setPluginToActivate(NULL);
   463                 }
   468                 }
   464             }
   469             }
   465         else
   470         else
   466             {
   471             {
   467             m_active = ETrue;
   472             m_active = ETrue;
   468             pluginHandler->setActivePlugin(this);
   473             pluginHandler->setActivePlugin(this);
   469             m_frame->frameView()->topView()->openPluginPlayer(m_pluginwin);
   474             TRAP_IGNORE( m_frame->frameView()->topView()->openPluginPlayerL(m_pluginwin));
   470             consumed = ETrue;
   475             consumed = ETrue;
   471             m_active = EFalse;
   476             m_active = EFalse;
   472             pluginHandler->setActivePlugin(NULL);
   477             pluginHandler->setActivePlugin(NULL);
   473             }
   478             }
   474     } else {
   479     } else {
   475         if ( m_pluginSupported ) {
   480         if ( m_pluginSupported ) {
   476             NetscapePlugInStreamLoaderClient* pluginloader = NetscapePlugInStreamLoaderClient::NewL(*m_url, this, core(m_frame));
   481             NetscapePlugInStreamLoaderClient* pluginloader = NULL;
       
   482             TRAP_IGNORE( pluginloader = NetscapePlugInStreamLoaderClient::NewL(*m_url, this, core(m_frame)));
   477             if (pluginloader) {
   483             if (pluginloader) {
   478                 pluginloader->start();                            
   484                 pluginloader->start();                            
   479             }                                                            
   485             }                                                            
   480         }
   486         }
   481         else {
   487         else {
   617     pluginHandler->storePluginObject(this);
   623     pluginHandler->storePluginObject(this);
   618     m_frame->frameView()->invalidateRect(m_rect, EFalse);    
   624     m_frame->frameView()->invalidateRect(m_rect, EFalse);    
   619 }
   625 }
   620 
   626 
   621 
   627 
   622 // -----------------------------------------------------------------------------
       
   623 // PluginSkin::ViewFocusChanged
       
   624 // From MViewFocusObserver
       
   625 // Callback from the view when the focus changes
       
   626 // -----------------------------------------------------------------------------
       
   627 void PluginSkin::viewFocusChanged(TBool focused)
       
   628     {
       
   629     if (m_pluginwin)
       
   630         {
       
   631         m_pluginwin->viewFocusChanged(focused);
       
   632         }
       
   633     }
       
   634 
   628 
   635 // -----------------------------------------------------------------------------
   629 // -----------------------------------------------------------------------------
   636 // PluginSkin::PositionChanged
   630 // PluginSkin::PositionChanged
   637 // From MViewFocusObserver
   631 // From MViewFocusObserver
   638 // Callback from the view when the position changes
   632 // Callback from the view when the position changes
   995             }
   989             }
   996         }
   990         }
   997     
   991     
   998     return apId;
   992     return apId;
   999 }
   993 }
  1000 void PluginSkin::handlePluginForeground(TBool focus)
       
  1001 {
       
  1002     // Send Plugin Visible/Invisible event
       
  1003     if (m_pluginwin)
       
  1004     {
       
  1005        m_pluginwin->NotifyPluginVisible(focus); 
       
  1006     }
       
  1007 }
       
  1008 
       
  1009 
   994 
  1010 TPluginLoadMode PluginSkin::GetLoadMode(const TDesC* aWindowType)
   995 TPluginLoadMode PluginSkin::GetLoadMode(const TDesC* aWindowType)
  1011 {
   996 {
  1012     TWindowType windowType = GetWindowType(aWindowType);
   997     TWindowType windowType = GetWindowType(aWindowType);
  1013 
   998