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 |