Revision: 201023 RCL_3 PDK_3.0.1
authorDremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Mon, 21 Jun 2010 16:54:17 +0300
branchRCL_3
changeset 44 800203832575
parent 42 a1a5d4e727e8
child 46 30342f40acbf
Revision: 201023 Kit: 2010125
browserutilities/downloadmgr/DownloadMgrServEng/Src/HttpDownload.cpp
browserutilities/downloadmgr/DownloadMgrUiLib/Src/CUserInteractionsUtils.cpp
browserutilities/downloadmgr/DownloadMgrUiLib/Src/UserInteractionsEventHandler.cpp
browserutilities/recenturlstore/RecentUrlSrc/RecentUrlStore.cpp
browserutilities/webutils/conf/webutils.confml
web_plat/recent_url_store_api/inc/RecentUrlStore.h
web_pub/browser_plugin_api/inc/PluginAdapterInterface.h
web_pub/browser_plugin_api/inc/npapi.h
webengine/osswebengine/WebCore/html/HTMLParser.cpp
webengine/osswebengine/WebCore/platform/KURL.cpp
webengine/osswebengine/WebCore/platform/symbian/FontDataSymbian.cpp
webengine/osswebengine/WebCore/platform/symbian/bitmap/AnimationDecoderWrapped.h
webengine/osswebengine/WebKit/s60/plugins/NpnImplementation.cpp
webengine/osswebengine/WebKit/s60/plugins/PluginHandler.cpp
webengine/osswebengine/WebKit/s60/plugins/PluginHandler.h
webengine/osswebengine/WebKit/s60/plugins/PluginSkin.cpp
webengine/osswebengine/WebKit/s60/plugins/PluginSkin.h
webengine/osswebengine/WebKit/s60/plugins/PluginWin.cpp
webengine/osswebengine/WebKit/s60/plugins/PluginWin.h
webengine/osswebengine/WebKit/s60/webview/BrCtl.cpp
webengine/osswebengine/WebKit/s60/webview/WebFepTextEditor.cpp
webengine/osswebengine/WebKit/s60/webview/WebFrame.cpp
webengine/osswebengine/WebKit/s60/webview/WebFrame.h
webengine/osswebengine/WebKit/s60/webview/WebFrameView.cpp
webengine/osswebengine/WebKit/s60/webview/WebPageScrollHandler.cpp
webengine/osswebengine/WebKit/s60/webview/WebPageScrollHandler.h
webengine/osswebengine/WebKit/s60/webview/WebPointerEventHandler.cpp
webengine/osswebengine/WebKit/s60/webview/WebScrollingDeceleratorGH.cpp
webengine/osswebengine/WebKit/s60/webview/WebScrollingDeceleratorGH.h
webengine/osswebengine/WebKit/s60/webview/WebView.cpp
webengine/osswebengine/WebKit/s60/webview/WebView.h
webengine/osswebengine/webkit/s60/webview/WebPagePinchZoomHandler.cpp
webengine/osswebengine/webkit/s60/webview/WebPagePinchZoomHandler.h
webengine/webkitutils/HistoryProvider/HistoryView.cpp
webengine/webkitutils/HistoryProvider/HistoryView.h
webengine/widgetengine/inc/Preferences.h
webengine/widgetengine/src/Preferences.cpp
webengine/wmlengine/src/ImageCH/src/Epoc32ImageContentHandler.cpp
widgets/widgetapp/inc/WidgetUiWindow.h
widgets/widgetapp/inc/WidgetUiWindowManager.h
widgets/widgetapp/src/WidgetUiWindow.cpp
widgets/widgetapp/src/WidgetUiWindowManager.cpp
--- a/browserutilities/downloadmgr/DownloadMgrServEng/Src/HttpDownload.cpp	Wed Jun 09 10:52:50 2010 +0300
+++ b/browserutilities/downloadmgr/DownloadMgrServEng/Src/HttpDownload.cpp	Mon Jun 21 16:54:17 2010 +0300
@@ -3818,41 +3818,51 @@
 			//but we again send the progress state as EHttpProgContentFileMoved because we need to display
 			//where file is saved(saved to gallery)
 			//Change Dl State to Download Completed if not already           
-
-		    if(_OMADLOTA2_MULTI_DOWNLOAD)
-				{
-				TPtrC fileNamePtr = ((*iCodDlData)[iMOMoved])->DestFilename();
-				NotifyMediaGalleryL(fileNamePtr);
-
-				// Initiate async move for the next media object
-				iMOMoved++;
-				if(iMOMoved <= iCodDlData->Count())
-					{
-					MoveDownloadedMediaObjectL(iMOMoved);
-					break;
-					}
-				}
-
-            SetDownloadStatus( iDlNameChanged ? EHttpProgContentFileMovedAndDestFNChanged : EHttpProgContentFileMoved, 
+          
+            if( iStatus ==KErrNone )
+                {
+		          if(_OMADLOTA2_MULTI_DOWNLOAD)
+				     {
+				      TPtrC fileNamePtr = ((*iCodDlData)[iMOMoved])->DestFilename();
+				      NotifyMediaGalleryL(fileNamePtr);
+
+             	      // Initiate async move for the next media object
+				      iMOMoved++;
+				      if(iMOMoved <= iCodDlData->Count())
+					     {
+					      MoveDownloadedMediaObjectL(iMOMoved);
+					      break;
+					     }
+				      }
+
+                  SetDownloadStatus( iDlNameChanged ? EHttpProgContentFileMovedAndDestFNChanged : EHttpProgContentFileMoved, 
                                iDlState = EHttpDlMultipleMOCompleted, 
                                iStatus == KErrNone ? ENoError : EMoveFailed,
                                iStatus.Int() );
             
-            if(iStatus == KErrNone)
-            	{
-            	iMoveInProgress = EFalse;	
-            	CLOG_WRITE("setting iMoveInProgress false when move is completed");
-            	}
+                  if(iStatus == KErrNone)
+            	      {
+            	       iMoveInProgress = EFalse;	
+            	       CLOG_WRITE("setting iMoveInProgress false when move is completed");
+            	      }
             
+                  delete iFileMan; iFileMan = NULL;
             
-            delete iFileMan; iFileMan = NULL;
-            
-			if( !_OMADLOTA2_MULTI_DOWNLOAD)
-				{
-				TPtr fileNamePtr(iStorage->DestFilename()->Des());
-				NotifyMediaGalleryL(fileNamePtr);
-				}
-            }
+                  if( !_OMADLOTA2_MULTI_DOWNLOAD)
+				     {
+				      TPtr fileNamePtr(iStorage->DestFilename()->Des());
+				      NotifyMediaGalleryL(fileNamePtr);
+				     }
+                }
+            else
+                {
+                CLOG_WRITE("Move Operation Failed ");
+                CLOG_WRITE("setting progress state to EHttpProgNone when move is Failing");
+                SetDownloadStatus( EHttpProgNone, iDlState );
+                CLOG_WRITE("setting iMoveInProgress false when move is Failing");
+                iMoveInProgress = EFalse;
+                }
+            } 
             break;
 
         default:
--- a/browserutilities/downloadmgr/DownloadMgrUiLib/Src/CUserInteractionsUtils.cpp	Wed Jun 09 10:52:50 2010 +0300
+++ b/browserutilities/downloadmgr/DownloadMgrUiLib/Src/CUserInteractionsUtils.cpp	Mon Jun 21 16:54:17 2010 +0300
@@ -1673,22 +1673,6 @@
     
     if ( pdSupported )
         {
-        
-        TInt downloadCnt = iRegistryModel.DownloadCount();
-        TBool isProg(EFalse);
-        
-        const CDownloadArray& downloads = iRegistryModel.DownloadMgr().CurrentDownloads();
-        
-        for ( TInt i = 0; i < downloadCnt ;i++ )
-			{
-        	RHttpDownload* dl = downloads.At(i); //current download
-        	dl->GetBoolAttribute( EDlAttrProgressive, isProg );
-        	if (isProg ) 
-				{
-                dl->SetBoolAttribute( EDlAttrProgressive, EFalse );
-                }
-			}
-      
         TInt32 numMediaObjects = 0;
         User::LeaveIfError( aDownload.GetIntAttribute( EDlAttrNumMediaObjects, numMediaObjects ) );
         
--- a/browserutilities/downloadmgr/DownloadMgrUiLib/Src/UserInteractionsEventHandler.cpp	Wed Jun 09 10:52:50 2010 +0300
+++ b/browserutilities/downloadmgr/DownloadMgrUiLib/Src/UserInteractionsEventHandler.cpp	Mon Jun 21 16:54:17 2010 +0300
@@ -1102,11 +1102,17 @@
                     }
 
 
-                // update EDlAttrDestFilename with new path
-                User::LeaveIfError
-		                ( iDownload.SetStringAttribute( EDlAttrDestFilename, *fileName ) );
-                // move file
-                User::LeaveIfError( iDownload.Move() );
+                TBool isProg(EFalse);
+                User::LeaveIfError( iDownload.GetBoolAttribute( EDlAttrProgressive, isProg ) );
+
+                // Move operation should be invoked by DL Manger if its not a progressive download. 
+                if( !isProg )
+                    {
+                    // update EDlAttrDestFilename with new path
+                    User::LeaveIfError
+                            ( iDownload.SetStringAttribute( EDlAttrDestFilename, *fileName ) );
+                    User::LeaveIfError( iDownload.Move() );
+                    }
           	    CleanupStack::PopAndDestroy( fileName ); // fileName
                 }
             }
--- a/browserutilities/recenturlstore/RecentUrlSrc/RecentUrlStore.cpp	Wed Jun 09 10:52:50 2010 +0300
+++ b/browserutilities/recenturlstore/RecentUrlSrc/RecentUrlStore.cpp	Mon Jun 21 16:54:17 2010 +0300
@@ -244,8 +244,21 @@
 				
 			HBufC* domain = aUrl.Mid(domainStart,domainLength).AllocLC();
 			domain->Des().LowerCase();
-			HBufC* title = aTitle.Left(titleLength).AllocLC();
-	
+			
+			HBufC* title;
+			TInt pos = aTitle.Find(_L("'"));
+			if(pos >= 0)
+                {
+                TBuf<KTitleSize> buf;
+                TChar ch = '\'';
+                TInt nwLen = InsertEscapeSequence(ch,(TUint16*)buf.Ptr(),aTitle);
+                title = HBufC::NewLC(nwLen);
+                TPtr myPtr = title->Des();
+                myPtr.Copy(buf.Ptr(),nwLen);
+                }
+			else
+			    title = aTitle.Left(titleLength).AllocLC();
+			
 			// delete and re-insert
 			iSQLStatement.Format(KSQLDelete, &aUrl);
 			dataBase.Execute(iSQLStatement);
@@ -256,7 +269,35 @@
 			}
 		}
 	}
-	
+
+//-----------------------------------------------------------------------------
+// CRecentUrlStore::InsertEscapeSequence
+// Insert the EscapeSequence.
+//-----------------------------------------------------------------------------
+TInt CRecentUrlStore::InsertEscapeSequence(TChar aChar,TUint16* aDestPtr,const TDesC& aString)
+    {
+    TUint16* src_ptr = (TUint16*)aString.Ptr();
+    
+    TInt src_iter = 0;
+    TInt dest_iter = 0;
+    TInt len = aString.Length();
+    
+    while((src_iter <= len) && (dest_iter <= KTitleSize))
+        {
+        *aDestPtr++ = *src_ptr++;
+        src_iter++;
+        dest_iter++;
+        if(*(src_ptr-1)==aChar && dest_iter<=KTitleSize)
+            {
+            *aDestPtr++ = aChar;
+            dest_iter++;
+            }
+        }
+    --src_iter;
+    return (--dest_iter);
+    
+    }
+
 //-----------------------------------------------------------------------------
 // CRecentUrlStore::ClearData
 // Clear the store.
Binary file browserutilities/webutils/conf/webutils.confml has changed
--- a/web_plat/recent_url_store_api/inc/RecentUrlStore.h	Wed Jun 09 10:52:50 2010 +0300
+++ b/web_plat/recent_url_store_api/inc/RecentUrlStore.h	Mon Jun 21 16:54:17 2010 +0300
@@ -122,6 +122,11 @@
 	    */
 	    void CreateDatabaseL();
 	    
+	    /**
+      *  Insert the Escape Sequence
+      */
+      TInt InsertEscapeSequence(TChar aChar,TUint16* aDestPtr,const TDesC& aString);
+	    
     /*  Private Members  */
 
     private :
--- a/web_pub/browser_plugin_api/inc/PluginAdapterInterface.h	Wed Jun 09 10:52:50 2010 +0300
+++ b/web_pub/browser_plugin_api/inc/PluginAdapterInterface.h	Mon Jun 21 16:54:17 2010 +0300
@@ -124,7 +124,9 @@
        EPluginActivated,
        EPluginDeactivated,
        EMenuOptionEnableDecider,
-       EPluginPause
+       EPluginPause, 
+       ECollectBitmap,
+       ECollectBitmapSupported
     };
 
 
