Revision: 201023 RCL_3 PDK_3.0.1
authorDremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Mon, 21 Jun 2010 15:43:41 +0300
branchRCL_3
changeset 43 b149f0820e5a
parent 41 aead3f7e1bb0
child 45 5a044f6358c2
Revision: 201023 Kit: 2010125
browserui/browser/BrowserAppInc/ApiProvider.h
browserui/browser/BrowserAppInc/BrowserAppUi.h
browserui/browser/BrowserAppInc/BrowserWindow.h
browserui/browser/BrowserAppSrc/BrowserAppUi.cpp
browserui/browser/BrowserAppSrc/BrowserContentView.cpp
browserui/browser/BrowserAppSrc/BrowserWindow.cpp
browserui/browser/FavouritesInc/BrowserBookmarksView.h
browserui/browser/FavouritesInc/BrowserFaviconHandler.h
browserui/browser/FavouritesInc/BrowserFavouritesListbox.h
browserui/browser/FavouritesSrc/BrowserBookmarksView.cpp
browserui/browser/FavouritesSrc/BrowserFaviconHandler.cpp
browserui/browser/FavouritesSrc/BrowserFavouritesContainer.cpp
browserui/browser/FavouritesSrc/BrowserFavouritesListbox.cpp
browserui/browser/FavouritesSrc/BrowserFavouritesView.cpp
browserui/browser/SrcData/bookmark_toolbar.rssi
--- a/browserui/browser/BrowserAppInc/ApiProvider.h	Wed Jun 09 09:45:02 2010 +0300
+++ b/browserui/browser/BrowserAppInc/ApiProvider.h	Mon Jun 21 15:43:41 2010 +0300
@@ -397,6 +397,14 @@
 		* @param none
 		*/		        
 		virtual TBool IsDisplayingMenuOrDialog() = 0;
+		
+		/**
+		* API to complete the delayed UI initialization. Invoked once after first view is up.
+		* @return ETrue if successful
+		*         EFalse otherwise
+		* @param none
+		*/
+	    virtual TBool CompleteDelayedInit() = 0;
 
 };
 
--- a/browserui/browser/BrowserAppInc/BrowserAppUi.h	Wed Jun 09 09:45:02 2010 +0300
+++ b/browserui/browser/BrowserAppInc/BrowserAppUi.h	Mon Jun 21 15:43:41 2010 +0300
@@ -672,6 +672,14 @@
 		* @param none
 		*/		
 		TBool IsDisplayingMenuOrDialog();
+
+		/**
+		* Function to complete the delayed intialization of Browser
+		* @return ETrue if initialization was successful
+		*         EFalse otherwise
+		* @param none
+		*/	
+        TBool CompleteDelayedInit();  
 		        
         
     public:  // from MWindowInfoProvider
@@ -684,10 +692,22 @@
 		* In embedded mode the browser is initialized later, not when it
 		* is constructed. First the browser must wait for the embedding
 		* application to send the startup parameters, and only after that
