webengine/osswebengine/WebKit/s60/webview/WebFrame.cpp
branchRCL_3
changeset 47 e1bea15f9a39
parent 44 800203832575
child 48 79859ed3eea9
equal deleted inserted replaced
46:30342f40acbf 47:e1bea15f9a39
   283 void WebFrame::notifyPluginsOfPositionChange()
   283 void WebFrame::notifyPluginsOfPositionChange()
   284 {    
   284 {    
   285     PluginHandler* plghandler = StaticObjectsContainer::instance()->pluginHandler();
   285     PluginHandler* plghandler = StaticObjectsContainer::instance()->pluginHandler();
   286     WTF::HashSet<PluginSkin*> pluginObjs = plghandler->pluginObjects();
   286     WTF::HashSet<PluginSkin*> pluginObjs = plghandler->pluginObjects();
   287     for(WTF::HashSet<PluginSkin*>::iterator it = pluginObjs.begin() ;  it != pluginObjs.end() ; ++it ) {
   287     for(WTF::HashSet<PluginSkin*>::iterator it = pluginObjs.begin() ;  it != pluginObjs.end() ; ++it ) {
   288         notifyPluginOfPositionChange(static_cast<PluginSkin*> (*it));
   288         PluginSkin* plg = static_cast<PluginSkin*> (*it);
       
   289         WebFrame* plgWebFrame = plg->getWebFrame();
       
   290         CBrCtl*   plbrCtl = control(plg->frame());
       
   291         CBrCtl*   pgbrCtl = control(this);
       
   292 
       
   293         if(plbrCtl == pgbrCtl)
       
   294             {
       
   295             notifyPluginOfPositionChange(static_cast<PluginSkin*> (*it));   
       
   296             }
   289     }
   297     }
   290 }
   298 }
   291 
   299 
   292 void WebFrame::notifyPluginOfPositionChange(PluginSkin* plg)
   300 void WebFrame::notifyPluginOfPositionChange(PluginSkin* plg)
   293 {        
   301 {        
   434     return frame->bridge()->frame();
   442     return frame->bridge()->frame();
   435 }
   443 }
   436 
   444 
   437 WebFrame* kit(Frame* frame)
   445 WebFrame* kit(Frame* frame)
   438 {
   446 {
   439     return frame ? ((WebFrameBridge *)frame->bridge())->webFrame(): NULL;
   447     if( frame && frame->bridge() )    
       
   448     	return  ((WebFrameBridge *)frame->bridge())->webFrame();
       
   449     return NULL;	
   440 }
   450 }
   441 
   451 
   442 WebView *kit(Page* page)
   452 WebView *kit(Page* page)
   443 {
   453 {
   444     return page ? static_cast<WebChromeClient*>(page->chrome()->client())->webView() : 0;
   454     return page ? static_cast<WebChromeClient*>(page->chrome()->client())->webView() : 0;
   601        }
   611        }
   602 
   612 
   603 
   613 
   604 }
   614 }
   605 
   615 
       
   616 void WebFrame::notifyPluginFocusChangeEvent(TBool visible)
       
   617 {
       
   618     MWebCoreObjectWidget* view = NULL;  
       
   619     Frame* coreFrame = core(this); 
       
   620     
       
   621     for (Frame* frame = coreFrame; frame; frame = frame->tree()->traverseNext(coreFrame)) { 
       
   622    
       
   623         PassRefPtr<HTMLCollection> objects = frame->document()->objects();      
       
   624         for (Node* n = objects->firstItem(); n; n = objects->nextItem()) { 
       
   625             view = widget(n);  
       
   626             if (view && static_cast<PluginSkin*>(view)->isFlashPlugin()) { 
       
   627                 if(visible)
       
   628                     static_cast<PluginSkin*>(view)->HandleGainingForeground();
       
   629                 else
       
   630                     static_cast<PluginSkin*>(view)->HandleLosingForeground();
       
   631             } 
       
   632         } 
       
   633         
       
   634         PassRefPtr<HTMLCollection> embeds = frame->document()->embeds();        
       
   635         for (Node* n = embeds->firstItem(); n; n = embeds->nextItem()) { 
       
   636             view = widget(n); 
       
   637             if (view && static_cast<PluginSkin*>(view)->isFlashPlugin()) { 
       
   638                 if(visible)
       
   639                     static_cast<PluginSkin*>(view)->HandleGainingForeground();
       
   640                 else
       
   641                     static_cast<PluginSkin*>(view)->HandleLosingForeground();
       
   642             } 
       
   643         }
       
   644     }
       
   645         
       
   646 }
       
   647 
   606 void WebFrame::reCreatePlugins()
   648 void WebFrame::reCreatePlugins()
   607 {
   649 {
   608     MWebCoreObjectWidget* view = NULL;  
   650     MWebCoreObjectWidget* view = NULL;  
   609     Frame* coreFrame = core(this); 
   651     Frame* coreFrame = core(this); 
   610     PluginSkin* plg = 0; 
   652     PluginSkin* plg = 0; 
   613         PassRefPtr<HTMLCollection> objects = frame->document()->objects();      
   655         PassRefPtr<HTMLCollection> objects = frame->document()->objects();      
   614         for (Node* n = objects->firstItem(); n; n = objects->nextItem()) { 
   656         for (Node* n = objects->firstItem(); n; n = objects->nextItem()) { 
   615             view = widget(n);  
   657             view = widget(n);  
   616             if (view) { 
   658             if (view) { 
   617                 plg = static_cast<PluginSkin*>(view); 
   659                 plg = static_cast<PluginSkin*>(view); 
   618                 if (plg->activeStreams() > 0)
   660                 plg->reCreatePlugin(); 
   619                     plg->reCreatePlugin(); 
       
   620             } 
   661             } 
   621         } 
   662         } 
   622         PassRefPtr<HTMLCollection> embeds = frame->document()->embeds();        
   663         PassRefPtr<HTMLCollection> embeds = frame->document()->embeds();        
   623         for (Node* n = embeds->firstItem(); n; n = embeds->nextItem()) { 
   664         for (Node* n = embeds->firstItem(); n; n = embeds->nextItem()) { 
   624             view = widget(n); 
   665             view = widget(n); 
   625             if (view) { 
   666             if (view) { 
   626                 plg = static_cast<PluginSkin*>(view); 
   667                 plg = static_cast<PluginSkin*>(view); 
   627                 if (plg->activeStreams() > 0)
   668                 plg->reCreatePlugin(); 
   628                     plg->reCreatePlugin(); 
       
   629             } 
   669             } 
   630         }
   670         }
   631     }
   671     }
   632 }
   672 }
   633 
   673