--- a/web_pub/browser_plugin_api/inc/npapi.h	Wed Jun 09 10:52:50 2010 +0300
+++ b/web_pub/browser_plugin_api/inc/npapi.h	Mon Jun 21 16:54:17 2010 +0300
@@ -366,6 +366,7 @@
     NPPVPluginDeactivate = 101,
     NPPVPluginZoom = 102,
     NPPVPluginPointerEvent = 103,
+    NPPVPluginBitmap = 104, 
     NPPVpluginInteractiveBool = 1000,
 #endif
 
--- a/webengine/osswebengine/WebCore/html/HTMLParser.cpp	Wed Jun 09 10:52:50 2010 +0300
+++ b/webengine/osswebengine/WebCore/html/HTMLParser.cpp	Mon Jun 21 16:54:17 2010 +0300
@@ -815,6 +815,7 @@
         gFunctionMap.set(buttonTag.localName().impl(), &HTMLParser::nestedCreateErrorCheck);
         gFunctionMap.set(commentAtom.impl(), &HTMLParser::commentCreateErrorCheck);
         gFunctionMap.set(ddTag.localName().impl(), &HTMLParser::ddCreateErrorCheck);
+        gFunctionMap.set(divTag.localName().impl(), &HTMLParser::nestedStyleCreateErrorCheck);
         gFunctionMap.set(dtTag.localName().impl(), &HTMLParser::dtCreateErrorCheck);
         gFunctionMap.set(formTag.localName().impl(), &HTMLParser::formCreateErrorCheck);
         gFunctionMap.set(framesetTag.localName().impl(), &HTMLParser::framesetCreateErrorCheck);
@@ -828,6 +829,7 @@
         gFunctionMap.set(noembedTag.localName().impl(), &HTMLParser::noembedCreateErrorCheck);
         gFunctionMap.set(noframesTag.localName().impl(), &HTMLParser::noframesCreateErrorCheck);
         gFunctionMap.set(noscriptTag.localName().impl(), &HTMLParser::noscriptCreateErrorCheck);
+        gFunctionMap.set(qTag.localName().impl(), &HTMLParser::nestedStyleCreateErrorCheck);
         gFunctionMap.set(sTag.localName().impl(), &HTMLParser::nestedStyleCreateErrorCheck);
         gFunctionMap.set(selectTag.localName().impl(), &HTMLParser::selectCreateErrorCheck);
         gFunctionMap.set(smallTag.localName().impl(), &HTMLParser::nestedStyleCreateErrorCheck);