-		* can be initialized.
-		* This method is required and used by new embedding architecture.
-		*/
-		void InitBrowserL();
+		* can be initialized. This method is required and used by new
+		* embedding architecture.
+		*/       
+		void InitBrowserL(); 
+		
+        /* This method is used for normal startup and when the first view is Bookmarks. 
+         * In order to show the Bookmarks view, initialize only bookmarks and delay the
+         * remaining initialization. 
+         */
+		void InitBookmarksL();
+		
+        /* This method is used for normal startup and when the first view is Bookmarks. 
+         * This method includes intialization stuff which are not necessary for Bookmarks
+         * view. This is done using async CIdle approach. 
+         */
+		void DelayedInitL();		
 		
         /**
         * From CAknViewAppUi, CEikAppUi
--- a/browserui/browser/BrowserAppInc/BrowserWindow.h	Wed Jun 09 09:45:02 2010 +0300
+++ b/browserui/browser/BrowserAppInc/BrowserWindow.h	Mon Jun 21 15:43:41 2010 +0300
@@ -278,7 +278,7 @@
         TBool CalledFromAnotherApp();
 		TBool BrowserWasLaunchedIntoFeeds();
 		TBool IsDisplayingMenuOrDialog();
-	
+		TBool CompleteDelayedInit();
 
     //-------------------------------------------------------------------------
     // Preferences Handling
--- a/browserui/browser/BrowserAppSrc/BrowserAppUi.cpp	Wed Jun 09 09:45:02 2010 +0300
+++ b/browserui/browser/BrowserAppSrc/BrowserAppUi.cpp	Mon Jun 21 15:43:41 2010 +0300
@@ -162,7 +162,8 @@
 iPgNotFound( EFalse ),
 iOverriddenLaunchContextId( EBrowserContextIdNormal ),
 iBrowserAlreadyRunning (EFalse),
-iCalledFromExternApp( EFalse )
+iCalledFromExternApp( EFalse ),
+iFeedsClientUtilities( 0 )
     {
     iViewToBeActivatedIfNeeded.iUid = 0;
     iViewToReturnOnClose.iUid = 0;
@@ -290,7 +291,11 @@
 #endif
     if ( !IsEmbeddedModeOn( ) )
     	{
-    	InitBrowserL();
+#ifdef BRDO_PERF_IMPROVEMENTS_ENABLED_FF     
+        InitBookmarksL();
+#else
+        InitBrowserL();
+#endif        
     	LOG_WRITE( "Browser started standalone" );
     	}
 	else
@@ -446,250 +451,242 @@
     LOG_WRITE( "CBrowserAppUi::UpdateComplete - Exit" );
     }
 #endif
+
+
 // -----------------------------------------------------------------------------
-// CBrowserAppUi::InitBrowser()
+// CBrowserAppUi::InitBookmarksL()
+// Initialize only bookmarks view related dependencies here.
+// Note - Do not add unnecessary code here, it increases startup time for bookmarks view.
 // -----------------------------------------------------------------------------
 //
-void CBrowserAppUi::InitBrowserL()
+void CBrowserAppUi::InitBookmarksL()
+    {  
+    //New constructor that just replaces the default primary storage size with this one.
+    iRecentUrlStore = CRecentUrlStore::NewL();
+
+    // Init CommsModel
+    iCommsModel = CBrowserCommsModel::NewL();
+
+    // check if it can be delayed ??
+#ifdef BRDO_OCC_ENABLED_FF
+    iConnection = CInternetConnectionManager::NewL( &iCommsModel->CommsDb(), ETrue );
+#else
+    iConnection = CInternetConnectionManager::NewL( &iCommsModel->CommsDb(), EFalse );
+#endif    
+
+    // Creating object to hold application settings
+    CBrowserAppDocument* doc = STATIC_CAST(CBrowserAppDocument*, Document());    
+    iPreferences = CBrowserPreferences::NewL( *iCommsModel, *this, doc->GetOverriddenSettings());
+    
+    // Create bookmarkview
+     CBrowserBookmarksView* bookmarksView = NULL;
+     TInt folderUid = doc->GetFolderToOpen();
+     if ( IsEmbeddedModeOn() && folderUid!= KFavouritesRootUid)
+         {
+         bookmarksView = CBrowserBookmarksView::NewLC( *this, *iRecentUrlStore, folderUid );
+         }
+     else
+         {
+         bookmarksView = CBrowserBookmarksView::NewLC( *this, *iRecentUrlStore );
+         }
+
+     iBookmarksView = bookmarksView;
+     AddViewL( bookmarksView );  // transfer ownership to CAknViewAppUi    
+     CleanupStack::Pop(); // bookmarksView	           
+    }
+
+
+// -----------------------------------------------------------------------------
+// CBrowserAppUi::CompleteDelayedInit()
+// Delayed (async) init callback. This method can be invoked explicitly in case
+// some early startup cases fail if Browser has not initialized fully. No harm
+// if called multiple times since there is check in the beginning of thsi function.
+// -----------------------------------------------------------------------------
+//
+TBool CBrowserAppUi::CompleteDelayedInit()
+    { 
+    // Should not be called for other that 9.2 onward devices
+#ifdef BRDO_PERF_IMPROVEMENTS_ENABLED_FF
+    if ( iStartedUp )
+        return EFalse; // no need to re-invoke automatically
+    // complete initialization
+    TRAP_IGNORE(DelayedInitL());
+    
+#ifdef BRDO_IAD_UPDATE_ENABLED_FF
+    // complete the IAD check asynchronously
+    iDelayedUpdate = CIdle::NewL( CActive::EPriorityIdle );
+    iDelayedUpdate->Start(TCallBack( CompleteIADUpdateCallback, this ));
+#endif    
+#endif    
+    
+    return EFalse; // no need to re-invoke automatically
+    }
+
+// -----------------------------------------------------------------------------
+// CBrowserAppUi::DelayedInitL()
+// Delayed (Async) initialization - whatever remains after InitBookmarksL(), do it here. 
+// Note: - Do not add unnecessary code here, it increases startup time for contenview.
+// -----------------------------------------------------------------------------
+//
+void CBrowserAppUi::DelayedInitL()
     {
+    LOG_ENTERFN("CBrowserAppUi::DelayedInitL");
+    // Check for ciritical disk space
     RFs fs;
     User::LeaveIfError(fs.Connect());
     TInt drive( EDriveC );
     TBool isSpace( EFalse );
     TInt err( KErrNone );
-    TRAP( err, isSpace = !SysUtil::DiskSpaceBelowCriticalLevelL(
-                                                &fs,
-                                                KMinimumCDriveDiskSpace,
-                                                drive ));
+    TRAP( err, isSpace = !SysUtil::DiskSpaceBelowCriticalLevelL(&fs, KMinimumCDriveDiskSpace, drive ));
     fs.Close();
-    if (!isSpace)
-        User::Leave(KErrDiskFull);
-
-    if (!iStartedUp)
-        {
-        LOG_ENTERFN( "CBrowserAppUi::InitBrowser" );
-
-        User::LeaveIfError( iFavouritesSess.Connect() );
-
-        PERFLOG_LOCAL_INIT;
-
-        PERFLOG_STOPWATCH_START;
-
-        // Replace the original synchronous creation with this async
-        // creation. A new method was added to the interface stub that was
-        // not added to the MAHLEClientAPI (it is owned by another group).
-        //  // Init AHLE Interface
-        //  TAHLEScore adaptationSpeed;
-        //  TUint      primarySize;
-        //  TUint      secondarySize;
-        //  iAHLEClient=CAHLEInterface::NewL();
-        //  iAHLEClient->GetConfigurationL( primarySize, secondarySize, adaptationSpeed  );
-        //  iAHLEClient->ReconfigureL( KAhlePrimaryStorage, secondarySize, adaptationSpeed  );
-/*
-    // Write to the file only if we are not below critical disk level
-    if (SysUtil::DiskSpaceBelowCriticalLevelL (&rfs, aData.Length(), EDriveC))
+    if (!isSpace)  User::Leave(KErrDiskFull);
+
+    // Create Favengine session
+    User::LeaveIfError( iFavouritesSess.Connect() );
+        
+    // Init FeatureManager
+    FeatureManager::InitializeLibL();
+    iFeatureManager = ETrue;
+    
+    // check flash present
+    iFlashPresent = CheckFlashPresent();    
+
+    // this is required, browser's connection oberver should be hit first.
+	// (incase of netscape plgins, transactions will be closed.)
+    iConnStageNotifier = CConnectionStageNotifierWCB::NewL();    
+    iConnStageNotifier->SetPriority(CActive::EPriorityHigh);
+
+    // Starts a background processing, so it must be started early, to get
+    // finished before the first send operation! Or it must be synchronized!
+    iLateSendUi  = CIdle::NewL( CActive::EPriorityIdle );
+    iLateSendUi ->Start( TCallBack( DelayedSendUiConstructL, this ) );
+    
+    iHTTPSecurityIndicatorSupressed = iPreferences->HttpSecurityWarningsStatSupressed();
+    
+    // set AP to be a default one (for Push messages)
+    SetRequestedAP( Preferences().DefaultAccessPoint() );
+    
+    // Create ContentView
+    TRect rect = ClientRect();
+    CBrowserContentView* contentView = CBrowserContentView::NewLC( *this, rect );
+    AddViewL( contentView ); // transfer ownership to CAknViewAppUi
+    CleanupStack::Pop(); // contentView
+    
+    // proxy will handle dialog events through load observer
+    iDialogsProvider = CBrowserDialogsProvider::NewL( NULL);
+
+#ifdef __RSS_FEEDS
+    iFeedsClientUtilities = CFeedsClientUtilities::NewL( *this, *this );
+    BROWSER_LOG( ( _L("Feeds up.") ) );
+#endif //__RSS_FEEDS
+    
+    // Is Multiple Window feature suported?
+    if ( Preferences().UiLocalFeatureSupported( KBrowserMultipleWindows ) )
         {
-        User::Leave(KErrDiskFull);
-        }
-
-    TMemoryInfoV1Buf info;
-    UserHal::MemoryInfo( info );
-    TInt freeRamInBytes = 10*1024*1024;
-    TInt dataSize = iContext->iDataPtr.Length();
-    if( UserHal::MemoryInfo( info ) == KErrNone )
-        freeRamInBytes = info().iFreeRamInBytes;
-
-*/
-        //New constructor that just replaces the default primary storage size with this one.
-        iRecentUrlStore = CRecentUrlStore::NewL();
-
-        iFlashPresent = CheckFlashPresent();
-        PERFLOG_STOP_WRITE("\t AhleInterface Creation + Configuration");
-        BROWSER_LOG( ( _L( "AHLE Interface inited" ) ) );
-
-        // Init FeatureManager
-        FeatureManager::InitializeLibL();
-        iFeatureManager = ETrue;
-
-        // Init CommsModel
-
-        PERFLOG_STOPWATCH_START;
-        iCommsModel = CBrowserCommsModel::NewL();
-        PERFLOG_STOP_WRITE("\t CommsModel NewL");
-        BROWSER_LOG( ( _L( "CommsModel up" ) ) );
-
-        CBrowserAppDocument* doc = STATIC_CAST(CBrowserAppDocument*, Document());
-
-        // Creating object to hold application settings
-        PERFLOG_STOPWATCH_START;
-        iPreferences = CBrowserPreferences::NewL( *iCommsModel, *this, doc->GetOverriddenSettings());
-        PERFLOG_STOP_WRITE("\t Preferences NewL");
-        BROWSER_LOG( ( _L( "Preferences up" ) ) );
-
-        PERFLOG_STOPWATCH_START;
-        #ifdef BRDO_OCC_ENABLED_FF
-          iConnection = CInternetConnectionManager::NewL( &iCommsModel->CommsDb(), ETrue );
-        #else
-          iConnection = CInternetConnectionManager::NewL( &iCommsModel->CommsDb(), EFalse );
-        #endif
-        	
-        PERFLOG_STOP_WRITE("\t ConnMan NewL");
-        BROWSER_LOG( ( _L( "ConnectionManager up" ) ) );
-
-
-        PERFLOG_STOPWATCH_START;
-        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);
-
-        PERFLOG_STOP_WRITE("\t StageNotif NewL");
-        BROWSER_LOG( ( _L( "StageNofier up" ) ) );
-
-        // Starts a background processing, so it must be started early, to get
-        // finished before the first send operation! Or it must be synchronized!
-        PERFLOG_STOPWATCH_START;
-        iLateSendUi  = CIdle::NewL( CActive::EPriorityIdle );
-        iLateSendUi ->Start( TCallBack( DelayedSendUiConstructL, this ) );
-        PERFLOG_STOP_WRITE("\t OtaSender NewL");
-
-        iHTTPSecurityIndicatorSupressed = iPreferences->HttpSecurityWarningsStatSupressed();
-
-        // set AP to be a default one (for Push messages)
-        SetRequestedAP( Preferences().DefaultAccessPoint() );
-        // get client rect before hiding CBAs
-        TRect rect = ClientRect();
-        Cba()->MakeVisible( EFalse );
-        //-------------------------------------------------------------------------
-        // Create bookmarkview
-        PERFLOG_STOPWATCH_START;
-        CBrowserBookmarksView* bookmarksView = NULL;
-        TInt folderUid = doc->GetFolderToOpen();
-        if ( IsEmbeddedModeOn() && folderUid!= KFavouritesRootUid)
+        if (Preferences().UiLocalFeatureSupported( KBrowserMinimalMultipleWindows ))//midrange
             {
-            bookmarksView = CBrowserBookmarksView::NewLC( *this, *iRecentUrlStore, folderUid );
+            iWindowManager = CBrowserWindowManager::NewL( *this, *contentView, KMinNumOfOpenedWindows );
             }
         else
             {
-            bookmarksView = CBrowserBookmarksView::NewLC( *this, *iRecentUrlStore );
-            }
-        PERFLOG_STOP_WRITE("\t BMView NewL")
-
-        iBookmarksView = bookmarksView;
-
-        AddViewL( bookmarksView );  // transfer ownership to CAknViewAppUi
-        CleanupStack::Pop(); // bookmarksView
-        BROWSER_LOG( ( _L( "Bookmarksview up" ) ) );
-
-        //-------------------------------------------------------------------------
-        // Create ContentView
-
-        PERFLOG_STOPWATCH_START;
-        CBrowserContentView* contentView =
-            CBrowserContentView::NewLC( *this, rect );
-        AddViewL( contentView ); // transfer ownership to CAknViewAppUi
-        CleanupStack::Pop(); // contentView
-        PERFLOG_STOP_WRITE("\t ContentView NewL");
-        BROWSER_LOG( ( _L( "ContentView up" ) ) );
-
-        //-------------------------------------------------------------------------
-        // Create the Plugin Browser Engine
-
-        // proxy will handle dialog events through load observer
-        iDialogsProvider = CBrowserDialogsProvider::NewL( NULL);
-        BROWSER_LOG( ( _L( "CBrowserDialogsProvider UP" ) ) );
-
-#ifdef __RSS_FEEDS
-        iFeedsClientUtilities = CFeedsClientUtilities::NewL( *this, *this );
-
-        BROWSER_LOG( ( _L("Feeds up.") ) );
-#endif //__RSS_FEEDS
-
-        PERFLOG_STOPWATCH_START;
-        // Is Multiple Window feature suported?
-        if ( Preferences().UiLocalFeatureSupported( KBrowserMultipleWindows ) )
-            {
-            if (Preferences().UiLocalFeatureSupported( KBrowserMinimalMultipleWindows ))//midrange
-                {
-                iWindowManager = CBrowserWindowManager::NewL( *this, *contentView,
-                    KMinNumOfOpenedWindows );
-                }
-            else
-                {
-                iWindowManager = CBrowserWindowManager::NewL( *this, *contentView,
-                    KMaxNumOfOpenedWindows );
-                }
-            LOG_WRITE_FORMAT("WindowManager Up. Max windows number. %d",
-                KMaxNumOfOpenedWindows );            
-            }
-        else
-            {
-            iWindowManager = CBrowserWindowManager::NewL( *this, *contentView,
-                KMinNumOfOpenedWindows );
-            BROWSER_LOG( ( _L( "WindowManager Up. MWs not supported." ) ) );
+            iWindowManager = CBrowserWindowManager::NewL( *this, *contentView, KMaxNumOfOpenedWindows );
             }
