278 DocumentLoader* WebFrame::documentLoader() |
278 DocumentLoader* WebFrame::documentLoader() |
279 { |
279 { |
280 return frameLoader()->documentLoader(); |
280 return frameLoader()->documentLoader(); |
281 } |
281 } |
282 |
282 |
283 void WebFrame::notifyPluginsOfScrolling() |
283 void WebFrame::notifyPluginsOfPositionChange() |
284 { |
284 { |
285 Frame* coreFrame = core(this); |
285 PluginHandler* plghandler = StaticObjectsContainer::instance()->pluginHandler(); |
286 for (Frame* frame = coreFrame; frame; frame = frame->tree()->traverseNext(coreFrame)) { |
286 WTF::HashSet<PluginSkin*> pluginObjs = plghandler->pluginObjects(); |
287 PassRefPtr<HTMLCollection> objects = frame->document()->objects(); |
287 for(WTF::HashSet<PluginSkin*>::iterator it = pluginObjs.begin() ; it != pluginObjs.end() ; ++it ) { |
288 for (Node* n = objects->firstItem(); n; n = objects->nextItem()) |
288 notifyPluginOfPositionChange(static_cast<PluginSkin*> (*it)); |
289 notifyPluginOfScrolling(n->renderer()); |
289 } |
290 |
290 } |
291 PassRefPtr<HTMLCollection> embeds = frame->document()->embeds(); |
291 |
292 for (Node* n = embeds->firstItem(); n; n = embeds->nextItem()) |
292 void WebFrame::notifyPluginOfPositionChange(PluginSkin* plg) |
293 notifyPluginOfScrolling(n->renderer()); |
|
294 |
|
295 } |
|
296 } |
|
297 |
|
298 void WebFrame::notifyPluginOfScrolling(RenderObject* renderer) |
|
299 { |
293 { |
300 MWebCoreObjectWidget* view = widget(renderer); |
|
301 //Don't repaint the plugin objects if Browser is in PageView mode |
294 //Don't repaint the plugin objects if Browser is in PageView mode |
302 if (view) { |
295 if (plg) { |
303 view->positionChanged(); |
296 plg->positionChanged(); |
304 TRect r = m_view->toDocCoords(static_cast<PluginSkin*>(view)->getPluginWinRect()); |
297 TRect r = m_view->toDocCoords(plg->getPluginWinRect()); |
305 m_view->topView()->scheduleRepaint(r); |
298 m_view->topView()->scheduleRepaint(r); |
306 } |
299 } |
307 } |
300 } |
308 |
301 |
309 PluginSkin* WebFrame::focusedPlugin() |
302 PluginSkin* WebFrame::focusedPlugin() |
512 } |
505 } |
513 return result; |
506 return result; |
514 } |
507 } |
515 |
508 |
516 void WebFrame::makeVisiblePlugins(TBool visible) |
509 void WebFrame::makeVisiblePlugins(TBool visible) |
517 { |
510 { |
518 MWebCoreObjectWidget* view = NULL; |
511 PluginHandler* plghandler = StaticObjectsContainer::instance()->pluginHandler(); |
519 int pluginCount = 0; |
512 WTF::HashSet<PluginSkin*> pluginObjs = plghandler->pluginObjects(); |
520 Frame* coreFrame = core(this); |
513 for(WTF::HashSet<PluginSkin*>::iterator it = pluginObjs.begin() ; it != pluginObjs.end() ; ++it ) { |
521 PluginSkin* ptr = 0; |
514 static_cast<PluginSkin*> (*it)->makeVisible(visible); |
522 for (Frame* frame = coreFrame; frame; frame = frame->tree()->traverseNext(coreFrame)) { |
|
523 |
|
524 PassRefPtr<HTMLCollection> objects = frame->document()->objects(); |
|
525 for (Node* n = objects->firstItem(); n; n = objects->nextItem()) { |
|
526 view = widget(n); |
|
527 if (view) { |
|
528 ptr = static_cast<PluginSkin*>(view); |
|
529 ptr->makeVisible(visible); |
|
530 } |
|
531 } |
|
532 PassRefPtr<HTMLCollection> embeds = frame->document()->embeds(); |
|
533 for (Node* n = embeds->firstItem(); n; n = embeds->nextItem()) { |
|
534 view = widget(n); |
|
535 if (view) { |
|
536 ptr = static_cast<PluginSkin*>(view); |
|
537 ptr->makeVisible(visible); |
|
538 } |
|
539 } |
|
540 } |
515 } |
541 } |
516 } |
542 |
517 |
543 |
518 |
544 inline int xInRect(const IntRect& r, int x) |
519 inline int xInRect(const IntRect& r, int x) |
598 for(WTF::HashSet<PluginSkin*>::iterator it = pluginObjs.begin() ; it != pluginObjs.end() ; ++it ) { |
573 for(WTF::HashSet<PluginSkin*>::iterator it = pluginObjs.begin() ; it != pluginObjs.end() ; ++it ) { |
599 static_cast<PluginSkin*> (*it)->PlayPauseNotify(pause); |
574 static_cast<PluginSkin*> (*it)->PlayPauseNotify(pause); |
600 } |
575 } |
601 } |
576 } |
602 |
577 |
|
578 void WebFrame::reCreatePlugins() |
|
579 { |
|
580 PluginHandler* plghandler = StaticObjectsContainer::instance()->pluginHandler(); |
|
581 WTF::HashSet<PluginSkin*> pluginObjs = plghandler->pluginObjects(); |
|
582 for(WTF::HashSet<PluginSkin*>::iterator it = pluginObjs.begin() ; it != pluginObjs.end() ; ++it ) { |
|
583 PluginSkin* plg = static_cast<PluginSkin*> (*it); //->PlayPauseNotify(pause); |
|
584 if(plg->activeStreams() > 0) |
|
585 plg->reCreatePlugin(); |
|
586 } |
|
587 } |
603 |
588 |
604 // END OF FILE |
589 // END OF FILE |