--- a/webengine/osswebengine/WebCore/platform/KURL.cpp	Wed Jun 09 10:52:50 2010 +0300
+++ b/webengine/osswebengine/WebCore/platform/KURL.cpp	Mon Jun 21 16:54:17 2010 +0300
@@ -234,7 +234,11 @@
     if (url && url[0] == '/') {
          // 5 for "file:", 1 for terminator
         size_t urlLength = strlen(url) + 1;
+#if PLATFORM(SYMBIAN)
+        Vector<char, 256> buffer(urlLength + 5);
+#else        
         Vector<char, 2048> buffer(urlLength + 5);
+#endif        
         buffer[0] = 'f';
         buffer[1] = 'i';
         buffer[2] = 'l';
@@ -250,7 +254,11 @@
 {
     if (!url.isEmpty() && url[0] == '/') {
         // 5 for "file:", 1 for terminator
+#if PLATFORM(SYMBIAN)
+        Vector<char, 256> buffer(url.length() + 6);
+#else
         Vector<char, 2048> buffer(url.length() + 6);
+#endif        
         buffer[0] = 'f';
         buffer[1] = 'i';
         buffer[2] = 'l';
@@ -403,7 +411,11 @@
                 // must be relative-path reference
 
                 // Base part plus relative part plus one possible slash added in between plus terminating \0 byte.
+#if PLATFORM(SYMBIAN)
+                Vector<char, 256> buffer(base.pathEndPos + 1 + strlen(str) + 1);
+#else
                 Vector<char, 2048> buffer(base.pathEndPos + 1 + strlen(str) + 1);
+#endif                
 
                 char *bufferPos = buffer.data();
                 
@@ -764,7 +776,11 @@
 {
     DeprecatedString result("");
 
+#if PLATFORM(SYMBIAN)
+    Vector<char, 256> buffer(0);
+#else
     Vector<char, 2048> buffer(0);
+#endif    
 
     int length = urlString.length();
     int decodedPosition = 0;
@@ -1104,7 +1120,11 @@
 
     // assemble it all, remembering the real ranges
 
+#if PLATFORM(SYMBIAN)
+    Vector<char, 256> buffer(fragmentEnd * 3 + 1);
+#else    
     Vector<char, 4096> buffer(fragmentEnd * 3 + 1);
+#endif    
 
     char *p = buffer.data();
     const char *strPtr = url;
@@ -1223,7 +1243,11 @@
     // add path, escaping bad characters
     
     if (hierarchical && hasSlashDotOrDotDot(url)) {
+#if PLATFORM(SYMBIAN)
+        Vector<char, 256> path_buffer(pathEnd - pathStart + 1);
+#else        
         Vector<char, 4096> path_buffer(pathEnd - pathStart + 1);
+#endif        
         copyPathRemovingDots(path_buffer.data(), url, pathStart, pathEnd);
         appendEscapingBadChars(p, path_buffer.data(), strlen(path_buffer.data()));
     } else
@@ -1268,7 +1292,11 @@
 {
     DeprecatedCString asUTF8 = notEncodedString.utf8();
     
+#if PLATFORM(SYMBIAN)
+    Vector<char, 256> buffer(asUTF8.length() * 3 + 1);
+#else    
     Vector<char, 4096> buffer(asUTF8.length() * 3 + 1);
+#endif    
     char *p = buffer.data();
 
     const char *str = asUTF8;
--- a/webengine/osswebengine/WebCore/platform/symbian/FontDataSymbian.cpp	Wed Jun 09 10:52:50 2010 +0300
+++ b/webengine/osswebengine/WebCore/platform/symbian/FontDataSymbian.cpp	Mon Jun 21 16:54:17 2010 +0300
@@ -27,6 +27,7 @@
 #include <e32base.h>
 #include <e32std.h>
 #include <fbs.h>
+#include <e32const.h>
 
 // CONSTATNS
 _LIT(KX,"x");
@@ -40,8 +41,14 @@
 void FontData::platformInit()
 {
     const CFont& font( m_font );
-    m_ascent = font.AscentInPixels() + 2;
-    m_descent = font.DescentInPixels() - 2;
+    TLanguage language = User::Language();
+    if (language == ELangPrcChinese ) {
+        m_ascent = font.AscentInPixels();
+        m_descent = font.DescentInPixels();
+    } else {
+        m_ascent = font.AscentInPixels() + 2;
+        m_descent = font.DescentInPixels() - 2;
+    }
     m_lineGap = font.FontLineGap();
     m_lineSpacing = m_ascent + m_descent + 1;
 
--- a/webengine/osswebengine/WebCore/platform/symbian/bitmap/AnimationDecoderWrapped.h	Wed Jun 09 10:52:50 2010 +0300
+++ b/webengine/osswebengine/WebCore/platform/symbian/bitmap/AnimationDecoderWrapped.h	Mon Jun 21 16:54:17 2010 +0300
@@ -48,6 +48,7 @@
 
 // INCLUDES
 
+#include <browser_platform_variant.hrh>
 #include <../bidi.h>
 #include "config.h"
 #include <e32base.h>
@@ -80,7 +81,6 @@
 
 // FIXME: we should move this back to EColor64K after Symbian fix their Gif image decoder bug.
 const TDisplayMode KMaxDepth = EColor16M;
-
 // CLASS DECLARATION
 /**
 *  CAnimationDecoderWrapped
--- a/webengine/osswebengine/WebKit/s60/plugins/NpnImplementation.cpp	Wed Jun 09 10:52:50 2010 +0300
+++ b/webengine/osswebengine/WebKit/s60/plugins/NpnImplementation.cpp	Mon Jun 21 16:54:17 2010 +0300
@@ -477,6 +477,20 @@
             }
             break;
             }
+        case NPPVPluginBitmap :
+            PluginWin* pluginWin = (PluginWin*)aInstance->ndata;
+            if (pluginWin) {
+                TInt* bitMapHandle = (TInt*)aSetValue;
+                if (*bitMapHandle) {
+                    TInt handle = *bitMapHandle; 
+                    pluginWin->SetBitmapFromPlugin(handle);
+                }
+                else 
+                    { 
+                    pluginWin->SetBitmapFromPlugin(KErrNone);
+                    }
+            }
+            break; 
         case NPPVPluginDeactivate:
             {
             PluginWin* pluginWin = (PluginWin*)aInstance->ndata;
--- a/webengine/osswebengine/WebKit/s60/plugins/PluginHandler.cpp	Wed Jun 09 10:52:50 2010 +0300
+++ b/webengine/osswebengine/WebKit/s60/plugins/PluginHandler.cpp	Mon Jun 21 16:54:17 2010 +0300
@@ -415,6 +415,7 @@
 {
     m_idle = CIdle::NewL(CActive::EPriorityLow);
     m_idle->Start(TCallBack(initialize, this));
+    m_visiblePlugins.Reset();
 }
 
 
@@ -441,6 +442,8 @@
 //
 PluginHandler::~PluginHandler()
 {
+    m_visiblePlugins.Reset();
+    m_visiblePlugins.Close();
     m_pluginInfoArray.ResetAndDestroy();
     m_pluginInfoArray.Close();
     m_pluginObjects.clear();
--- a/webengine/osswebengine/WebKit/s60/plugins/PluginHandler.h	Wed Jun 09 10:52:50 2010 +0300
+++ b/webengine/osswebengine/WebKit/s60/plugins/PluginHandler.h	Mon Jun 21 16:54:17 2010 +0300
@@ -146,6 +146,7 @@
         void setActivePlugin(PluginSkin* pluginObj) { m_activePlugin = pluginObj; };
         HBufC* pluginMimeByExtention(const TPtrC8& url);
         PluginInfo* pluginInfoByExtention(const TPtrC8& aUrl, TInt* aExtIdx);
+        RPointerArray<PluginSkin>& getVisiblePlugins() { return m_visiblePlugins; }
 
     private: // New functions
 
@@ -202,6 +203,7 @@
                                                         //the plugins from drives
         PluginSkin*                 m_pluginToActivate;
         PluginSkin*                 m_activePlugin;
+        RPointerArray<PluginSkin>   m_visiblePlugins;    // Array to hold visible plugins 
     };
 
 
--- a/webengine/osswebengine/WebKit/s60/plugins/PluginSkin.cpp	Wed Jun 09 10:52:50 2010 +0300
+++ b/webengine/osswebengine/WebKit/s60/plugins/PluginSkin.cpp	Mon Jun 21 16:54:17 2010 +0300
@@ -168,7 +168,8 @@
       m_resized(false),
       m_oldRect(TRect(0,0,0,0)),
       m_oldViewport(TRect(0,0,0,0)),
-      m_loadmode(ELoadModeNone)
+      m_loadmode(ELoadModeNone),
+      m_NPObject(0)
   {
   }
 
@@ -412,6 +413,7 @@
     m_pluginfuncs = 0;
     m_pluginSupported = EFalse;
     m_pluginClosed = true;
+    
  }
 
 
@@ -483,9 +485,35 @@
         }
     if(m_pluginwin)
         {
-        positionChanged();
-        // Force the control to be redrawn.
-        m_pluginwin->refreshPlugin(*gc,newRect);
+        //if bitmap is shared from plugins then draw the shared bitmap
+        if(m_pluginwin->IsPluginBitMapSet())
+            {
+            CFbsBitmap* bitmap = m_pluginwin->PluginBitmap();
+            if(bitmap)
+                {
+                TRect clippingRect = context.clippingRect();
+                TRect oldcontextrect = context.clippingRect();
+
+                if(newRect != clippingRect)
+                    {
+                    context.setClippingRect(newRect);
+                    }
+                 gc->DrawBitmap(newRect, bitmap);
+                 context.setClippingRect(oldcontextrect);
+                }
+            else
+                {
+                //if not a valid bitmap, then hide that plugin
+                m_pluginwin->MakeVisible(EFalse);
+                }
+                positionChanged();
+            }
+        else
+            {
+            positionChanged();
+            // Force the control to be redrawn, for window less plugins
+            m_pluginwin->refreshPlugin(*gc,newRect);
+            }
         }
     }
 
@@ -1019,15 +1047,13 @@
 
 void* PluginSkin::pluginScriptableObject()
 {
-    //
-    if (m_pluginfuncs && m_pluginfuncs->getvalue) {
-        void *value = 0;
-        NPError npErr = m_pluginfuncs->getvalue( m_instance, NPPVpluginScriptableNPObject, (void *)&value);
-        if (npErr == NPERR_NO_ERROR) {
-            return value;
+    if (!m_NPObject && m_pluginfuncs && m_pluginfuncs->getvalue) {
+        NPError npErr = m_pluginfuncs->getvalue( m_instance, NPPVpluginScriptableNPObject, &m_NPObject);
+        if (npErr != NPERR_NO_ERROR) {
+            m_NPObject = 0;
         }
     }
-    return (void *)0;
+    return m_NPObject;
 }
 
 TBool validateDataScheme(const TPtrC8& url)
@@ -1265,10 +1291,8 @@
         {
           rfs.Delete(m_tempFilesArray[i]->Des());
         }
-    
     m_tempFilesArray.ResetAndDestroy();
-    
-    
+       
     //create/load the destroyed plugin again
     
     NetscapePlugInStreamLoaderClient* pluginloader = NetscapePlugInStreamLoaderClient::NewL(m_url->Des(), this, core(m_frame));
@@ -1277,8 +1301,106 @@
     }    
 }
 
-void PluginSkin::PlayPauseNotify(bool pause)
-{
+// -----------------------------------------------------------------------------
+// PluginWin::NotifyPluginsForScrollOrPinch
+// When ever there is Scroll or Pinch zoom is in progress, the webframe will
+// Notify all the plugins "ETrue" for Start and "EFalse" for end
+// -----------------------------------------------------------------------------
+void PluginSkin::NotifyPluginsForScrollOrPinch(bool status)
+    {
     if(m_pluginwin)
-        m_pluginwin->PlayPausePluginL(pause);
+       {
+        //while pinch zoom, deactivate and activate the plugins.
+    WebView* view = control(frame())->webView();
+    if(!view)
+        return;
+
+       //check weather the collect bitmap is supported or not
+        TBool bitmapSupported  = m_pluginwin->IsCollectBitmapSupported();
+
+        //if bitmap is not supported, check for pinch zoom and deactivate the plugins.
+        if((view->isPinchZoom()))
+            {
+            //if bitmap sharing is not supported then deactivate or activate the plugins
+            if(!bitmapSupported)
+                {
+                if(status)
+                    {
+                    if(m_pluginwin->IsVisible())
+                        {
+                        m_pluginwin->MakeVisible(false);
+                        m_pluginwin->setPluginFocusL(false);
+                        }
+                    }
+                else
+                    {
+                    activate();
+                    }
+                }
+
+            }
+
+        if(bitmapSupported)
+           {
+            m_pluginwin->GetBitmapFromPlugin(status);
+            if(!status)
+                {
+                m_pluginwin->ClearPluginBitmap();
+                activateVisiblePlugins();
+                }
+          }
+       }
 }
+
+// -----------------------------------------------------------------------------
+// PluginWin::IsCollectBitmapSupported
+// Check Plugin are supported for Bitmap Sharing
+// -----------------------------------------------------------------------------
+TBool PluginSkin::IsCollectBitmapSupported()
+    {
+    if(m_pluginwin)
+        {
+        return  m_pluginwin->IsCollectBitmapSupported();
+        }
+    return false;
+    }
+
+void PluginSkin::activateVisiblePlugins()
+    {
+    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);
+
+    TBool visibility = isFrameVisible && !isPageViewMode && isPluginVisible;
+    if(fullRect.Size() != TSize(0,0))
+        {
+        if (visibility)
+            {
+            m_pluginwin->MakeVisible(true); //forcefully make the plugin visible, this is for pinch exit
+            m_pluginwin->makeVisible(true);
+            }
+        else
+            {
+            //this is required for flash plugin to clear the EGL surface
+            //when the plugin window is outside the view port
+            m_pluginwin->makeVisible(false);
+            }
+        }
+
+    }
--- a/webengine/osswebengine/WebKit/s60/plugins/PluginSkin.h	Wed Jun 09 10:52:50 2010 +0300
+++ b/webengine/osswebengine/WebKit/s60/plugins/PluginSkin.h	Mon Jun 21 16:54:17 2010 +0300
@@ -32,6 +32,7 @@
 #include "WebFrameView.h"
 #include "WebView.h"
 #include <MemoryManager.h>
+#include <npruntime.h>
 //#include <Element.h>
 
 // FORWARD DECLARATIONS
@@ -416,9 +417,9 @@
         void setElement(WebCore::Element* aElement) {m_element = aElement;}
         void reCreatePlugin();
         TInt activeStreams() { return m_streams.size(); }
-        void PlayPauseNotify(bool pause);
         TPluginLoadMode getLoadMode(){return m_loadmode;}
         void setLoadMode(TPluginLoadMode mode){m_loadmode = mode;}
+        void NotifyPluginsForScrollOrPinch(bool status);
   public:  // from MMemoryCollector
         TUint Collect(unsigned int aRequired);
         void Restore()                          {}
@@ -436,6 +437,8 @@
             return iGenericElementArray;
         }
         void setPluginWinClipedRect();
+        TBool IsCollectBitmapSupported();
+        WebFrame* getWebFrame() const {return m_frame;}
   private:  // private member data
         
         TRect frameVisibleRect() const;
@@ -444,6 +447,7 @@
         const TDesC& GetExecutionMode();
         void setupGenericElementArrrayL();
         void addWidgetAttributesL();
+        void activateVisiblePlugins();
         // Window-owning CoeControl which wraps the CoeControl created by the plugin
         PluginWin* m_pluginwin;
         WebFrame* m_frame; // not owned
@@ -480,6 +484,7 @@
         TRect   m_oldRect;
         TRect    m_oldViewport;
         TPluginLoadMode m_loadmode;
+        NPObject* m_NPObject;
         
 public:
         TInt m_handle;
--- a/webengine/osswebengine/WebKit/s60/plugins/PluginWin.cpp	Wed Jun 09 10:52:50 2010 +0300
+++ b/webengine/osswebengine/WebKit/s60/plugins/PluginWin.cpp	Mon Jun 21 16:54:17 2010 +0300
@@ -44,6 +44,7 @@
 #include "WebPointerEventHandler.h"
 #include "WebPageScrollHandler.h"
 #include "WebKitLogger.h"
+#include "WebCoreGraphicsContext.h"
 
 #include <rt_gestureif.h>
 
@@ -89,6 +90,9 @@
     }
     // Add the focus/foreground observer
     ControlEnv()->AddForegroundObserverL( *this ) ;
+    m_pluginHasBitmap = false;
+    m_pausedBitmap = NULL;
+    m_BitmapSupported = false;
 }
 
 // -----------------------------------------------------------------------------
@@ -98,21 +102,21 @@
 //
 PluginWin::~PluginWin()
 {
-    CBrCtl* brCtl = control(m_pluginskin->frame());
-    if (brCtl) {
-        WebView*  view = brCtl->webView();
-        if (view) {
-            int index = view->getVisiblePlugins().Find(m_pluginskin);
-            if (index != KErrNotFound)
-                view->getVisiblePlugins().Remove(index);
-        }
-    }
+    PluginHandler* pluginHandler = WebCore::StaticObjectsContainer::instance()->pluginHandler();
+
+    int index = pluginHandler->getVisiblePlugins().Find(m_pluginskin);
+    if (index != KErrNotFound)
+        pluginHandler->getVisiblePlugins().Remove(index);
 
     TRAP_IGNORE( setPluginFocusL( EFalse ) );
 
     // Remove the foreground observer
     ControlEnv()->RemoveForegroundObserver( *this );
     delete m_bitmap;
+   if (m_pausedBitmap)
+        {
+        delete m_pausedBitmap;
+        }
 }
 
 // -----------------------------------------------------------------------------
@@ -161,6 +165,7 @@
 void PluginWin::windowChangedL()
 {
     if (m_fullscreen) return;
+    PlayPausePluginL();
     if (m_pluginskin->getNPPluginFucs() && m_pluginskin->getNPPluginFucs()->setwindow ){
         NPWindow  window;
     TRect rect( m_pluginskin->getPluginWinRect() );
@@ -381,7 +386,11 @@
 //
 void PluginWin::makeVisible( TBool visible )
     {
-    if(IsVisible() != visible) 
+    WebView* view = control(m_pluginskin->frame())->webView();
+    if(!view)
+        return;
+    
+    if((!m_pluginHasBitmap) && (IsVisible() != visible) && (!view->isPinchZoom()))
     {
         CCoeControl::MakeVisible(visible);
     }
@@ -394,14 +403,14 @@
             HandleLosingForeground();
     }
     
-    WebView* view = control(m_pluginskin->frame())->webView();
-    int index = view->getVisiblePlugins().Find(m_pluginskin);
+    PluginHandler* pluginHandler = WebCore::StaticObjectsContainer::instance()->pluginHandler();
+    int index = pluginHandler->getVisiblePlugins().Find(m_pluginskin);
     if (visible && (m_visibilty != visible) && (index == KErrNotFound)) {
-        view->getVisiblePlugins().AppendL(m_pluginskin);
+        pluginHandler->getVisiblePlugins().AppendL(m_pluginskin);
         m_visibilty = visible;
     }
     else if (!visible && (index != KErrNotFound)) {
-        view->getVisiblePlugins().Remove(index);
+        pluginHandler->getVisiblePlugins().Remove(index);
         m_visibilty = visible;
     }
     
@@ -728,18 +737,51 @@
       }	
     }
 }
-void PluginWin::PlayPausePluginL (bool pause)
+void PluginWin::PlayPausePluginL ()
 {
-    if(m_notifier) {        
-      if (pause) {
-          m_notifier->NotifyL( MPluginNotifier::EPluginPause, (void*)1 );
-      }
-      else {
-          m_notifier->NotifyL( MPluginNotifier::EPluginPause, (void*)0 );
-      }
+    if(m_notifier) 
+    {
+        CBrCtl*   brCtl = control(m_pluginskin->frame());    
+        WebView*  view = brCtl->webView();
+        TBool scrolling = view->viewIsScrolling();
+        if (scrolling) {
+            m_notifier->NotifyL( MPluginNotifier::EPluginPause, (void*)1 );
+        }
+        else {
+            m_notifier->NotifyL( MPluginNotifier::EPluginPause, (void*)0 );
+        }
     }
 }
 
+TBool PluginWin::IsCollectBitmapSupported ()
+{
+    if(m_notifier) {
+        m_BitmapSupported = m_notifier->NotifyL( MPluginNotifier::ECollectBitmapSupported, (void*)0 ) ;
+    }
+    return m_BitmapSupported;
+}
+
+
+void PluginWin::GetBitmapFromPlugin (bool status)
+    {
+    if(m_notifier) {
+         if (status) {
+             m_notifier->NotifyL( MPluginNotifier::ECollectBitmap, (void*)1 );
+         }
+         else {
+             m_notifier->NotifyL( MPluginNotifier::ECollectBitmap, (void*)0 );
+             
+             m_pluginHasBitmap = 0;
+             if(m_pausedBitmap)
+                 {
+                 delete m_pausedBitmap;
+                 m_pausedBitmap = NULL;
+                 }
+         }
+       }
+}
+
+
 void PluginWin::HandlePointerEventFromPluginL(const TPointerEvent& aEvent)
 {
     CBrCtl*   brCtl = control(m_pluginskin->frame());    
@@ -872,3 +914,77 @@
     else 
         return false;   
 }
+// -----------------------------------------------------------------------------
+// PluginWin::SetBitmapFromPlugin
+// Plugin video is captured in CFBsBitmap and handle is passed to plugin window 
+// Duplicate the bitmap handle and use it to draw while Panning or Pinch zoom
+// -----------------------------------------------------------------------------
+void PluginWin::SetBitmapFromPlugin(TInt aHandle)
+    {
+
+//    m_pluginfocus = 1;
+
+    if (aHandle)
+        {
+        if (m_pausedBitmap)
+            {
+            delete m_pausedBitmap;
+            m_pausedBitmap = NULL;
+            }
+        m_pausedBitmap = new (ELeave) CFbsBitmap();
+        TInt dupStatus = m_pausedBitmap->Duplicate(aHandle);
+        if(dupStatus == KErrNone)
+            { 
+            m_pluginHasBitmap = true;
+            
+            
+            if (IsVisible())
+                   {
+                   MakeVisible(false);
+                   }
+            //setPluginFocusL(false);
+            drawBitmapToWebCoreContext();
+            } 
+       }
+    else
+        {
+        if(m_pausedBitmap)
+        {
+            delete m_pausedBitmap;
+        	m_pausedBitmap = NULL;
+		}
+        m_pluginHasBitmap = false;
+        }
+    }
+
+void PluginWin::ClearPluginBitmap()
+    {
+    if(m_pausedBitmap)
+        {
+        delete m_pausedBitmap;
+        m_pausedBitmap = NULL;
+        m_pluginHasBitmap = false; //clearing plugin bitmap
+        }
+    }
+
+void PluginWin::drawBitmapToWebCoreContext()
+    { 
+    CBrCtl* brCtl = control(m_pluginskin->frame());
+    WebView* view = brCtl->webView();
+    WebCoreGraphicsContext* context = view->getGraphicsContext();
+    CFbsBitGc& gc = context->gc();
+    TRect plWinRect(m_pluginskin->getPluginWinRect());
+
+    TRect oldcontextrect = context->clippingRect();
+    TRect clippingRect = context->clippingRect();
+
+    // save the gc state
+    TWebCoreSavedContext saved(context->save());
+    
+    if(plWinRect != clippingRect)
+        {
+        context->setClippingRect(plWinRect);
+        }
+    gc.DrawBitmap(plWinRect, m_pausedBitmap);
+    context->restore(saved);
+    }
--- a/webengine/osswebengine/WebKit/s60/plugins/PluginWin.h	Wed Jun 09 10:52:50 2010 +0300
+++ b/webengine/osswebengine/WebKit/s60/plugins/PluginWin.h	Mon Jun 21 16:54:17 2010 +0300
@@ -477,11 +477,19 @@
     
     
     void ToggleScreenMode(bool aFullScreen);
-    void PlayPausePluginL (bool pause);
+    void PlayPausePluginL ();
     void HandlePointerEventFromPluginL(const TPointerEvent& aEvent);
     TBool HandleGesture(const TStmGestureEvent& aEvent);    
 	TBool Windowed() { return m_windowedPlugin;}
 	bool containsPoint(WebView& view, const TPoint& pt);
+	void SetBitmapFromPlugin(TInt aHandle);
+	TBool IsPluginFocused() {return m_pluginfocus; }
+	TBool IsPluginBitMapSet() {return m_pluginHasBitmap; }
+	CFbsBitmap* PluginBitmap() {return m_pausedBitmap; }
+	void GetBitmapFromPlugin (bool status);
+	void ClearPluginBitmap();
+	TBool IsCollectBitmapSupported();
+	void drawBitmapToWebCoreContext();
     protected: // New functions
 
         /**
@@ -508,6 +516,9 @@
         bool                                m_windowCreated;
         bool                                m_forceScroll;
         bool                                m_visibilty;
+        CFbsBitmap*                         m_pausedBitmap;       //Plugin paused Bitmap
+        bool                                m_pluginHasBitmap;
+        bool                                m_BitmapSupported;
     };
 
 
--- a/webengine/osswebengine/WebKit/s60/webview/BrCtl.cpp	Wed Jun 09 10:52:50 2010 +0300
+++ b/webengine/osswebengine/WebKit/s60/webview/BrCtl.cpp	Mon Jun 21 16:54:17 2010 +0300
@@ -87,6 +87,7 @@
 #include "PluginSkin.h"
 #include "HttpUiCallbacks.h"
 #include "PluginWin.h"
+#include "GCController.h"
 #include <BrowserVersion.h>
 #include <cuseragent.h>
 
@@ -806,7 +807,10 @@
 #endif
 
                 //Disable the zooming bar when it goes to background
-                m_webView->hideZoomSliderL();                
+                m_webView->hideZoomSliderL();
+                
+                // Instruct JS to garbage collect
+                WebCore::gcController().garbageCollectSoon();                
                 break;
             }
         case TBrCtlDefs::ECommandClearAutoFormFillData:
--- a/webengine/osswebengine/WebKit/s60/webview/WebFepTextEditor.cpp	Wed Jun 09 10:52:50 2010 +0300
+++ b/webengine/osswebengine/WebKit/s60/webview/WebFepTextEditor.cpp	Mon Jun 21 16:54:17 2010 +0300
@@ -54,6 +54,8 @@
 #include <aknutils.h>
 #include "Text.h"
 
+#include <e32const.h>
+
 #define KLineEnterChar 0x21b2
 
 using namespace WebCore;
@@ -158,6 +160,10 @@
                     state->SetSpecialCharacterTableResourceId(R_AVKON_SPECIAL_CHARACTER_TABLE_DIALOG_LATIN_ONLY);
                     state->SetNumericKeymap(EAknEditorStandardNumberModeKeymap);
                     state->SetCcpuState(NULL);
+                    TLanguage language = User::Language();
+                    if (language == ELangPrcChinese ) {
+                       TRAP_IGNORE( state->ReportAknEdStateEventL(MAknEdStateObserver::EAknEdwinStateFlagsUpdate ) );
+                    }
                 }
             }
             else {
--- a/webengine/osswebengine/WebKit/s60/webview/WebFrame.cpp	Wed Jun 09 10:52:50 2010 +0300
+++ b/webengine/osswebengine/WebKit/s60/webview/WebFrame.cpp	Mon Jun 21 16:54:17 2010 +0300
@@ -583,13 +583,24 @@
     return 0;
 }
 
-void WebFrame::PlayPausePlugins(bool pause)
+void WebFrame::ScrollOrPinchStatus(bool status)
 {
     PluginHandler* plghandler = StaticObjectsContainer::instance()->pluginHandler();
-    WTF::HashSet<PluginSkin*> pluginObjs = plghandler->pluginObjects();
-    for(WTF::HashSet<PluginSkin*>::iterator it = pluginObjs.begin() ;  it != pluginObjs.end() ; ++it ) {
-        static_cast<PluginSkin*> (*it)->PlayPauseNotify(pause);
-    }
+       WTF::HashSet<PluginSkin*> pluginObjs = plghandler->pluginObjects();
+       for(WTF::HashSet<PluginSkin*>::iterator it = pluginObjs.begin() ;  it != pluginObjs.end() ; ++it )
+           {
+           PluginSkin* plg = static_cast<PluginSkin*> (*it);
+           WebFrame* plgWebFrame = plg->getWebFrame();
+           CBrCtl*   plbrCtl = control(plg->frame());
+           CBrCtl*   pgbrCtl = control(this);
+
+           if(plbrCtl == pgbrCtl)
+               {
+               plg->NotifyPluginsForScrollOrPinch(status);
+               }
+       }
+
+
 }
 
 void WebFrame::reCreatePlugins()
--- a/webengine/osswebengine/WebKit/s60/webview/WebFrame.h	Wed Jun 09 10:52:50 2010 +0300
+++ b/webengine/osswebengine/WebKit/s60/webview/WebFrame.h	Mon Jun 21 16:54:17 2010 +0300
@@ -97,7 +97,6 @@
     void notifyPluginOfPositionChange(PluginSkin* plg);
     PluginSkin* focusedPlugin();
     WebFrame* frameAtPoint(const TPoint& pt_);
-    void PlayPausePlugins(bool pause);
     void reCreatePlugins();
     
     // utility functions
@@ -109,8 +108,9 @@
     void makeVisiblePlugins(TBool visible);
     bool executeScript(const WebCore::String& script);
     WebCore::Node* getClosestAnchorElement(const TPoint& pt, TPoint& newPos);
-    
-    
+
+	void ScrollOrPinchStatus(bool status);
+
 private:
     WebFrame(const WebFrame&);                    // not implemented
     WebFrame& operator=(const WebFrame&);         // not implemented    
--- a/webengine/osswebengine/WebKit/s60/webview/WebFrameView.cpp	Wed Jun 09 10:52:50 2010 +0300
+++ b/webengine/osswebengine/WebKit/s60/webview/WebFrameView.cpp	Mon Jun 21 16:54:17 2010 +0300
@@ -81,8 +81,7 @@
     
     TRect vr(visibleRect());
     TRect rect(r);
-    if (isScaled() || m_frame->isFrameSet())
-        rect.Grow(1,1);             // eliminate rounding errors
+
     TRect frameRect(m_frameRect);
 
     rect.Move(-frameRect.iTl);
@@ -109,6 +108,10 @@
         
         gc.setClippingRect( clip );
 
+		//Converting To Doc and View co-ordinates calculation will loose 1 px 
+		//if the scalling is other than default level
+        if (isScaled() || m_frame->isFrameSet())
+               rect.Grow(2,2);             // eliminate rounding errors
         // draw frame content
         m_frame->paintRect(gc, rect);
         gc.cancelClipping();
@@ -287,6 +290,9 @@
 
 void WebFrameView::scrollTo(const TPoint& aPoint)
 {
+
+    m_topView->scrollStatus(ETrue);
+
     if (m_parent) {
         // tot:fixme frame scrolling when frame-flat is off
         if (m_frame->isIframe()) {
@@ -438,9 +444,9 @@
         Node* node = focusedFrame->document()->focusedNode();
 	 	if (node) {
             TRect rect = node->getRect().Rect();
-            TPoint viewpoint = kit(focusedFrame)->frameView()->frameCoordsInViewCoords(rect.iTl);
+            TPoint viewPoint = kit(focusedFrame)->frameView()->frameCoordsInViewCoords(rect.iTl);
             WebCursor* cursor = StaticObjectsContainer::instance()->webCursor();
-            cursor->updatePositionAndElemType(viewpoint);
+            cursor->setPosition(viewPoint);
 	 	}
 	 }
 }
--- a/webengine/osswebengine/WebKit/s60/webview/WebPageScrollHandler.cpp	Wed Jun 09 10:52:50 2010 +0300
+++ b/webengine/osswebengine/WebKit/s60/webview/WebPageScrollHandler.cpp	Mon Jun 21 16:54:17 2010 +0300
@@ -43,7 +43,12 @@
 const int KPageOverviewScrollStart = 1000;
 const int KCancelDecelerationTimeout = 200000; //Decelerate only if flicked KCancelDecelerationTimeout microsec after last drag event.
 
+#ifdef BRDO_PERF_IMPROVEMENTS_ENABLED_FF
+const int KScrollIntervalTimeout = 30000; // scroll timer interval in microseconds
+#else
 const int KScrollIntervalTimeout = 40000; // scroll timer interval in microseconds
+#endif
+
 const int KAngularDeviationThreshold = 160; // % deviation ignored from minor axis of motion(120 means 20 %)
 const int KScrollThresholdPixels = 10; // scrolls only if delta is above this threshold
 const int KScrollDirectionBoundary = 30; // Bound around focal point within which scrolling locks in X or Y states
@@ -696,12 +701,19 @@
     }
     
     if ((Abs(gstSpeed.iX) > 0) || (Abs(gstSpeed.iY) > 0)) {
-       m_decelGH->startDecel(gstSpeed, m_scrollbarDrawer); 
-       started = true;
+        started = m_decelGH->startDecel(gstSpeed, m_scrollbarDrawer); 
     }
-    
-    
     return started;
 }
 
+void WebPageScrollHandler::stopScrolling()
+{
+    if (m_scrollTimer && m_scrollTimer->IsActive()) {
+        m_scrollTimer->Cancel();
+   }
+   if (m_scrollbarDrawer) { 
+       m_scrollbarDrawer->fadeScrollbar();
+   }
+   m_webView->setViewIsScrolling(false);
+}
 //  End of File
--- a/webengine/osswebengine/WebKit/s60/webview/WebPageScrollHandler.h	Wed Jun 09 10:52:50 2010 +0300
+++ b/webengine/osswebengine/WebKit/s60/webview/WebPageScrollHandler.h	Mon Jun 21 16:54:17 2010 +0300
@@ -186,6 +186,7 @@
         void handleTouchDownGH(const TStmGestureEvent& aGesture);
         void handleTouchUpGH(const TStmGestureEvent& aGesture);
         void updateScrollbars(const TPoint& scrollPos, TPoint& newscrollDelta);
+        void stopScrolling();
 
      private:
         void calculateScrollDirection(int absX, int absY);
--- a/webengine/osswebengine/WebKit/s60/webview/WebPointerEventHandler.cpp	Wed Jun 09 10:52:50 2010 +0300
+++ b/webengine/osswebengine/WebKit/s60/webview/WebPointerEventHandler.cpp	Mon Jun 21 16:54:17 2010 +0300
@@ -111,10 +111,11 @@
     TBrCtlDefs::TBrCtlElementType elType = m_webview->focusedElementType();
     
     bool pluginConsumable = isPluginConsumable(uid);
+    PluginHandler* pluginHandler = StaticObjectsContainer::instance()->pluginHandler();
     
-    if (pluginConsumable && m_webview->getVisiblePlugins().Count() > 0) {
-        for ( int i=0; i < m_webview->getVisiblePlugins().Count(); i++) {
-             PluginSkin* plugin = m_webview->getVisiblePlugins()[i];
+    if (pluginConsumable && pluginHandler->getVisiblePlugins().Count() > 0) {
+        for ( int i=0; i < pluginHandler->getVisiblePlugins().Count(); i++) {
+             PluginSkin* plugin = pluginHandler->getVisiblePlugins()[i];
              if (plugin && plugin->pluginWin() && plugin->pluginWin()->containsPoint(*m_webview,aGesture.CurrentPos())) {
                  if (plugin->pluginWin()->HandleGesture(aGesture)) {
                      if(!plugin->isActive()) {
@@ -170,6 +171,7 @@
             m_ignoreTap = false;
             handleTouchUp(aGesture);
 			m_webview->resumeJsTimers(); // resume js timers
+			m_webview->setViewIsScrolling(false); 
             break;
         }
 
@@ -179,8 +181,6 @@
             if(!m_webview->jsTimersPaused()) 
                 m_webview->pauseJsTimers();
 
-            if(!m_webview->isScrolling())
-                m_webview->setScrolling(true);
             handleMove(aGesture);
             break;
         }
@@ -199,6 +199,9 @@
 
         case stmGesture::EGestureUidPinch:
         {
+        if (m_webview->viewIsScrolling()) {
+            m_webview->pageScrollHandler()->stopScrolling();
+        }
         if(!m_webview->inPageViewMode())
             {
             handlePinchZoomL(aGesture);
@@ -621,9 +624,11 @@
 bool WebPointerEventHandler::isPluginConsumable(const TStmGestureUid uid)
 {
     //  Gestures which a Plugin can consume
-    return (uid == stmGesture::EGestureUidRelease ||
-            uid == stmGesture::EGestureUidTap ||
-            uid == stmGesture::EGestureUidTouch ||
-            uid == stmGesture::EGestureUidLongPress ||
-            (uid == stmGesture::EGestureUidPan && m_webview->widgetExtension())); // Currently Pan is consumed in Widget mode
+    return ( uid == stmGesture::EGestureUidRelease ||
+             uid == stmGesture::EGestureUidTap ||
+             uid == stmGesture::EGestureUidTouch ||
+             uid == stmGesture::EGestureUidLongPress ||
+             (uid == stmGesture::EGestureUidPan && m_webview->widgetExtension()) ||     // Currently Pan is consumed in Widget mode
+             (uid == stmGesture::EGestureUidFlick && m_webview->widgetExtension())
+           ); 
 }
--- a/webengine/osswebengine/WebKit/s60/webview/WebScrollingDeceleratorGH.cpp	Wed Jun 09 10:52:50 2010 +0300
+++ b/webengine/osswebengine/WebKit/s60/webview/WebScrollingDeceleratorGH.cpp	Mon Jun 21 16:54:17 2010 +0300
@@ -17,6 +17,7 @@
 
 
 // INCLUDE FILES
+#include <browser_platform_variant.hrh>
 #include <../bidi.h>
 #include "WebScrollingDeceleratorGH.h"
 #include "WebView.h"
@@ -35,7 +36,11 @@
 // It lists the timeout dt values in microseconds.
 const int KDecelCurveSize = 10;
 
+#ifdef BRDO_PERF_IMPROVEMENTS_ENABLED_FF
+const int KScrollIntervalTimeout = 30000; // scroll timer interval in microseconds
+#else
 const int KScrollIntervalTimeout = 60000; // scroll timer interval in microseconds
+#endif
 
 const float KDecceleration = -750.0;
 const float KSpeedHigh = 2000.0;
@@ -107,14 +112,15 @@
 { 
     m_decelelatorSwitch = false;
     if (m_decelTimer->IsActive()) {
-        m_webView.setScrolling(false);
+        m_webView.setViewIsScrolling(false);
 		m_webView.resumeJsTimers();		
         m_decelTimer->Cancel();
     }
 }
 
-void WebScrollingDeceleratorGH::startDecel(TRealPoint& speed, WebScrollbarDrawer* scrollbarDrawer)
+bool WebScrollingDeceleratorGH::startDecel(TRealPoint& speed, WebScrollbarDrawer* scrollbarDrawer)
 {
+    bool started = false;
     m_decelelatorSwitch = true;
     m_scrollbarDrawer = scrollbarDrawer;
     float speedX = speed.iX;
@@ -134,7 +140,7 @@
     
     m_numscrollsteps = 0;
     if (m_decelTimer->IsActive()) {
-        m_webView.setScrolling(false);
+        m_webView.setViewIsScrolling(false);
     	m_webView.resumeJsTimers();
         m_decelTimer->Cancel();
     }
@@ -142,12 +148,14 @@
     WebFrameView* scrollingView = m_webView.pageScrollHandler()->currentScrollingFrameView();
     if (scrollingView) {
         m_webView.pauseJsTimers(); // pause the JS timers
-        m_webView.setScrolling(true);
+        m_webView.setViewIsScrolling(true);
         m_startPos = scrollingView->contentPos();
         m_lastPos = m_startPos;
         m_decelTimer->Start(0, KScrollIntervalTimeout, 
                             TCallBack(&decelTimerCB, this));
+        started = true;
     }
+    return started;
 }
 
 void WebScrollingDeceleratorGH::scroll()
@@ -195,7 +203,7 @@
         }
 		
         m_webView.resumeJsTimers(); // resume the js timers
-        m_webView.setScrolling(false);
+        m_webView.setViewIsScrolling(false);
         m_decelTimer->Cancel();
         handler->clearScrollingElement();
         m_webView.setViewIsScrolling(false);
--- a/webengine/osswebengine/WebKit/s60/webview/WebScrollingDeceleratorGH.h	Wed Jun 09 10:52:50 2010 +0300
+++ b/webengine/osswebengine/WebKit/s60/webview/WebScrollingDeceleratorGH.h	Mon Jun 21 16:54:17 2010 +0300
@@ -60,7 +60,7 @@
 
     public: // Main functions
         
-        void startDecel(TRealPoint& speed, WebScrollbarDrawer* scrollbarDrawer);
+        bool startDecel(TRealPoint& speed, WebScrollbarDrawer* scrollbarDrawer);
         
         void cancelDecel();
         
--- a/webengine/osswebengine/WebKit/s60/webview/WebView.cpp	Wed Jun 09 10:52:50 2010 +0300
+++ b/webengine/osswebengine/WebKit/s60/webview/WebView.cpp	Mon Jun 21 16:54:17 2010 +0300
@@ -211,7 +211,6 @@
 , m_pinchZoomHandler(NULL)
 , m_isPinchZoom(false)
 , m_drawsMissed(0)
-, m_scroll(false)
 , m_thumbnailGenerator(NULL)
 , m_checkerBoardBitmap(NULL)
 , m_checkerBoardDevice(NULL)
@@ -234,8 +233,6 @@
     m_pageZoomHandler = NULL;
 
     m_zoomLevelArray.Close();
-    m_visiblePlugins.Reset();
-    m_visiblePlugins.Close();
 
     // prevent frameViews to access members when topView is
     // closing down.
@@ -399,7 +396,6 @@
     CleanupStack::PopAndDestroy(2); // userAgent8, usrAgnt
 
     MakeViewVisible(ETrue);
-    m_isPluginsVisible=ETrue;
     CCoeControl::SetFocus(ETrue);
     
     cache()->setCapacities(0, 0, defaultCacheCapacity);
@@ -407,7 +403,6 @@
     m_waiter = new(ELeave) CActiveSchedulerWait();
     
     m_checkerBoardDestroyTimer = CPeriodic::NewL(CActive::EPriorityIdle);
-    m_visiblePlugins.Reset();
     
 }
 
@@ -640,7 +635,6 @@
             }
 #endif         
     }
-    mainFrame()->notifyPluginsOfPositionChange();
 }
 //-------------------------------------------------------------------------------
 // WebView::syncRepaint
@@ -2154,6 +2148,18 @@
             m_brctl->settings()->setNavigationType(SettingsContainer::NavigationTypeNone);
         }
     }
+    else if (name == "widgetAppBackgroundColour") {
+        if (value == "black") {
+            WebCore::Frame *frame = core(mainFrame());
+            if (frame) {
+                WebCore::FrameView* frameView = frame->view();
+                if (frameView) {
+                    WebCore::Color bc = Color::black;
+                    frameView->setBaseBackgroundColor(bc);
+                }
+            }
+        }
+    }
 }
 
 //-------------------------------------------------------------------------------
@@ -2265,8 +2271,6 @@
     if (!view) return;
 
     m_dirtyZoomMode = true;
-    m_isPluginsVisible = false;
-    mainFrame()->makeVisiblePlugins(false);
 
     if (zoomLevel > m_startZoomLevel) {
 
@@ -2320,10 +2324,9 @@
     m_dirtyZoomMode = false;
     clearOffScreenBitmap();
     zoomLevelChanged(zoomLevel);
-    mainFrame()->notifyPluginsOfPositionChange();
-    m_isPluginsVisible = false;
-    mainFrame()->makeVisiblePlugins(true);
-    m_isPluginsVisible = true;
+	//update the position position after the relayout is completed, 
+	//This will minimize the plugins flickering
+    scrollStatus(false);
 }
 
 //-------------------------------------------------------------------------------
@@ -2872,9 +2875,7 @@
 {
   if (fastScrolling != m_viewIsFastScrolling) {
   setViewIsFastScrolling (fastScrolling);
-  m_isPluginsVisible = false;
   mainFrame()->makeVisiblePlugins(!m_viewIsFastScrolling);
-  m_isPluginsVisible = !m_viewIsFastScrolling;
 
   if (!m_viewIsFastScrolling) {
     mainFrame()->notifyPluginsOfPositionChange();
@@ -3050,9 +3051,20 @@
 void WebView::setPinchBitmapZoomLevelL(int zoomLevel)
 {
     m_zoomLevelChangedByUser = true;
+
+    m_isPinchZoom = true;
+    if(!m_dirtyZoomMode)
+    {
+    //If panning or scroll is in progress, we will be notifiying to plugins for collecting bitmap
+    //in case of pinchZoom, we need to deactivate the plugins which are not supported for bitmap
+    //sharing.
+    if(m_scrollingstatus)
+        {
+        m_scrollingstatus = false;
+        }
+    scrollStatus(true);
+	}
     m_dirtyZoomMode = true;
-    m_isPluginsVisible = false;
-    m_isPinchZoom = true;
 
     if (zoomLevel > m_startZoomLevel) {
         setPinchBitmapZoomIn(zoomLevel);
@@ -3063,11 +3075,7 @@
     }
     m_currentZoomLevel = zoomLevel;
     DrawNow();
-    PluginSkin* pluginskin = mainFrame()->focusedPlugin();
-    if(pluginskin)
-     {
-        pluginskin->deActivate();
-    }
+
 }
 
 //-------------------------------------------------------------------------------
@@ -3144,11 +3152,6 @@
         createCheckerBoardL();
 }
 
-void WebView::setScrolling(bool scroll)
-{
-    m_scroll = scroll;
-    mainFrame()->PlayPausePlugins(m_scroll);
-}
 
 void drawCheckerBoard(CBitmapContext *gc,const TRect &rect)
 {
@@ -3286,3 +3289,23 @@
     }
 }
 // END OF FILE
+void WebView::scrollStatus(bool status)
+    {
+    if(m_scrollingstatus != status)
+        {
+        m_scrollingstatus = status;
+#ifdef BRDO_MULTITOUCH_ENABLED_FF
+        mainFrame()->ScrollOrPinchStatus(m_scrollingstatus);
+#endif         
+        }
+    }
+
+
+void WebView::setViewIsScrolling(bool scrolling)
+    {
+    m_viewIsScrolling = scrolling;
+    if(!scrolling)
+        {
+        scrollStatus(scrolling);
+        }
+    };
--- a/webengine/osswebengine/WebKit/s60/webview/WebView.h	Wed Jun 09 10:52:50 2010 +0300
+++ b/webengine/osswebengine/WebKit/s60/webview/WebView.h	Mon Jun 21 16:54:17 2010 +0300
@@ -315,7 +315,7 @@
         *
         *
         */
-        void setViewIsScrolling(bool scrolling) { m_viewIsScrolling = scrolling; };
+        void setViewIsScrolling(bool scrolling);
 
         /**
         * Return if the user is currently scrolling
@@ -389,11 +389,8 @@
          * Starts the checkerboard timer. End of this timer, checkerboard will be destroyed.
          */
         void startCheckerBoardDestroyTimer();
-        
-        void setScrolling(bool scroll);
-         
-        bool isScrolling() { return m_scroll; }
 
+        void scrollStatus(bool status);
     public: // from MPageScalerCallback
         /**
         *
@@ -545,8 +542,8 @@
         void resumeJsTimers();
         bool jsTimersPaused() { return (m_jsTimeouts) ? true : false; }
         void resetJsTimers() { m_jsTimeouts = 0; }
-        RPointerArray<PluginSkin>& getVisiblePlugins(){ return m_visiblePlugins;}
-        
+
+        WebCoreGraphicsContext* getGraphicsContext() {return m_webcorecontext; }
     private:
         WebCore::Page*          m_page;
         WebFrameView*           m_frameView;
@@ -614,7 +611,6 @@
         int                 m_startZoomLevel;
         bool                m_dirtyZoomMode;
         bool                m_zoomLevelChangedByUser;
-        bool                m_isPluginsVisible;
         bool                m_historyLoad;
         bool                m_redirectWithLockedHistory;
         // full screen mode
@@ -638,7 +634,6 @@
         TBool                    m_isPinchZoom;
         TRealPoint               m_pinchDocDelta;
         int                      m_drawsMissed;
-        bool m_scroll;
         CThumbnailGenerator* m_thumbnailGenerator;
         
         CFbsBitmap              *m_checkerBoardBitmap;
@@ -652,7 +647,7 @@
    	    // JavaScript (DOMWindowTimer) timers
         KJS::PausedTimeouts*     m_jsTimeouts;
         
-        RPointerArray<PluginSkin> m_visiblePlugins;
+        TBool                    m_scrollingstatus;
     };
 
 #endif
--- a/webengine/osswebengine/webkit/s60/webview/WebPagePinchZoomHandler.cpp	Wed Jun 09 10:52:50 2010 +0300
+++ b/webengine/osswebengine/webkit/s60/webview/WebPagePinchZoomHandler.cpp	Mon Jun 21 16:54:17 2010 +0300
@@ -63,7 +63,6 @@
 , m_zoomStepSize(0)
 , m_pinchActive(false)
 , m_pinchCenter(0,0)
-, m_isPluginsVisible(true)
 {
 }
 
@@ -187,10 +186,6 @@
 // -----------------------------------------------------------------------------
 void WebPagePinchZoomHandler::setZoomLevelL(int zoomLevel)
 {
-    if (m_isPluginsVisible) {
-        m_webView->mainFrame()->makeVisiblePlugins(false);
-        m_isPluginsVisible = false;
-    }
     m_webView->setPinchBitmapZoomLevelL(zoomLevel);
 }
 
@@ -212,7 +207,6 @@
 // -----------------------------------------------------------------------------
 void WebPagePinchZoomHandler::updateBitmap(void)
 {
-    m_isPluginsVisible = true;
     m_bitmapUpdateTimer->Cancel();
     m_webView->restoreZoomLevel(m_webView->scalingFactor());
     //update the plugin rect after pinch zoom exit
--- a/webengine/osswebengine/webkit/s60/webview/WebPagePinchZoomHandler.h	Wed Jun 09 10:52:50 2010 +0300
+++ b/webengine/osswebengine/webkit/s60/webview/WebPagePinchZoomHandler.h	Mon Jun 21 16:54:17 2010 +0300
@@ -117,7 +117,6 @@
     TInt             m_zoomStepSize;
     bool             m_pinchActive;
     TPoint           m_pinchCenter;
-    bool             m_isPluginsVisible;
 
 };
 
--- a/webengine/webkitutils/HistoryProvider/HistoryView.cpp	Wed Jun 09 10:52:50 2010 +0300
+++ b/webengine/webkitutils/HistoryProvider/HistoryView.cpp	Mon Jun 21 16:54:17 2010 +0300
@@ -48,7 +48,7 @@
 
 #define KCenterImageBorderColor TRgb(179,179,181)
 #define KSideImageBorderColor KRgbBlack
-#define KSideImageMaskColor TRgb( 170, 170, 170, 150 )
+#define KSideImageMaskColor TRgb(170, 170, 170)
 
 // ============================= LOCAL FUNCTIONS ===============================
 
@@ -142,6 +142,7 @@
         m_autoScrollPeriodic->Cancel();
         delete m_autoScrollPeriodic;
     }
+    delete m_maskBitmap;
 }
 
 bool HistoryView::calcRepaintRect()
@@ -285,13 +286,18 @@
             TRAP_IGNORE(leftEntry->constructThumbnailL());
         }
         if (leftEntry->thumbnail()) {
-            m_bitmapContext->BitBlt( m_leftPlaceHolderRect.iTl, leftEntry->thumbnail(), TRect(TPoint(0,0), m_leftPlaceHolderRect.Size()) );
+            if(!m_maskBitmap) {
+                TSize maskBitmapSize(m_leftPlaceHolderRect.Size());
+                TRAP_IGNORE(CreateMaskBitmapForLeftRightThumbnailL(maskBitmapSize, EGray256, KSideImageMaskColor));
+            }
+            if(m_maskBitmap) {
+                m_bitmapContext->BitBltMasked(m_leftPlaceHolderRect.iTl, leftEntry->thumbnail(), TRect(TPoint(0,0), m_leftPlaceHolderRect.Size()), m_maskBitmap, EFalse);
+            }
+            else {
+                //if failed to create a mask, just draw the left entry thumbnail.
+                m_bitmapContext->BitBlt( m_leftPlaceHolderRect.iTl, leftEntry->thumbnail(), TRect(TPoint(0,0), m_leftPlaceHolderRect.Size()) );
+            }
         }
-        
-        m_bitmapContext->SetBrushColor ( KSideImageMaskColor );
-        m_bitmapContext->SetBrushStyle ( CWindowGc::ESolidBrush );
-        m_bitmapContext->DrawRect(m_leftPlaceHolderRect);
-        m_bitmapContext->SetBrushStyle(CGraphicsContext::ENullBrush);
     }
     // updateDisplay the next thumbnail
     if (rightEntry) {
@@ -299,13 +305,18 @@
             TRAP_IGNORE(rightEntry->constructThumbnailL());
         }
         if (rightEntry->thumbnail()) {
-            m_bitmapContext->BitBlt( m_rightPlaceHolderRect.iTl, rightEntry->thumbnail(), TRect(TPoint(0,0), m_rightPlaceHolderRect.Size()) );
+            if(!m_maskBitmap) {
+                TSize maskBitmapSize(m_rightPlaceHolderRect.Size());
+                TRAP_IGNORE(CreateMaskBitmapForLeftRightThumbnailL(maskBitmapSize, EGray256, KSideImageMaskColor));
+            }
+            if(m_maskBitmap) {
+                m_bitmapContext->BitBltMasked(m_rightPlaceHolderRect.iTl, rightEntry->thumbnail(), TRect(TPoint(0,0), m_rightPlaceHolderRect.Size()), m_maskBitmap, EFalse);
+            }
+            else {
+                //if failed to create a mask, just draw the right entry thumbnail.
+                m_bitmapContext->BitBlt( m_rightPlaceHolderRect.iTl, rightEntry->thumbnail(), TRect(TPoint(0,0), m_rightPlaceHolderRect.Size()) );
+            }
         }
-        
-        m_bitmapContext->SetBrushColor ( KSideImageMaskColor );
-        m_bitmapContext->SetBrushStyle ( CWindowGc::ESolidBrush );
-        m_bitmapContext->DrawRect(m_rightPlaceHolderRect);
-        m_bitmapContext->SetBrushStyle(CGraphicsContext::ENullBrush);
     }
     // updateDisplay the center thumbnail
     if (m_centerEntry ) {
@@ -830,4 +841,23 @@
 
     }
 }
+
+void HistoryView::CreateMaskBitmapForLeftRightThumbnailL(TSize& aSize, TDisplayMode aDisplayMode, TRgb aRgb)
+{
+    if(m_maskBitmap) {
+        delete m_maskBitmap;
+        m_maskBitmap = NULL;
+    }
+    m_maskBitmap = new (ELeave) CFbsBitmap();
+    User::LeaveIfError(m_maskBitmap->Create(aSize, aDisplayMode));
+    CFbsBitmapDevice* maskBitmapDevice = CFbsBitmapDevice::NewL(m_maskBitmap);
+    CFbsBitGc* maskBitmapContext;
+    User::LeaveIfError(maskBitmapDevice->CreateContext(maskBitmapContext));
+    maskBitmapContext->SetPenStyle( CGraphicsContext::ENullPen );
+    maskBitmapContext->SetBrushColor( aRgb );
+    maskBitmapContext->SetBrushStyle( CGraphicsContext::ESolidBrush );
+    maskBitmapContext->DrawRect(TRect(TPoint(0,0), m_maskBitmap->SizeInPixels()));
+    delete maskBitmapContext;
+    delete maskBitmapDevice;
+}
 //  End of File
--- a/webengine/webkitutils/HistoryProvider/HistoryView.h	Wed Jun 09 10:52:50 2010 +0300
+++ b/webengine/webkitutils/HistoryProvider/HistoryView.h	Mon Jun 21 16:54:17 2010 +0300
@@ -209,6 +209,15 @@
         * @return void
         */
         void loadUrl();
+        
+        /**
+         * Create a mask bitmap for the thumbnail of left and right entry
+         * left and right entry will use the same mask 
+         * @param aSize The size of the mask bitmap which will be cteated
+         * @param aDisplayMode The display mode of the mask bitmap
+         * @param aRgb The color filled in the bitmap
+         */
+        void CreateMaskBitmapForLeftRightThumbnailL(TSize& aSize, TDisplayMode aDisplayMode, TRgb aRgb);
 
     private:    // Data
 
@@ -258,8 +267,9 @@
         THistoryViewComponent    m_historyViewComponent;
         // Timer for repeated scrolling
         CPeriodic*               m_autoScrollPeriodic;
-
-        TPoint m_lastpointerposition;
+        TPoint                   m_lastpointerposition;
+        //Mask bitmap for the thumbnail of left and right entry
+        CFbsBitmap*              m_maskBitmap;
     };
 
 #endif      // HISTORYVIEW_H
--- a/webengine/widgetengine/inc/Preferences.h	Wed Jun 09 10:52:50 2010 +0300
+++ b/webengine/widgetengine/inc/Preferences.h	Mon Jun 21 16:54:17 2010 +0300
@@ -172,6 +172,7 @@
     void internalizeL(RReadStream& aStream);
       
     void deleteAllPrefFiles();
+    static TInt SavePref(TAny* aPtr);
 
 private:
     RPtrHashMap<TDesC,PrefElement>* m_preferences;                
@@ -180,6 +181,7 @@
     HBufC* m_widgetbundleid;
     HBufC* m_basepath;
     HBufC* m_filepath;
+    CAsyncCallBack* m_asynsave;
 
 };
     
--- a/webengine/widgetengine/src/Preferences.cpp	Wed Jun 09 10:52:50 2010 +0300
+++ b/webengine/widgetengine/src/Preferences.cpp	Mon Jun 21 16:54:17 2010 +0300
@@ -49,7 +49,8 @@
                                         m_basepath(0),
                                         m_filepath(0)
 {
-    m_preferences = new RPtrHashMap<TDesC,PrefElement>();    
+    m_preferences = new RPtrHashMap<TDesC,PrefElement>();
+    m_asynsave = new (ELeave) CAsyncCallBack(TCallBack(SavePref,this),CActive::EPriorityIdle);
 }
 
 // ----------------------------------------------------------------------------
@@ -59,8 +60,19 @@
 //
 // ----------------------------------------------------------------------------
 WidgetPreferences::~WidgetPreferences()
-{
-    //TRAP_IGNORE( saveL() );
+{       
+    if(m_asynsave && m_asynsave->IsActive())
+        {
+        m_asynsave->Cancel();
+        TRAPD(err, saveL());
+        if(err!= KErrNone) 
+            {
+            deleteAllPrefFiles();
+            }      
+        }    
+    delete m_asynsave;
+    m_asynsave = NULL;
+    
     if (m_preferences) {
         m_preferences->ResetAndDestroy();
         m_preferences->Close();
@@ -265,14 +277,10 @@
 
         CleanupStack::Pop();   // k
 
-        // Save update to persistent storage
-        TRAPD(err, saveL());
-        if(err!= KErrNone)
-            {
-            deleteAllPrefFiles();
-            }
+    // Save update to persistent storage
+    m_asynsave->Cancel();
+    m_asynsave->CallBack();
     }
-
 }
 
 // ----------------------------------------------------------------------------
@@ -544,6 +552,23 @@
 
     CleanupStack::PopAndDestroy(3); // readStream, filePath, fs
 }
+
+// ----------------------------------------------------------------------------
+// WidgetPreferences::SavePref
+// Save preferences for persistent storage
+//
+//
+// 
+TInt WidgetPreferences::SavePref(TAny* aPtr)
+{   
+    WidgetPreferences* self = (WidgetPreferences*)aPtr;
+    TRAPD(err, self->saveL());
+    if(err!= KErrNone)
+        {
+        self->deleteAllPrefFiles();
+        }
+    return 0;
+}
     
 // ----------------------------------------------------------------------------
 // PrefElement::PrefElement
--- a/webengine/wmlengine/src/ImageCH/src/Epoc32ImageContentHandler.cpp	Wed Jun 09 10:52:50 2010 +0300
+++ b/webengine/wmlengine/src/ImageCH/src/Epoc32ImageContentHandler.cpp	Mon Jun 21 16:54:17 2010 +0300
@@ -440,9 +440,17 @@
             NW_ASSERT(NW_Object_IsInstanceOf(thisObj->image,
                                              &NW_Image_Epoc32Simple_Class));    
             simpleImage = NW_Image_Epoc32SimpleOf(thisObj->image);
-            // pass chunk to the decoded
-            status = NW_Image_Epoc32Simple_PartialNextChunk(NW_Image_AbstractImageOf(simpleImage),
+             //Checking is simpleimage valid for decoding
+                
+            if( simpleImage->imageType == ERecognizedImage ||
+                simpleImage->imageType == EWbmpImage || 
+                simpleImage->imageType == EOtaImage )
+                {
+                // pass chunk to the decoded
+                status = NW_Image_Epoc32Simple_PartialNextChunk(NW_Image_AbstractImageOf(simpleImage),
                                                             response->body);
+                }
+				
             // NW_Image_Epoc32Simple_PartialNextChunk takes body ownership
             response->body = NULL;
             
--- a/widgets/widgetapp/inc/WidgetUiWindow.h	Wed Jun 09 10:52:50 2010 +0300
+++ b/widgets/widgetapp/inc/WidgetUiWindow.h	Mon Jun 21 16:54:17 2010 +0300
@@ -27,9 +27,6 @@
 #include <coecntrl.h>
 #include "WidgetUiObserver.h"
 
-#ifdef BRDO_OCC_ENABLED_FF
-#include <connectionobservers.h>
-#endif
 
 // CONSTANTS
 enum TWidgetAccessGrant
@@ -90,9 +87,6 @@
                     public MWidgetCallback, 
                     public MBrCtlSpecialLoadObserver,
                     public MAknServerAppExitObserver
-#ifdef BRDO_OCC_ENABLED_FF
-	                ,public MConnectionStageObserver
-#endif
     {
     public:
 
@@ -239,28 +233,6 @@
 
         void HandleServerAppExit( TInt aReason );
 
-#ifdef BRDO_OCC_ENABLED_FF        
-    protected:  // from MConnectionStageObserver
-      
-        /**
-        * Connection stage achieved. 
-        */
-        void ConnectionStageAchievedL();
-   public:
-   	
-        //Retry flags
-        void SetRetryFlag(TBool flag);
-        TBool GetRetryFlag();
-        
-        //For Call back for reconnectivity
-        static TInt RetryConnectivity(TAny* aCBrowserAppUi);
-        TInt RetryInternetConnection();	
-        
-        CPeriodic *iRetryConnectivity;
-        TBool reConnectivityFlag;
-        void ConnNeededStatusL( TInt aErr );
-        void StopConnectionObserving();
-#endif
     public:  // new functions
 
         /**
@@ -656,9 +628,7 @@
         TBool                           iDeleteItself;
         CAsyncCallBack*                 iAsyncCallBack;    
         CBrowserDialogsProvider*        iDialogsProvider;// owned, responsible for deleting
-#ifdef BRDO_OCC_ENABLED_FF
-        CConnectionStageNotifierWCB*    iConnStageNotifier;                                
-#endif
+
    };
 
 #endif  //
--- a/widgets/widgetapp/inc/WidgetUiWindowManager.h	Wed Jun 09 10:52:50 2010 +0300
+++ b/widgets/widgetapp/inc/WidgetUiWindowManager.h	Mon Jun 21 16:54:17 2010 +0300
@@ -59,6 +59,9 @@
 class CCpsPublisher;
 #endif
 // CLASS DECLARATION
+#ifdef BRDO_OCC_ENABLED_FF
+#include <connectionobservers.h>
+#endif
 
 class CRepository; 
 
@@ -93,7 +96,10 @@
 *  @since 3.1
 */
 class CWidgetUiWindowManager : public CBase,
-	                             public MCenrepWatcher
+	                           public MCenrepWatcher
+#ifdef BRDO_OCC_ENABLED_FF
+                              ,public MConnectionStageObserver
+#endif
     {
     public:  // constructors / destructor
 
@@ -604,7 +610,27 @@
         * @return none
         */
         void SendWidgetToBackground( const TUid& aUid );
-
+#ifdef BRDO_OCC_ENABLED_FF        
+   protected:  // from MConnectionStageObserver
+      
+       // Connection stage achieved. 
+        void ConnectionStageAchievedL();
+   public:
+    
+        //Retry flags
+        void SetRetryFlag(TBool flag);
+        TBool GetRetryFlag();
+        
+        //For Call back for reconnectivity
+        static TInt RetryConnectivity(TAny* aWindowManager);
+        TInt RetryInternetConnection(); 
+        
+        CPeriodic *iRetryConnectivity;
+        TBool reConnectivityFlag;
+        void ConnNeededStatusL( TInt aErr );
+        void StopConnectionObserving();
+#endif
+        
     private:
 
         CWidgetUiWindow*                    iActiveFsWindow;    // reference.
@@ -632,7 +658,10 @@
         CPeriodic*                          iNotifyHarvester;//Notify harvester to send next event
 #ifdef  OOM_WIDGET_CLOSEALL
         TTime                               iTimeLastWidgetOpen;
-#endif  
+#endif
+#ifdef BRDO_OCC_ENABLED_FF
+        CConnectionStageNotifierWCB*    iConnStageNotifier;                                
+#endif
     };
 
 #endif  // WIDGETUIWINDOWMANAGER_H_
--- a/widgets/widgetapp/src/WidgetUiWindow.cpp	Wed Jun 09 10:52:50 2010 +0300
+++ b/widgets/widgetapp/src/WidgetUiWindow.cpp	Mon Jun 21 16:54:17 2010 +0300
@@ -56,9 +56,7 @@
 
 const TUint KWmlNoDefaultAccessPoint = KMaxTUint; // see cenrep setting default -1 as int, here as uint
 const TUint KWmlNoDefaultSnapId = KMaxTUint; // see cenrep setting default -1 as int, here as uint
-#ifdef BRDO_OCC_ENABLED_FF
-const TInt KRetryConnectivityTimeout( 2*1000*1000 ); // 2 seconds
-#endif
+
 
 // MACROS
 
@@ -206,12 +204,6 @@
     // determine initial widget online/offline network state
     DetermineNetworkState();
     iAsyncCallBack = new (ELeave) CAsyncCallBack(TCallBack(DeleteItself,this),CActive::EPriorityUserInput);
-#ifdef BRDO_OCC_ENABLED_FF
-    iConnStageNotifier = CConnectionStageNotifierWCB::NewL();
-    //this is required, browser's connection oberver should be hit first. (incase of netscape plgins, transactions will be closed.)
-    iConnStageNotifier->SetPriority(CActive::EPriorityHigh);
-    iRetryConnectivity = CPeriodic::NewL(CActive::EPriorityStandard);
-#endif
     }
 
 // -----------------------------------------------------------------------------
@@ -231,14 +223,6 @@
         iEngine->RemoveLoadEventObserver( iWidgetUiObserver );
         iEngine->RemoveStateChangeObserver( iWindowManager.View() );
         }
-#ifdef BRDO_OCC_ENABLED_FF 
-    if ( iRetryConnectivity)
-        {
-        iRetryConnectivity->Cancel();
-        delete iRetryConnectivity;
-        iRetryConnectivity = NULL;
-        }
-#endif
     delete iEngine;
     delete iWidgetUiObserver;
     delete iUrl;
@@ -942,11 +926,12 @@
         if(iWindowManager.GetNetworkMode() == EOfflineMode)
         	{
             iWindowManager.GetConnection()->CancelConnection();
-            iWindowManager.GetConnection()->StopConnectionL();        		
+            iWindowManager.GetConnection()->StopConnectionL();
+            User::Leave( KErrAccessDenied );
         	}      
 #ifdef BRDO_OCC_ENABLED_FF        
 		else
-        	TRAP_IGNORE(ConnNeededStatusL(KErrNone)); 
+        	TRAP_IGNORE(iWindowManager.ConnNeededStatusL(KErrNone)); 
 #endif        
         }
     }
@@ -963,7 +948,7 @@
 
     {
 #ifdef BRDO_OCC_ENABLED_FF
-    TBool retryFlag = GetRetryFlag();
+    TBool retryFlag = iWindowManager.GetRetryFlag();
     if( retryFlag )
         {
         return;
@@ -1335,115 +1320,6 @@
     }
     
 #ifdef BRDO_OCC_ENABLED_FF
-// -----------------------------------------------------------------------------
-// CWidgetUiWindow::ConnectionStageAchievedL()
-// -----------------------------------------------------------------------------
-//
-void CWidgetUiWindow::ConnectionStageAchievedL()
-    {
-    iWindowManager.GetConnection()->Disconnect();
-    
-    TNifProgressBuf buf = iConnStageNotifier->GetProgressBuffer();
-    if( buf().iError == KErrDisconnected )
-        {
-        TRAP_IGNORE( Engine()->HandleCommandL( (TInt)TBrCtlDefs::ECommandSetRetryConnectivityFlag + (TInt)TBrCtlDefs::ECommandIdBase ) );
-        SetRetryFlag(ETrue);    
-    
-        TRAP_IGNORE( Engine()->HandleCommandL( (TInt)TBrCtlDefs::ECommandCancelQueuedTransactions + (TInt)TBrCtlDefs::ECommandIdBase ) );
-    
-        if( iRetryConnectivity && iRetryConnectivity->IsActive())
-            {
-            iRetryConnectivity->Cancel();
-            }
-        iRetryConnectivity->Start(KRetryConnectivityTimeout, 0,TCallBack(RetryConnectivity,this));
-        }
-    else
-        {
-        TRAP_IGNORE( Engine()->HandleCommandL( (TInt)TBrCtlDefs::ECommandCancelFetch + (TInt)TBrCtlDefs::ECommandIdBase ) );
-        }
-    }  
-
-void CWidgetUiWindow::ConnNeededStatusL( TInt aErr )
-    {
-    StopConnectionObserving(); //Need to stop the connection observer first
-
-
-    if ( !iConnStageNotifier->IsActive() )
-        {
-        TName* connectionName = iWindowManager.GetConnection()->ConnectionNameL();
-        CleanupStack::PushL( connectionName );
-
-        iConnStageNotifier->StartNotificationL(connectionName, KLinkLayerClosed, this);
-
-        CleanupStack::PopAndDestroy();  //connectionName
-        }
-    } 
-void CWidgetUiWindow::StopConnectionObserving()
-    {
-    
-    if ( iConnStageNotifier )
-        {
-        iConnStageNotifier->Cancel();
-        }
-    } 
-
-// -----------------------------------------------------------------------------
-// CWidgetUiWindow::SetRetryFlag
-// -----------------------------------------------------------------------------
-//
-void CWidgetUiWindow::SetRetryFlag(TBool flag)
-     {
-     reConnectivityFlag = flag;
-     }
-// -----------------------------------------------------------------------------
-// CWidgetUiWindow::RetryConnectivity
-// -----------------------------------------------------------------------------
-//
-TInt CWidgetUiWindow::RetryConnectivity(TAny* aWidgetUiWindow)
-    {
-
-    TInt err = ((CWidgetUiWindow*)aWidgetUiWindow)->RetryInternetConnection();
-    return err;
-    }
-TInt CWidgetUiWindow::RetryInternetConnection()
-    {
-    //First cancel the timer
-    if ( iRetryConnectivity && iRetryConnectivity->IsActive() )
-    {
-        iRetryConnectivity->Cancel();
-    }
-    TInt err = KErrNone;
-    if ( !iWindowManager.GetConnection()->Connected() )
-       {
-       TRAP_IGNORE( err = iWindowManager.GetConnection()->StartConnectionL( ETrue ) );
-       }
-    if( err == KErrNone )
-       { 
-   
-       TRAP_IGNORE( Engine()->HandleCommandL( (TInt)TBrCtlDefs::ECommandUnSetRetryConnectivityFlag + (TInt)TBrCtlDefs::ECommandIdBase ) );
-       SetRetryFlag(EFalse);
-       
-       TRAP_IGNORE(ConnNeededStatusL(err)); //Start the observer again
-       TRAP_IGNORE( Engine()->HandleCommandL( (TInt)TBrCtlDefs::ECommandRetryTransactions + (TInt)TBrCtlDefs::ECommandIdBase ) );
-       }
-    else
-        {
-        TRAP_IGNORE( Engine()->HandleCommandL( (TInt)TBrCtlDefs::ECommandUnSetRetryConnectivityFlag + (TInt)TBrCtlDefs::ECommandIdBase ) );
-        SetRetryFlag(EFalse);
-        TRAP_IGNORE(Engine()->HandleCommandL( (TInt)TBrCtlDefs::ECommandClearQuedTransactions + (TInt)TBrCtlDefs::ECommandIdBase ) );
-        }
-    
-    return err;
-    }
-// -----------------------------------------------------------------------------
-// CWidgetUiWindow::GetRetryFlag
-// -----------------------------------------------------------------------------
-//
- TBool CWidgetUiWindow::GetRetryFlag()
-      {
-      return reConnectivityFlag;
-      } 
- 
  void CWidgetUiWindow::CancelAllDialogs()
      {
      if( iDialogsProvider)
--- a/widgets/widgetapp/src/WidgetUiWindowManager.cpp	Wed Jun 09 10:52:50 2010 +0300
+++ b/widgets/widgetapp/src/WidgetUiWindowManager.cpp	Mon Jun 21 16:54:17 2010 +0300
@@ -68,6 +68,10 @@
 const TInt KOOMHarvesterNotificationTimeOut = 5000000;
 const TInt KOOMWidgetCloseTimeOut = 15;//Do not close the widget that was started after OOM within 15 sec
 
+#ifdef BRDO_OCC_ENABLED_FF
+const TInt KRetryConnectivityTimeout( 2*1000*1000 ); // 2 seconds
+#endif
+
 class CRequestRAM : public CActive
     {
 public: 
@@ -187,6 +191,12 @@
     iCenrepNotifyHandler = CCenrepNotifyHandler::NewL( *this );
     iNetworkListener = CWidgetUiNetworkListener::NewL( *this );
 #endif
+    
+#ifdef BRDO_OCC_ENABLED_FF
+    iConnStageNotifier = CConnectionStageNotifierWCB::NewL();
+    iConnStageNotifier->SetPriority(CActive::EPriorityHigh);
+    iRetryConnectivity = CPeriodic::NewL(CActive::EPriorityStandard);
+#endif
     }
 
 // -----------------------------------------------------------------------------
@@ -246,6 +256,14 @@
     delete iCpsPublisher;
 #endif
     delete iDb;
+#ifdef BRDO_OCC_ENABLED_FF 
+    if ( iRetryConnectivity)
+        {
+        iRetryConnectivity->Cancel();
+        delete iRetryConnectivity;
+        iRetryConnectivity = NULL;
+        }
+#endif
     }
 
 // -----------------------------------------------------------------------------
@@ -395,34 +413,40 @@
             iNetworkMode = EOfflineMode;
             CWidgetUiWindow* wdgt_window( GetWindow( aUid ) );
             if (wdgt_window)
-            	{
+                {
 #ifdef BRDO_WRT_HS_FF
-                if ( wdgt_window->NetworkModeWait()->IsStarted() )
-                    {
-                    wdgt_window->NetworkModeWait()->AsyncStop();
-                    }
+                 if ( wdgt_window->NetworkModeWait()->IsStarted() )
+                     {
+                     wdgt_window->NetworkModeWait()->AsyncStop();
+                     }
 #endif
+                 if ( iConnection->Connected())
+                     {
+                     for ( TInt i = 0; i < iWindowList.Count(); i++ )
+                         {
+                         CWidgetUiWindow* window = iWindowList[i];
+                         if ( window && 
+                     	       (window->WidgetMiniViewState() == EPublishStart ||
+                     	       window->WidgetMiniViewState() == EPublishSuspend) 
+                     	      )
+                             //Send cancelFetch to all windows
+                             TRAP_IGNORE( window->Engine()->HandleCommandL( 
+                                (TInt)TBrCtlDefs::ECommandIdBase +
+                                (TInt)TBrCtlDefs::ECommandCancelFetch ) );
+                         }
+                     TRAP_IGNORE( wdgt_window->Engine()->HandleCommandL( 
+                        (TInt)TBrCtlDefs::ECommandIdBase +
+                        (TInt)TBrCtlDefs::ECommandDisconnect ) );                     
+                      }
                 // if no full view widgets open, then close the network connection
-                if ( ( !FullViewWidgetsOpen() ) && ( iConnection->Connected() ) )
+                if ( !FullViewWidgetsOpen() && iConnection->Connected() )
                     {
-                    TRAP_IGNORE( wdgt_window->Engine()->HandleCommandL( 
-                            (TInt)TBrCtlDefs::ECommandIdBase +
-                            (TInt)TBrCtlDefs::ECommandCancelFetch ) );
-                    
-                    wdgt_window->Engine()->HandleCommandL( 
-                            (TInt)TBrCtlDefs::ECommandIdBase +
-                            (TInt)TBrCtlDefs::ECommandDisconnect );
-                    iConnection->CancelConnection();
-                    iConnection->StopConnectionL();
+
+                     iConnection->StopConnectionL();
 #ifdef BRDO_OCC_ENABLED_FF                    
-                    for ( TInt i = 0; i < iWindowList.Count(); i++ )
-        				{
-        				CWidgetUiWindow* window = iWindowList[i];
-        				//send to all windows
-                    	window->StopConnectionObserving();
-                    	}
-#endif                    	
-                    }
+                     StopConnectionObserving();
+#endif
+                   }
                 if(wdgt_window->IsWidgetLoaded())
                     wdgt_window->DetermineNetworkState();
                 else
@@ -711,12 +735,8 @@
         {
         if(aWidgetWindow->CanBeDeleted())
             {
-            TRAP_IGNORE( aWidgetWindow->Engine()->HandleCommandL( 
-                    (TInt)TBrCtlDefs::ECommandIdBase +
-                    (TInt)TBrCtlDefs::ECommandDisconnect ) );
-            iConnection->CancelConnection();
 #ifdef BRDO_OCC_ENABLED_FF            
-            aWidgetWindow->StopConnectionObserving();
+            StopConnectionObserving();
 #endif
             iConnection->StopConnectionL();
             delete aWidgetWindow;
@@ -737,11 +757,8 @@
                     }
                 }         
             if(!count && iNetworkMode == EOfflineMode){
-                aWidgetWindow->Engine()->HandleCommandL( 
-                (TInt)TBrCtlDefs::ECommandIdBase +
-                                (TInt)TBrCtlDefs::ECommandDisconnect );
 #ifdef BRDO_OCC_ENABLED_FF                                    
-                aWidgetWindow->StopConnectionObserving();
+                StopConnectionObserving();
 #endif
                 iConnection->StopConnectionL();
                 }             
@@ -1441,14 +1458,12 @@
                    (TInt)TBrCtlDefs::ECommandIdBase +
                    (TInt)TBrCtlDefs::ECommandCancelFetch ) ); 
            if(i == 0)
-               TRAP_IGNORE( window->Engine()->HandleCommandL( 
-                       (TInt)TBrCtlDefs::ECommandIdBase +
-                       (TInt)TBrCtlDefs::ECommandDisconnect ) );
-                       iConnection->CancelConnection();
+           	    {
 #ifdef BRDO_OCC_ENABLED_FF                       
-                       window->StopConnectionObserving();
+                StopConnectionObserving();
 #endif                       
-                       iConnection->StopConnectionL();
+                iConnection->StopConnectionL();
+                }
            delete window;  
            }  
    iWindowList.Reset();
@@ -1486,6 +1501,118 @@
     {
     iAppUi.Exit();
     }
+#ifdef BRDO_OCC_ENABLED_FF
+// -----------------------------------------------------------------------------
+// CWidgetUiWindowManager::ConnectionStageAchievedL()
+// -----------------------------------------------------------------------------
+//
+void CWidgetUiWindowManager::ConnectionStageAchievedL()
+    {
+    iConnection->Disconnect();
+    
+    TNifProgressBuf buf = iConnStageNotifier->GetProgressBuffer();
+    CWidgetUiWindow* window( iWindowList[0] );
+    if( buf().iError == KErrDisconnected )
+        {
+        TRAP_IGNORE( window->Engine()->HandleCommandL( (TInt)TBrCtlDefs::ECommandSetRetryConnectivityFlag + (TInt)TBrCtlDefs::ECommandIdBase ) );
+        SetRetryFlag(ETrue);    
+    
+        TRAP_IGNORE( window->Engine()->HandleCommandL( (TInt)TBrCtlDefs::ECommandCancelQueuedTransactions + (TInt)TBrCtlDefs::ECommandIdBase ) );
+    
+        if( iRetryConnectivity && iRetryConnectivity->IsActive())
+            {
+            iRetryConnectivity->Cancel();
+            }
+        iRetryConnectivity->Start(KRetryConnectivityTimeout, 0,TCallBack(RetryConnectivity,this));
+        }
+    else
+        {
+        TRAP_IGNORE( window->Engine()->HandleCommandL( (TInt)TBrCtlDefs::ECommandCancelFetch + (TInt)TBrCtlDefs::ECommandIdBase ) );
+        }
+    }  
+
+void CWidgetUiWindowManager::ConnNeededStatusL( TInt aErr )
+    {
+    StopConnectionObserving(); //Need to stop the connection observer first
+
+
+    if ( !iConnStageNotifier->IsActive() )
+        {
+        TName* connectionName = iConnection->ConnectionNameL();
+        CleanupStack::PushL( connectionName );
+
+        iConnStageNotifier->StartNotificationL(connectionName, KLinkLayerClosed, this);
+
+        CleanupStack::PopAndDestroy();  //connectionName
+        }
+    } 
+void CWidgetUiWindowManager::StopConnectionObserving()
+    {
+    
+    if ( iConnStageNotifier )
+        {
+        iConnStageNotifier->Cancel();
+        }
+    } 
+
+// -----------------------------------------------------------------------------
+// CWidgetUiWindow::SetRetryFlag
+// -----------------------------------------------------------------------------
+//
+void CWidgetUiWindowManager::SetRetryFlag(TBool flag)
+     {
+     reConnectivityFlag = flag;
+     }
+// -----------------------------------------------------------------------------
+// CWidgetUiWindow::RetryConnectivity
+// -----------------------------------------------------------------------------
+//
+TInt CWidgetUiWindowManager::RetryConnectivity(TAny* aWindowManager)
+    {
+
+    TInt err = ((CWidgetUiWindowManager*)aWindowManager)->RetryInternetConnection();
+    return err;
+    }
+TInt CWidgetUiWindowManager::RetryInternetConnection()
+    {
+    //First cancel the timer
+    if ( iRetryConnectivity && iRetryConnectivity->IsActive() )
+    {
+        iRetryConnectivity->Cancel();
+    }
+    TInt err = KErrNone;
+    if ( !iConnection->Connected() )
+       {
+       TRAP_IGNORE( err = iConnection->StartConnectionL( ETrue ) );
+       }
+    CWidgetUiWindow* window( iWindowList[0] );
+    if( err == KErrNone )
+       { 
+   
+       TRAP_IGNORE( window->Engine()->HandleCommandL( (TInt)TBrCtlDefs::ECommandUnSetRetryConnectivityFlag + (TInt)TBrCtlDefs::ECommandIdBase ) );
+       SetRetryFlag(EFalse);
+       
+       TRAP_IGNORE(ConnNeededStatusL(err)); //Start the observer again
+       TRAP_IGNORE( window->Engine()->HandleCommandL( (TInt)TBrCtlDefs::ECommandRetryTransactions + (TInt)TBrCtlDefs::ECommandIdBase ) );
+       }
+    else
+        {
+        TRAP_IGNORE( window->Engine()->HandleCommandL( (TInt)TBrCtlDefs::ECommandUnSetRetryConnectivityFlag + (TInt)TBrCtlDefs::ECommandIdBase ) );
+        SetRetryFlag(EFalse);
+        TRAP_IGNORE(window->Engine()->HandleCommandL( (TInt)TBrCtlDefs::ECommandClearQuedTransactions + (TInt)TBrCtlDefs::ECommandIdBase ) );
+        }
+    
+    return err;
+    }
+// -----------------------------------------------------------------------------
+// CWidgetUiWindowManager::GetRetryFlag
+// -----------------------------------------------------------------------------
+//
+ TBool CWidgetUiWindowManager::GetRetryFlag()
+      {
+      return reConnectivityFlag;
+      } 
+#endif // BRDO_OCC_ENABLED_FF
 
 CRequestRAM::CRequestRAM(CWidgetUiWindowManager* aWidgetUiWindowManager, const TUid& aUid, TUint32 aOperation):
     CActive( EPriorityStandard ),
@@ -1576,12 +1703,14 @@
     }    
 void CWidgetUiWindowManager::CenrepChanged(TInt aHSModeOnline)
     {
-    for ( TInt i = 0; i < iWindowList.Count(); i++ )
+    if(iWindowList.Count())
         {
-        CWidgetUiWindow* window = iWindowList[i];
-        if( window &&  window->WidgetMiniViewState() == EPublishSuspend )
+        CWidgetUiWindow* window = iWindowList[0];
+        if( window &&
+        	(window->WidgetMiniViewState() == EPublishStart ||
+          window->WidgetMiniViewState() == EPublishSuspend) )
             {
-            if ( window->NetworkModeWait()->IsStarted() )
+            if ( window->NetworkModeWait()->IsStarted() &&  window->WidgetMiniViewState() == EPublishSuspend)
                 {
                 window->NetworkModeWait()->AsyncStop();
                 }
@@ -1591,30 +1720,37 @@
 		            }
 		        else
 		  	        {
-		  	        iNetworkMode = EOfflineMode;	
-		  	        if ( ( !FullViewWidgetsOpen() ) && ( iConnection->Connected() ) )
-                    {
-                    TRAP_IGNORE( window->Engine()->HandleCommandL( 
-                                (TInt)TBrCtlDefs::ECommandIdBase +
-                                (TInt)TBrCtlDefs::ECommandCancelFetch ) );
-                    
-                         window->Engine()->HandleCommandL( 
-                                (TInt)TBrCtlDefs::ECommandIdBase +
-                                (TInt)TBrCtlDefs::ECommandDisconnect );
-                    iConnection->CancelConnection();
-#ifdef BRDO_OCC_ENABLED_FF                    
-					window->StopConnectionObserving();
-#endif
-                    iConnection->StopConnectionL();
+		  	        iNetworkMode = EOfflineMode;
+		  	        
+		  	        if ( iConnection->Connected() )
+		  	            {
+                        for ( TInt i = 0; i < iWindowList.Count(); i++ )
+                            {
+                            CWidgetUiWindow* wdg_window = iWindowList[i];
+                            //send CancelFetch to all windows
+                            TRAP_IGNORE( window->Engine()->HandleCommandL( 
+                                    (TInt)TBrCtlDefs::ECommandIdBase +
+                                    (TInt)TBrCtlDefs::ECommandCancelFetch ) );
+                            }                        
+                        TRAP_IGNORE( window->Engine()->HandleCommandL( 
+                                 (TInt)TBrCtlDefs::ECommandIdBase +
+                                 (TInt)TBrCtlDefs::ECommandDisconnect ) );                        
+                        }
                     }
-		  	        }
-		  	    if(window->IsWidgetLoaded())
+            if(window->IsWidgetLoaded())
                 window->DetermineNetworkState();
             else
                 window->NeedToNotifyNetworkState(ETrue);
         
             }
         }
+      if ( ( !FullViewWidgetsOpen() ) && iConnection->Connected() && iNetworkMode == EOfflineMode)
+          {          
+#ifdef BRDO_OCC_ENABLED_FF                    
+          StopConnectionObserving();
+#endif
+          iConnection->StopConnectionL();
+          }
   }