-
-        PERFLOG_STOP_WRITE("\t WindowMgr + PopUp Engine");
-        contentView->SetZoomLevelL();
-
-        //-------------------------------------------------------------------------
-
-
-        CBrowserSettingsView* settingsView = CBrowserSettingsView::NewLC( *this );
-        AddViewL( settingsView );   // transfer ownership to CAknViewAppUi
-        CleanupStack::Pop(); // settingsView
-        BROWSER_LOG( ( _L( "SettingsView up" ) ) );
-
-        CBrowserWindowSelectionView* windowSelectionView = CBrowserWindowSelectionView::NewLC( *this );
-        AddViewL( windowSelectionView );   // transfer ownership to CAknViewAppUi
-        CleanupStack::Pop(); // windowSelectionView
-        BROWSER_LOG( ( _L( "windowSelectionView up" ) ) );
-
-        //-------------------------------------------------------------------------
-
-        iIdle = CIdle::NewL( CActive::EPriorityIdle );
-
-        // Create asyncronous object to call when exit requires it.
-        iBrowserAsyncExit = CBrowserAsyncExit::NewL( this );
-        iStartedUp = ETrue;
-        iSecureSiteVisited = EFalse;
-
-	    iPushMtmObserver = CBrowserPushMtmObserver::NewL( this );
-	    iPushMtmObserver->StartObserver();
-        // Create two Panes of CBrowserContentViewContainer
-        CBrowserGotoPane* gotoPane = CBrowserGotoPane::NewL( contentView->Container(),
-                 EMbmAvkonQgn_indi_find_goto,
-                 EMbmAvkonQgn_indi_find_goto_mask,
-                 ETrue,
-                 contentView );
-                          
-        // Create the find pane with magnifier glass icon, and
-        // without adaptive popup list...
-        CBrowserGotoPane* findKeywordPane = CBrowserGotoPane::NewL( contentView->Container(),
-                 EMbmAvkonQgn_indi_find_glass,
-                 EMbmAvkonQgn_indi_find_glass_mask,
-                 EFalse,
-                 contentView,
-                 ETrue );
-        contentView->Container()->SetGotoPane(gotoPane);
-        contentView->Container()->SetFindKeywordPane(findKeywordPane);
-        contentView->Container()->SetRect( rect );
-        contentView->Container()->GotoPane()->SetGPObserver(contentView);
-        contentView->Container()->FindKeywordPane()->SetGPObserver(contentView);
-        contentView->Container()->FindKeywordPane()->SetOrdinalPosition( 0 );
-        contentView->Container()->GotoPane()->SetOrdinalPosition( 0 );
-
+        LOG_WRITE_FORMAT("WindowManager Up. Max windows number. %d", KMaxNumOfOpenedWindows );            
+        }
+    else
+        {
+        iWindowManager = CBrowserWindowManager::NewL( *this, *contentView, KMinNumOfOpenedWindows );
+        BROWSER_LOG( ( _L( "WindowManager Up. MWs not supported." ) ) );
+        }
+    
+    contentView->SetZoomLevelL();
+    BrCtlInterface().AddLoadEventObserverL(iBookmarksView);        
+    
+    // create settings view
+    CBrowserSettingsView* settingsView = CBrowserSettingsView::NewLC( *this );
+    AddViewL( settingsView );   // transfer ownership to CAknViewAppUi
+    CleanupStack::Pop(); // settingsView
+    BROWSER_LOG( ( _L( "SettingsView up" ) ) );
+
+    // window selection view
+    CBrowserWindowSelectionView* windowSelectionView = CBrowserWindowSelectionView::NewLC( *this );
+    AddViewL( windowSelectionView );   // transfer ownership to CAknViewAppUi
+    CleanupStack::Pop(); // windowSelectionView
+    BROWSER_LOG( ( _L( "windowSelectionView up" ) ) );
+    
+    // Create asyncronous object to call when exit requires it.
+    iBrowserAsyncExit = CBrowserAsyncExit::NewL( this );
+    iIdle = CIdle::NewL( CActive::EPriorityIdle );
+    
+    iPushMtmObserver = CBrowserPushMtmObserver::NewL( this );
+    iPushMtmObserver->StartObserver();
+    
 #ifdef BRDO_OCC_ENABLED_FF
