webengine/osswebengine/WebKit/s60/plugins/PluginSkin.cpp
branchRCL_3
changeset 37 ac77f89b1d9e
parent 36 c711bdda59f4
child 38 4917f9bf7995
--- a/webengine/osswebengine/WebKit/s60/plugins/PluginSkin.cpp	Wed Mar 31 23:16:40 2010 +0300
+++ b/webengine/osswebengine/WebKit/s60/plugins/PluginSkin.cpp	Wed Apr 14 17:06:56 2010 +0300
@@ -509,10 +509,37 @@
 // ----------------------------------------------------------------------------
 void PluginSkin::makeVisible( TBool visible )
     {
+    // if visible is true for a plugin, make sure that the plugin is actually visible in the window before proceeding 
+    TBool visibility = EFalse;
+    if (visible) {
+        TRect fullRect(getPluginWinRect());
+        TRect clipRect(getClipRect());
+        TRect frameRect(m_frame->frameView()->rect());
+        TRect viewRect = control(m_frame)->webView()->Rect();
+        TBool isPageViewMode = control(m_frame)->webView()->inPageViewMode();
+        WebFrame* pf = m_frame;
+        TPoint p = frameRect.iTl;
+
+        if (m_frame->parentFrame()) {
+            pf = m_frame->parentFrame();
+            p = pf->frameView()->frameCoordsInViewCoords(frameRect.iTl); 
+        }
+        TSize  sz = pf->frameView()->toViewCoords(frameRect.Size());
+        TRect frameRectInViewCoord = TRect(p, sz);
+        TBool isPluginVisible = frameRectInViewCoord.Intersects(fullRect); 
+        TBool isFrameVisible = m_frame->frameView()->isVisible() && 
+                                frameRectInViewCoord.Intersects(viewRect);
+        
+        visibility = isFrameVisible && !isPageViewMode && isPluginVisible;
+      
+    }
     if ( m_pluginwin )
         {
+        if (visible && !visibility)
+            visible = EFalse;
+        
         m_visible = visible;
-        if(m_active)
+        if(m_active && !visible)
             deActivate();
         m_pluginwin->makeVisible(visible);
         }
@@ -1242,3 +1269,9 @@
         pluginloader->start();                            
     }    
 }
+
+void PluginSkin::PlayPauseNotify(bool pause)
+{
+    if(m_pluginwin)
+        m_pluginwin->PlayPausePluginL(pause);
+}