-        iRetryConnectivity = CPeriodic::NewL(CActive::EPriorityStandard);
+    iRetryConnectivity = CPeriodic::NewL(CActive::EPriorityStandard);
 #endif
-
+    
+    // Create two Panes of CBrowserContentViewContainer
+    CBrowserGotoPane* gotoPane = CBrowserGotoPane::NewL( contentView->Container(),
+             EMbmAvkonQgn_indi_find_goto,
+             EMbmAvkonQgn_indi_find_goto_mask,
+             ETrue,
+             contentView );
+                      
+    // Create the find pane with magnifier glass icon, and
+    // without adaptive popup list...
+    CBrowserGotoPane* findKeywordPane = CBrowserGotoPane::NewL( contentView->Container(),
+             EMbmAvkonQgn_indi_find_glass,
+             EMbmAvkonQgn_indi_find_glass_mask,
+             EFalse,
+             contentView,
+             ETrue );
+    contentView->Container()->SetGotoPane(gotoPane);
+    contentView->Container()->SetFindKeywordPane(findKeywordPane);
+    //contentView->Container()->SetRect( rect ); // causes suncRepaint
+    contentView->Container()->GotoPane()->SetGPObserver(contentView);
+    contentView->Container()->FindKeywordPane()->SetGPObserver(contentView);
+    contentView->Container()->FindKeywordPane()->SetOrdinalPosition( 0 );
+    contentView->Container()->GotoPane()->SetOrdinalPosition( 0 );
+    
+    iStartedUp = ETrue;           
+    iSecureSiteVisited = EFalse;
+    
+#ifdef BRDO_PERF_IMPROVEMENTS_ENABLED_FF
+    if(LastActiveViewId() == KUidBrowserBookmarksViewId)
+        {
+        iBookmarksView->CheckForDownloads();
+        iBookmarksView->UpdateFavIconsL();
+        }
+#endif    
+    }
+
+// -----------------------------------------------------------------------------
+// CBrowserAppUi::InitBrowserL() - THIS METHOD IS NOT USED FOR NORMAL STARTUP
+// This method is just for supporting Browser initialization if launched in Embedded mode
+// Normal initialization if split in BookmarksInit() and DelayedInit(). iStartedUp is FALSE
+// if BRowser has not initialized or partially initialized.
+// NOTE: DO NOT ADD ANY CODE HERE. IT IS JUST A WRAPPER.
+// -----------------------------------------------------------------------------
+//
+void CBrowserAppUi::InitBrowserL()
+    {
+    // Bookmarks initialization
+    InitBookmarksL();
+    
+    // 2nd part of initialization
+    DelayedInitL();
+    
 #ifdef BRDO_IAD_UPDATE_ENABLED_FF
-    iDelayedUpdate = CIdle::NewL( CActive::EPriorityIdle );
-    iDelayedUpdate->Start(TCallBack( CompleteIADUpdateCallback, this ));
+    // complete the IAD check asynchronously
+    if(!IsEmbeddedModeOn())
+        {
+        iDelayedUpdate = CIdle::NewL( CActive::EPriorityIdle );
+        iDelayedUpdate->Start(TCallBack( CompleteIADUpdateCallback, this ));
+        }
 #endif
-        } //if (iStartedUp)
     }
 
+
 // -----------------------------------------------------------------------------
 // CBrowserAppUi::ProcessCommandL(TInt aCommand)
 // -----------------------------------------------------------------------------
@@ -1183,6 +1180,11 @@
 //
 void CBrowserAppUi::FetchBookmarkL( TInt aBookmarkUid )
     {
+    // complete initialization if not done yet, can happen if user selects
+    // a bookmark quickly after launch (within 1 second)
+    if ( !iStartedUp )
+        CompleteDelayedInit();
+        
     SetViewToReturnOnClose( KUidBrowserBookmarksViewId );
     if ( aBookmarkUid == KFavouritesStartPageUid )
         {
@@ -1221,6 +1223,11 @@
 //
 void CBrowserAppUi::FetchBookmarkL( const CFavouritesItem& aBookmarkItem )
     {
+    // complete initialization if not done yet, can happen if user selects
+    // a bookmark quickly after launch (within 1 second)
+    if ( !iStartedUp )
+        CompleteDelayedInit();
+    
     SetViewToReturnOnClose( KUidBrowserBookmarksViewId );
     if ( Util::CheckBookmarkApL( *this, aBookmarkItem.WapAp()) )
         FetchL
@@ -1263,7 +1270,7 @@
 		ContentView()->SetFullScreenOffL();
 		}
 	
-	if ( iWindowManager->ContentView()->FullScreenMode() )
+	if ( iWindowManager && iWindowManager->ContentView()->FullScreenMode() )
 	    {
     	if ( aUid == KUidBrowserFeedsFeedViewId )
     	    {
@@ -1285,6 +1292,10 @@
 		{
         if ( aUid == KUidBrowserSettingsViewId )
 	        {
+            //complete initialisation 
+            if( !iStartedUp )
+                CompleteDelayedInit();
+
             CEikStatusPane* sp = STATIC_CAST( CAknAppUi*,
 						  CEikonEnv::Static()->EikAppUi() )
 			                ->StatusPane();
@@ -1353,11 +1364,10 @@
 void CBrowserAppUi::HandleForegroundEventL( TBool aForeground )
     {
     // Handle this event only if the browser is started up
-    if ( !StartedUp() )
-    	{
+    iIsForeground = IsForeground();
+    if (!iStartedUp)
     	return;
-    	}
-    iIsForeground = IsForeground();
+
     if( iIsForeground )
     	{
  	    if (iViewToBeActivatedIfNeeded.iUid)
@@ -1418,6 +1428,11 @@
                            CBrowserLoadObserver::TBrowserLoadUrlType aUrlType )
     {
 LOG_ENTERFN("CBrowserAppUi::FetchL");
+    
+    // complete the initialization if not done yet
+    if(!iStartedUp)
+        CompleteDelayedInit();
+    
     // Let's cancel the previous fetch if any
     if ( Fetching() )
 		{
@@ -1630,9 +1645,9 @@
 	TBool isStandAlone = !IsEmbeddedModeOn();
 	BROWSER_LOG( ( _L( " isStandAlone: %d" ), isStandAlone ) );
 
-	if( isStandAlone && aUserInitiated )
+	if(isStandAlone && aUserInitiated )
 	    {
-		if( !BrCtlInterface().OkToExit() )
+		if( iStartedUp && !BrCtlInterface().OkToExit() )
 		    {
 		    return;
 		    }
@@ -1670,7 +1685,7 @@
     if( ( IsEmbeddedInOperatorMenu() || IsEmbeddedModeOn() ) &&
             !ExitInProgress() &&
              ((LoadObserver().LoadUrlType() == CBrowserLoadObserver::ELoadUrlTypeEmbeddedBrowserWithUrl) ||
-              (LoadObserver().LoadUrlType() == CBrowserLoadObserver::ELoadUrlTypeOther)   ) )
+             (LoadObserver().LoadUrlType() == CBrowserLoadObserver::ELoadUrlTypeOther)   ) )
                // ELoadUrlTypeEmbeddedBrowserWithUrl is typical for load via Phonebook, MMS, OperatorMenu
                // ELoadUrlTypeOther is typical via Media download since those are via GotoPane entered urls
         {
@@ -1698,9 +1713,12 @@
     		iConnection->Disconnect();
 #ifdef __RSS_FEEDS
             BROWSER_LOG( ( _L( " iFeedsClientUtilities->DisconnectFeedsViewL()" ) ) );
+            if ( iFeedsClientUtilities )
+                {
             TRAP_IGNORE( iFeedsClientUtilities->DisconnectFeedsViewL() );
             //notify feeds engine to close the connection
             TRAP_IGNORE( iFeedsClientUtilities->DisconnectManualUpdateConnectionL() );
+                } 
 #endif
     		}
         if (SpecialLoadObserver().IsConnectionStarted()) 
@@ -1728,10 +1746,13 @@
             TRAP_IGNORE( SendDisconnectEventL() );
     		iConnection->Disconnect();
 #ifdef __RSS_FEEDS
+            if ( iFeedsClientUtilities )
+                {
     		BROWSER_LOG( ( _L( " iFeedsClientUtilities->DisconnectFeedsViewL()" ) ) );
     		TRAP_IGNORE( iFeedsClientUtilities->DisconnectFeedsViewL() );
     		//notify feeds engine to close the connection
 			TRAP_IGNORE( iFeedsClientUtilities->DisconnectManualUpdateConnectionL() );
+                }
 #endif
     		}
     	if (SpecialLoadObserver().IsConnectionStarted()) // If Connection request is in processing calling CAknAppUI::Exit() causes crash (JSAA-84RG9R)
@@ -2101,7 +2122,7 @@
     LOG_WRITE_FORMAT(" aCommand: %d", aCommand);
 
     // The browser is in embedded mode and it is not initialized yet
-    if ( !StartedUp() )
+    if ( IsEmbeddedModeOn() && !iStartedUp)
     	{
     	return EFalse;
     	}
@@ -2146,16 +2167,19 @@
 	            	{    
 	            	specialSchemeInHomePageAddress = ETrue;
 	            	SetLastActiveViewId(KUidBrowserBookmarksViewId);
+	            	SetViewToBeActivatedIfNeededL(KUidBrowserContentViewId, 0);
 	            	TRAPD( err, FetchL( ptr, CBrowserLoadObserver::ELoadUrlTypeOther ) );
 	            	}
 	            else
 	                {
+	                SetViewToBeActivatedIfNeededL(KUidBrowserContentViewId, 0);
                     StartFetchHomePageL();
 	            	}
     	        CleanupStack::PopAndDestroy( 3,buf );
     	        }
             else
             	{
+                SetViewToBeActivatedIfNeededL(KUidBrowserContentViewId, 0);
                 StartFetchHomePageL();
             	}
            
@@ -2262,6 +2286,11 @@
     CleanupStack::PopAndDestroy( params );
     CleanupStack::PushL( command );
 
+
+    // complete the delayed initialization if bookmarks view is not the first view
+    if(ViewToActivate != KUidBrowserBookmarksViewId && !iStartedUp)
+        CompleteDelayedInit();
+
 	//wait a while, contentview initializing itself
     WaitCVInit();
     switch ( command->Count() )
@@ -2293,7 +2322,9 @@
                     }
                 else  
                     {
+                    if (iStartedUp)
                     ContentView()->SetFullScreenOffL();
+
                     if ( !IsEmbeddedModeOn() )
                         {
                         SetLastActiveViewId( KUidBrowserBookmarksViewId );
@@ -2584,7 +2615,7 @@
 //
 void CBrowserAppUi::WaitCVInit()
     {
-    if( iParametrizedLaunchInProgress == 0 )
+    if( iParametrizedLaunchInProgress == 0 && iStartedUp)
         {
         iParametrizedLaunchInProgress = 1;
         iIdle->Cancel();
@@ -3855,7 +3886,7 @@
         if( activeView != NULL )
             {
             activeView->HandleClientRectChange();
-            if (activeView != ContentView())
+            if ( ContentView() && (activeView != ContentView()) )
                 {
                 ContentView()->HandleClientRectChange();
                 }
@@ -4199,6 +4230,10 @@
 void CBrowserAppUi::SendDisconnectEventL()
     {
     LOG_ENTERFN("CBrowserAppUi::SendDisconnectEventL");
+    
+    if(!iStartedUp)
+        return;
+        
     SpecialLoadObserver().CancelConnection();
     CArrayFixFlat<CWindowInfo*>* windows = iWindowManager->GetWindowInfoL( this );
     if( windows )
@@ -4220,13 +4255,7 @@
         
         CBrowserWindow* window = NULL;
         iWindowManager->Window( windows->At( 0 )->iWindowId, window );
-        
-        // Close session only once
-        if (window)
-            {
-            window->BrCtlInterface().HandleCommandL( (TInt)TBrCtlDefs::ECommandDisconnect + (TInt)TBrCtlDefs::ECommandIdBase );
-            }
-        
+                
         // delete the window items before deleting the array
         for( i=0; i<windows->Count(); ++i )
             delete windows->At( i );
@@ -4588,6 +4617,8 @@
 // ---------------------------------------------------------
 void CBrowserAppUi::StartFetchHomePageL(void)
     {
+    if(!iStartedUp)
+        CompleteDelayedInit();
     
     // There's a homepage to be launched so start in content view
     SetLastActiveViewId(KUidBrowserContentViewId);      	    	          
--- a/browserui/browser/BrowserAppSrc/BrowserContentView.cpp	Wed Jun 09 09:45:02 2010 +0300
+++ b/browserui/browser/BrowserAppSrc/BrowserContentView.cpp	Mon Jun 21 15:43:41 2010 +0300
@@ -983,6 +983,9 @@
     delete iTitle;
     iTitle = NULL;
     
+    ApiProvider().Display().FSPaneOnL( );
+    ApiProvider().Display().SetGPRSIndicatorOnL();
+    
     UpdateTitleL( ApiProvider() );
 
     ApiProvider().BrCtlInterface().MakeVisible(ETrue);
@@ -1097,7 +1100,7 @@
         }
 		
     if (Layout_Meta_Data::IsLandscapeOrientation() &&
-        (StatusPane() && StatusPane()->IsVisible()) && !Cba()->IsVisible())
+        (StatusPane() && StatusPane()->IsVisible()) && !Cba()->IsVisible() && IsForeground())
         {
         TRect screenRect;
         AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EScreen, screenRect);
--- a/browserui/browser/BrowserAppSrc/BrowserWindow.cpp	Wed Jun 09 09:45:02 2010 +0300
+++ b/browserui/browser/BrowserAppSrc/BrowserWindow.cpp	Mon Jun 21 15:43:41 2010 +0300
@@ -63,6 +63,10 @@
 // CBrowserWindow::NewLC()
 // -----------------------------------------------------------------------------
 //
+TBool CBrowserWindow::CompleteDelayedInit()
+    {    
+    }
+
 CBrowserWindow* CBrowserWindow::NewLC(
         TInt aWindowId,
         const TDesC* aTargetName,
--- a/browserui/browser/FavouritesInc/BrowserBookmarksView.h	Wed Jun 09 09:45:02 2010 +0300
+++ b/browserui/browser/FavouritesInc/BrowserBookmarksView.h	Mon Jun 21 15:43:41 2010 +0300
@@ -467,9 +467,26 @@
         * Dim or Un-dim Toolbar buttons.
         */
         void UpdateToolbarButtonsState();
+        
+        /**
+        * Check to show downloads.
+        */
+        void CheckForDownloads();
+
+        /**
+        * Initiates update for favicons
+        */
+        void UpdateFavIconsL();
 
     private:    // data
-
+        /**
+         * Callback for completing the Browser App init. Normally only
+         * BookmarksView is initialized first on startup. When bookmarks
+         * view is shown then this callback is scheduled to complete the
+         * remaining initialization. 
+         */
+        static TInt CompleteAppInitCallback( TAny* aApiProvider );        
+        
         /**
         * Uid of AP which is to be used for creating Start Page bookmark.
         */
@@ -548,7 +565,10 @@
         // Re-Entry Gate flag for Delete Bookmark routine
         TBool iHandleDeleteInProgress;
 
-
+        // Async callback object for delayed App init
+        CIdle *iAsyncComplete;
+        
+        TBool iShowDownlods;
 	};
 
 #endif
--- a/browserui/browser/FavouritesInc/BrowserFaviconHandler.h	Wed Jun 09 09:45:02 2010 +0300
+++ b/browserui/browser/FavouritesInc/BrowserFaviconHandler.h	Mon Jun 21 15:43:41 2010 +0300
@@ -106,7 +106,17 @@
         
         
         /**
-        * Initiates getting favicons for the favourites list
+        * Initiates decoding of favicons for the favourites list in browserengine.
+        * This will request icon database thread to start decoding requested icons in background.
+        * @param aFavItems a list of favourites items
+        */
+        void RequestFavicons( CFavouritesItemList* aFavItems );
+        
+        /**
+        * This is async fetch operation from engine. One icon at a time is fetched and asynchronously
+        * scaled. E.g. if there are 5 icons to be fetched, then this will cause the BitmapScaler to be
+        * Active for 5 times.
+        * overall fetching is Async 
         * @param aFavItems a list of favourites items
         */
         void StartGetFaviconsL( CFavouritesItemList* aFavItems );
--- a/browserui/browser/FavouritesInc/BrowserFavouritesListbox.h	Wed Jun 09 09:45:02 2010 +0300
+++ b/browserui/browser/FavouritesInc/BrowserFavouritesListbox.h	Mon Jun 21 15:43:41 2010 +0300
@@ -287,6 +287,12 @@
         * @param aRowIndex - index of row to be italicized 
         */
 		void ItalicizeRowItemL(TInt aRowIndex);
+		
+        /**
+        * Updates the favourites icons in the list. Initiates async operation
+        * to fetch and draw icons in background during idle time.  
+        */		
+		void UpdateFavIconsL();
 
 
     protected:  // Construct / destruct
@@ -333,6 +339,11 @@
         * returned state.
         */
         void CalcNewStateL( CFavouritesItemList& aNewItems );
+        
+        /**
+        * Callback for fetching and drawing favicons
+        */
+        static TInt UpdateFavIconsCallback( TAny* aParam );
 
 
     private:    // new methods: index <--> Uid conversion
@@ -454,6 +465,8 @@
         * Italicized font for setting listbox rows to italics font.
         */
         CFbsFont *iFontItalic;
+        
+        CIdle *iIconUpdateCallback;
 
 
     };
--- a/browserui/browser/FavouritesSrc/BrowserBookmarksView.cpp	Wed Jun 09 09:45:02 2010 +0300
+++ b/browserui/browser/FavouritesSrc/BrowserBookmarksView.cpp	Mon Jun 21 15:43:41 2010 +0300
@@ -125,7 +125,7 @@
     delete iItemsToMove;
     delete iCurrentOrder;
     delete iEnteredURL;
-    iEnteredURL = NULL;
+    delete iAsyncComplete;
 BROWSER_LOG( ( _L("delete iEnteredUrl 1") ) );
     iCursorPos = -1;
     }
@@ -930,7 +930,8 @@
         aRsk.setPair(EBrowserBookmarksCmdBack, R_BROWSER_BOOKMARKS_DYN_SK_TEXT_SOFTKEY_BACK);
 
         // OR, it could be exit under these conditions
-        if ( !iInAdaptiveBookmarksFolder && !ApiProvider().IsPageLoaded() && !ApiProvider().Fetching() )
+        if ( !ApiProvider().StartedUp() ||
+             (!iInAdaptiveBookmarksFolder && !ApiProvider().IsPageLoaded() && !ApiProvider().Fetching())  )
             {
             if ( iCurrentFolder == KFavouritesRootUid )
                 {
@@ -1125,6 +1126,7 @@
     //Make it true so that latest FavIcon db info is shown     
     iRefresh = ETrue;
 
+#ifndef BRDO_PERF_IMPROVEMENTS_ENABLED_FF
     Toolbar()->HideItem( EWmlCmdAddBookmark, ETrue , EFalse);
     
     //disable both the goto items and activate one of them depending on availability of search feature during bookmarks activation 
@@ -1139,6 +1141,7 @@
     
     Cba()->MakeVisible( EFalse);
     StatusPane()->MakeVisible( EFalse );
+#endif
     
     if (iPenEnabled)
         {
@@ -1175,6 +1178,10 @@
                     }
                 else if ( Container()->Listbox()->CurrentItem() )
                     {
+                    //complete remaining startup in Browser and then proceed
+                    if ( !ApiProvider().StartedUp() )
+                        ApiProvider().CompleteDelayedInit();
+                    
                     if ( Container()->Listbox()->CurrentItem()->IsItem())
                         {
                         ActivateCurrentBookmarkL();
@@ -1301,7 +1308,8 @@
 
 #endif                    
             // downloads
-            aMenuPane->SetItemDimmed( EWmlCmdDownloads, !ApiProvider().BrCtlInterface().BrowserSettingL( TBrCtlDefs::ESettingsNumOfDownloads ) );
+            if(ApiProvider().StartedUp())
+                aMenuPane->SetItemDimmed( EWmlCmdDownloads, !ApiProvider().BrCtlInterface().BrowserSettingL( TBrCtlDefs::ESettingsNumOfDownloads ) );
 
             // edit
             if ( !item || (iInAdaptiveBookmarksFolder && aState.IsEmpty() ))
@@ -1347,7 +1355,7 @@
         case R_GOTO_SUBMENU:
             {
             // back to page
-            if ( !ApiProvider().IsPageLoaded() && !ApiProvider().Fetching())
+            if ( !ApiProvider().StartedUp() || (!ApiProvider().IsPageLoaded() && !ApiProvider().Fetching()))
                 {
                 aMenuPane->SetItemDimmed( EWmlCmdBackToPage, ETrue );
                 }
@@ -2129,6 +2137,24 @@
     LOG_ENTERFN("CBrowserBookmarksView::DoActivateL");
     LOG_WRITE_FORMAT(" aCustomMessageId: %d", aCustomMessageId);
 
+#ifdef BRDO_PERF_IMPROVEMENTS_ENABLED_FF
+    // Quick activation for first time only to show bookmarks view fast
+    if(!ApiProvider().StartedUp()) 
+        {
+        CBrowserFavouritesView::DoActivateL( aPrevViewId, aCustomMessageId, aCustomMessage );
+        if ( aCustomMessageId == KUidCustomMsgDownloadsList )
+            {
+            iShowDownlods = ETrue;
+            // Show the downloads later since contentview has not initialized yet
+            }
+        
+        // complete remaining application launch process, aynchronously
+        iAsyncComplete  = CIdle::NewL( CActive::EPriorityIdle );
+        iAsyncComplete->Start( TCallBack( CompleteAppInitCallback, &iApiProvider ) );
+        return;
+        }
+#endif
+    
     Toolbar()->HideItem( EWmlCmdAddBookmark, EFalse , ETrue);
 
 #ifndef BRDO_SINGLE_CLICK_ENABLED_FF
@@ -2197,6 +2223,40 @@
     }
 
 // ----------------------------------------------------------------------------
+// CBrowserBookmarksView::CompleteAppInitCallback
+// ----------------------------------------------------------------------------
+//
+TInt CBrowserBookmarksView::CompleteAppInitCallback( TAny* aProvider )
+    {
+    MApiProvider  *apiProvider = STATIC_CAST(MApiProvider*, aProvider);
+    TBool result = apiProvider->CompleteDelayedInit();
+    return result;
+    }
+
+// ----------------------------------------------------------------------------
+// CBrowserBookmarksView::UpdateFavIcons
+// ----------------------------------------------------------------------------
+//
+void CBrowserBookmarksView::UpdateFavIconsL()
+    {
+    Container()->Listbox()->UpdateFavIconsL();
+    }
+
+
+// ----------------------------------------------------------------------------
+// CBrowserBookmarksView::CheckForDownloads
+// ----------------------------------------------------------------------------
+//
+void CBrowserBookmarksView::CheckForDownloads()
+    {
+    if(iShowDownlods)
+        {
+        if ( iDownloadsListExecuter == 0 )
+            iDownloadsListExecuter = new (ELeave) CAsyncDownloadsListExecuter( ApiProvider() );
+        iDownloadsListExecuter->Start();
+        }
+    }
+// ----------------------------------------------------------------------------
 // CBrowserBookmarksView::DoDeactivate
 // ----------------------------------------------------------------------------
 //
@@ -2208,7 +2268,8 @@
         }
     if ( !ApiProvider().ExitInProgress() )
         {
-        ApiProvider().BrCtlInterface().RemoveLoadEventObserver( this );
+        if ( ApiProvider().StartedUp() )
+            ApiProvider().BrCtlInterface().RemoveLoadEventObserver( this );
         }
     CBrowserFavouritesView::DoDeactivate();
     iManualItemMovingGoingOn = EFalse;
--- a/browserui/browser/FavouritesSrc/BrowserFaviconHandler.cpp	Wed Jun 09 09:45:02 2010 +0300
+++ b/browserui/browser/FavouritesSrc/BrowserFaviconHandler.cpp	Mon Jun 21 15:43:41 2010 +0300
@@ -121,6 +121,31 @@
 	}
 
 // ----------------------------------------------------------------------------
+// CBrowserFaviconHandler::RequestFavicons()
+// ----------------------------------------------------------------------------
+//      
+void CBrowserFaviconHandler::RequestFavicons( CFavouritesItemList* aFavItems )
+    {
+    TInt count = aFavItems->Count();
+    while(count)
+        {            
+            CFavouritesItem& item = *aFavItems->At( count - 1); // index starts from 0
+            CGulIcon *favIcon = NULL;           
+                        
+            // Request Favicon from Engine  - there should be new API for request, but no har to use it
+            if ( item.Url().Length() )
+                iFavicon = iApiProvider.BrCtlInterface().GetBitmapData(item.Url(), TBrCtlDefs::EBitmapFavicon );
+
+            if ( favIcon )
+                {                
+                delete iFavicon;
+                iFavicon = NULL;
+                }
+            count--;
+        }
+    }
+
+// ----------------------------------------------------------------------------
 // CBrowserFaviconHandler::StartGetFaviconsL()
 // ----------------------------------------------------------------------------
 //		
@@ -162,10 +187,7 @@
 			{
 			iWasLastItemFavicon = EFalse;
 			
-			CFavouritesItem& item = *iFavItems->At( iFavItemsCurrentIndex );
-			HBufC* url = HBufC::NewLC( item.Url().Length() );
-			url->Des().Copy( item.Url() );
-			
+			CFavouritesItem& item = *iFavItems->At( iFavItemsCurrentIndex );			
 			if ( iFavicon )
 				{
 				// Make sure ongoing scaling is cancelled (if any)
@@ -179,10 +201,9 @@
 			// Get Favicon from Engine
 			if ( item.Url().Length() )
 				{
-				iFavicon = iApiProvider.BrCtlInterface().GetBitmapData( 
-										*url, TBrCtlDefs::EBitmapFavicon );
+				iFavicon = iApiProvider.BrCtlInterface().GetBitmapData(item.Url(), TBrCtlDefs::EBitmapFavicon );
 				}
-            CleanupStack::PopAndDestroy();//url
+
 			// Asynchronously scales the favicon and stores it in an array
 			if ( iFavicon )
 				{
--- a/browserui/browser/FavouritesSrc/BrowserFavouritesContainer.cpp	Wed Jun 09 09:45:02 2010 +0300
+++ b/browserui/browser/FavouritesSrc/BrowserFavouritesContainer.cpp	Mon Jun 21 15:43:41 2010 +0300
@@ -291,8 +291,7 @@
 	{
     iView = &aView;
 
-	CAknNavigationControlContainer* naviPane =
-        iView->ApiProvider().Display().NaviPaneL();
+	//CAknNavigationControlContainer* naviPane = iView->ApiProvider().Display().NaviPaneL();
 
     CreateWindowL();
     SetMopParent( iView );
--- a/browserui/browser/FavouritesSrc/BrowserFavouritesListbox.cpp	Wed Jun 09 09:45:02 2010 +0300
+++ b/browserui/browser/FavouritesSrc/BrowserFavouritesListbox.cpp	Mon Jun 21 15:43:41 2010 +0300
@@ -107,6 +107,8 @@
     delete iIconIndexes;
     delete iItems;
     delete iNewState;
+    if(iIconUpdateCallback) iIconUpdateCallback->Cancel();
+    delete iIconUpdateCallback;
     
     if ( iFontItalic )
         {
@@ -144,7 +146,16 @@
     CleanupStack::PushL( aItems );
 
     // Get all favicons asynchronously by iteration on icon array
+    /* TODO: There should a callback from engine when favIcon are decode
+       otherwise it takes some redundant calls to engine in order to get 
+     the favIcons to UI. */
+#ifdef BRDO_PERF_IMPROVEMENTS_ENABLED_FF    
+    if(iApiProvider.StartedUp())
+        UpdateFavIconsL();
+#else
     iFaviconHandler->StartGetFaviconsL( aItems );
+#endif     
+
 
     // Get icon indexes into new list. Replace the existing
     // data only if successfully gotten. This ensures that they don't go out
@@ -188,6 +199,33 @@
     }
 
 // ---------------------------------------------------------
+// CBrowserFavouritesListbox::UpdateFavIcons
+// ---------------------------------------------------------
+//
+void CBrowserFavouritesListbox::UpdateFavIconsL()
+    {
+    if(iIconUpdateCallback)
+        iIconUpdateCallback->Cancel();
+    else 
+        iIconUpdateCallback = CIdle::NewL(CActive::EPriorityIdle);
+
+    iFaviconHandler->RequestFavicons(iItems);
+    iIconUpdateCallback->Start(TCallBack(UpdateFavIconsCallback, this));
+    }
+
+// ----------------------------------------------------------------------------
+// CBrowserBookmarksView::CompleteAppInitCallback
+// ----------------------------------------------------------------------------
+//
+TInt CBrowserFavouritesListbox::UpdateFavIconsCallback( TAny* aParam )
+    {
+    CBrowserFavouritesListbox  *favListBox = STATIC_CAST(CBrowserFavouritesListbox*, aParam);
+    TRAP_IGNORE( (favListBox->iFaviconHandler->StartGetFaviconsL(favListBox->iItems)) )
+    return EFalse;
+    }
+
+
+// ---------------------------------------------------------
 // CBrowserFavouritesListbox::DrawFavicons
 // ---------------------------------------------------------
 //
--- a/browserui/browser/FavouritesSrc/BrowserFavouritesView.cpp	Wed Jun 09 09:45:02 2010 +0300
+++ b/browserui/browser/FavouritesSrc/BrowserFavouritesView.cpp	Mon Jun 21 15:43:41 2010 +0300
@@ -19,6 +19,11 @@
 
 
 // INCLUDE FILES
+#include <aknappui.h>
+#include <akntitle.h>
+#include <eikenv.h>
+#include <eikspane.h>
+
 #include <aknsfld.h>
 #include <eikbtgpc.h>
 #include <eikmenub.h>
@@ -258,6 +263,7 @@
     iInitialFolder = iCurrentFolder;
     // Ap model cannot be created without opening it; so that's not done here.
     // DoActivateL / DoDecativateL does that.
+    Cba()->MakeVisible(EFalse); // avoid multiple redraws
     }
 
 // ---------------------------------------------------------
@@ -459,7 +465,7 @@
     iPreviousViewID = ApiProvider().LastActiveViewId( );
     ApiProvider().SetLastActiveViewId( Id() );
     ApiProvider().CommsModel().AddObserverL( *this );
-    iContainer = CreateContainerL();
+    iContainer = CreateContainerL(); // can this be created during construct ?
     iModel->AddObserverL( *this );
     AppUi()->AddToViewStackL( *this, iContainer );
 
@@ -489,7 +495,7 @@
             }
 
         iContainer->Listbox()->View()->SetDisableRedraw( redrawDisabled );
-        iContainer->Listbox()->DrawNow();
+        iContainer->Listbox()->DrawDeferred();
         }
     else
         {
@@ -509,11 +515,13 @@
         }
     iIsActivated = ETrue;
     
-    PERFLOG_STOPWATCH_START;
+#ifndef BRDO_PERF_IMPROVEMENTS_ENABLED_FF
+    // TODO: Remove this crapy refresh once favicon callback interface
+    // with engine is implemented. 
     if(!iFavViewRefresh)
          iFavViewRefresh  = CIdle::NewL( CActive::EPriorityIdle );
     iFavViewRefresh ->Start( TCallBack( RefeshFavoriteListBox, this ) );
-    PERFLOG_STOP_WRITE("\t Favourite view NewL");
+#endif    
     }
 
 
@@ -1106,7 +1114,17 @@
         if ( aFolder == KFavouritesRootUid )
             {
             UpdateNaviPaneL(); // remove NaviPane before setting title - SetTitleL redraws
-            ApiProvider().Display().SetTitleL( RootTitleResourceId() );
+            if(ApiProvider().StartedUp())
+                ApiProvider().Display().SetTitleL( RootTitleResourceId() );
+            else
+                {
+                // Set title to be page title
+                CEikStatusPane* sp = STATIC_CAST( CAknAppUi*, CEikonEnv::Static()->EikAppUi() )->StatusPane();
+                CAknTitlePane* title = STATIC_CAST( CAknTitlePane*, sp->ControlL( TUid::Uid( EEikStatusPaneUidTitle ) ) );
+                HBufC* name = CEikonEnv::Static()->AllocReadResourceLC( R_BROWSER_OPTION_BOOKMARKS );
+                title->SetTextL( *name );            
+                CleanupStack::PopAndDestroy();   // name
+                }
             }
         else
             {
@@ -1132,7 +1150,7 @@
         iCurrentFolder = aFolder;
         FillListboxL( aFolder, /*aKeepState=*/EFalse );
                 
-        Container()->Listbox()->ClearSelection();
+        Container()->Listbox()->ClearSelection(); // is it needed ?
         UpdateCbaL();
         UpdateNaviPaneL();
         }
@@ -1296,15 +1314,20 @@
         aknview->SetFindEmptyListState(ETrue);
         }
 
-    iContainer->SizeChanged();  // Needed to show/hide Find Pane!
+    if(ApiProvider().StartedUp())
+    	iContainer->SizeChanged();  // Needed to show/hide Find Pane!
     iCurrentFolder = aFolder;
 
     HighlightPreferredL();
     iContainer->HandleCursorChangedL( listbox );
     listbox->View()->SetDisableRedraw( redrawDisabled );
-    listbox->DrawNow();
-    UpdateCbaL();
-    UpdateNaviPaneL();
+    
+    if(ApiProvider().StartedUp())
+        {
+        listbox->DrawDeferred();
+        UpdateCbaL();
+        UpdateNaviPaneL();
+        }
     }
 
 // ----------------------------------------------------------------------------
--- a/browserui/browser/SrcData/bookmark_toolbar.rssi	Wed Jun 09 09:45:02 2010 +0300
+++ b/browserui/browser/SrcData/bookmark_toolbar.rssi	Mon Jun 21 15:43:41 2010 +0300
@@ -81,29 +81,7 @@
                         }
                     };
                 };
-            }, 
-           
-        TBAR_CTRL //Search Goto
-            {
-            type = EAknCtButton;
-            id = EWmlCmdGoToAddressAndSearch;     
-            control = AVKON_BUTTON
-                {
-                flags = 0;
-                states =
-                    {
-                    AVKON_BUTTON_STATE
-                        {
-                        txt     = "";  //Icon should always be visible instead of this
-                        helptxt = qtn_is_tooltip_goto_search;
-                        bmpfile = "\\Resource\\apps\\browser.mif";
-                        bmpid   = EMbmBrowserQgn_indi_browser_tb_goto_and_search;         
-                        bmpmask = EMbmBrowserQgn_indi_browser_tb_goto_and_search_mask;
-                        extension = r_browser_ext_qgn_indi_browser_tb_goto_and_search;
-                        }
-                    };
-                };
-            }, 
+            },            
 #ifdef BRDO_SINGLE_CLICK_ENABLED_FF	    
             TBAR_CTRL
                         {
@@ -149,9 +127,31 @@
                         }
                     };
                 };
-            }		
- #endif           
-        };
+            }	
+ #endif
+	,
+    TBAR_CTRL //Search Goto
+        {
+        type = EAknCtButton;
+        id = EWmlCmdGoToAddressAndSearch;     
+        control = AVKON_BUTTON
+            {
+            flags = 0;
+            states =
+                {
+                AVKON_BUTTON_STATE
+                    {
+                    txt     = "";  //Icon should always be visible instead of this
+                    helptxt = qtn_is_tooltip_goto_search;
+                    bmpfile = "\\Resource\\apps\\browser.mif";
+                    bmpid   = EMbmBrowserQgn_indi_browser_tb_goto_and_search;         
+                    bmpmask = EMbmBrowserQgn_indi_browser_tb_goto_and_search_mask;
+                    extension = r_browser_ext_qgn_indi_browser_tb_goto_and_search;
+                    }
+                };
+            };
+        }	
+      };
     }
 
 #else