Revision: 201021 RCL_3
authorDremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Wed, 09 Jun 2010 09:45:02 +0300
branchRCL_3
changeset 58 aead3f7e1bb0
parent 56 3154c14a33db
child 60 b149f0820e5a
Revision: 201021 Kit: 2010123
browserui/browser/BrowserAppInc/BrowserAppUi.h
browserui/browser/BrowserAppInc/BrowserContentView.h
browserui/browser/BrowserAppInc/BrowserContentViewContainer.h
browserui/browser/BrowserAppSrc/BrowserAppUi.cpp
browserui/browser/BrowserAppSrc/BrowserContentView.cpp
browserui/browser/BrowserAppSrc/BrowserContentViewContainer.cpp
browserui/browser/BrowserAppSrc/BrowserGotoPane.cpp
--- a/browserui/browser/BrowserAppInc/BrowserAppUi.h	Tue May 25 12:45:31 2010 +0300
+++ b/browserui/browser/BrowserAppInc/BrowserAppUi.h	Wed Jun 09 09:45:02 2010 +0300
@@ -876,6 +876,13 @@
         * @return TBool.
         */
         TInt64 ReadUpdateFile();
+        
+        /**
+        * Callback function to complete the IAD udated check on CIdle::RunL
+        * @param None
+        * @return TBool.
+        */
+        static TInt CompleteIADUpdateCallback( TAny* aBrowserAppUi );
 #endif		    
 	protected:
 
@@ -1085,6 +1092,7 @@
         CIAUpdate* iUpdate;  
         CIAUpdateParameters* iParameters; 
         RFs iFs;
+        CIdle* iDelayedUpdate;
 #endif        
         TBool iCalledFromExternApp;
         TInt iWindowIdFromFromExternApp;
--- a/browserui/browser/BrowserAppInc/BrowserContentView.h	Tue May 25 12:45:31 2010 +0300
+++ b/browserui/browser/BrowserAppInc/BrowserContentView.h	Wed Jun 09 09:45:02 2010 +0300
@@ -639,6 +639,8 @@
         void ShowFsStatusPane(TBool aShow);
         
         void setFullScreenFlag(){ iWasContentFullScreenMode = iContentFullScreenMode; }
+		
+		void  CBrowserContentView::HandleStatusPaneCallBack();
         
     private:
 
@@ -704,7 +706,7 @@
         CPeriodic *iAutoFSPeriodic;
         CPeriodic *iIdlePeriodic;
         TBool iFullScreenBeforeEditModeEntry;
-
+        HBufC* iTitle;
     };
 
 #endif
--- a/browserui/browser/BrowserAppInc/BrowserContentViewContainer.h	Tue May 25 12:45:31 2010 +0300
+++ b/browserui/browser/BrowserAppInc/BrowserContentViewContainer.h	Wed Jun 09 09:45:02 2010 +0300
@@ -72,6 +72,16 @@
         */
 		CBrowserGotoPane* FindKeywordPane() { return iFindKeywordPane; } ;
 
+        /*
+         * set the iGotoPane 
+         */
+        void SetGotoPane(CBrowserGotoPane* aGotoPane) { iGotoPane = aGotoPane; };
+
+        /*
+         * set the iFindKeywordPane 
+         */
+        void SetFindKeywordPane(CBrowserGotoPane* aFindKeywordPane) { iFindKeywordPane = aFindKeywordPane; };
+
         /**
         * Shut down Goto URL editor.
         * @since Series 60 1.2
--- a/browserui/browser/BrowserAppSrc/BrowserAppUi.cpp	Tue May 25 12:45:31 2010 +0300
+++ b/browserui/browser/BrowserAppSrc/BrowserAppUi.cpp	Wed Jun 09 09:45:02 2010 +0300
@@ -177,6 +177,7 @@
     LOG_ENTERFN("CBrowserAppUi::~CBrowserAppUi");
 
 #ifdef BRDO_IAD_UPDATE_ENABLED_FF
+    delete iDelayedUpdate;
     iFs.Close();
 #endif
     
@@ -296,13 +297,7 @@
 		{
 		iStartedUp = EFalse;
 		LOG_WRITE( "Browser started embedded" );
-		}
-#ifdef BRDO_IAD_UPDATE_ENABLED_FF
-    User::LeaveIfError(iFs.Connect());
-    // Check updates from IAD, continue UI launching even if something fails there  
-    TRAP_IGNORE( CheckUpdatesL() );
-#endif
-        
+		}        
 PERFLOG_STOP_WRITE("BrowserUI::ConstructL");
 
     }
@@ -314,6 +309,7 @@
     {
     LOG_ENTERFN("CBrowserAppUi::CheckUpdatesL");
     LOG_WRITE( "CBrowserAppUi::CheckUpdatesL() entering" );
+    User::LeaveIfError(iFs.Connect());
     if ( FeatureManager::FeatureSupported( KFeatureIdIAUpdate ) )
         {
         LOG_WRITE( "CBrowserAppUi::CheckUpdatesL() IAD Update supported" );
@@ -635,8 +631,6 @@
 
         PERFLOG_STOP_WRITE("\t WindowMgr + PopUp Engine");
         contentView->SetZoomLevelL();
-        contentView->Container()->FindKeywordPane()->SetOrdinalPosition( 0 );
-        contentView->Container()->GotoPane()->SetOrdinalPosition( 0 );
 
         //-------------------------------------------------------------------------
 
@@ -662,9 +656,37 @@
 
 	    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 );
+
 #ifdef BRDO_OCC_ENABLED_FF
         iRetryConnectivity = CPeriodic::NewL(CActive::EPriorityStandard);
 #endif
+
+#ifdef BRDO_IAD_UPDATE_ENABLED_FF
+    iDelayedUpdate = CIdle::NewL( CActive::EPriorityIdle );
+    iDelayedUpdate->Start(TCallBack( CompleteIADUpdateCallback, this ));
+#endif
         } //if (iStartedUp)
     }
 
@@ -1681,8 +1703,22 @@
             TRAP_IGNORE( iFeedsClientUtilities->DisconnectManualUpdateConnectionL() );
 #endif
     		}
-        PrepareToExit();
-        Exit();
+        if (SpecialLoadObserver().IsConnectionStarted()) 
+            {
+            if ( iWindowManager ) 
+               {
+               BROWSER_LOG( ( _L( " iWindowManager->SetUserExit( iUserExit )" ) ) );
+               iWindowManager->SetUserExit( iUserExit );
+               }
+               delete iWindowManager;
+               BROWSER_LOG( ( _L( " User::Exit(KErrNone)" ) ) );
+               User::Exit(KErrNone);
+            }
+        else
+            {
+            PrepareToExit();
+            Exit();
+            }
     	}
     else
     	{
@@ -2728,6 +2764,11 @@
         BROWSER_LOG( ( _L( "CBrowserAppUi::RetryInternetConnection clear queued transactions " ) ) );
         TRAP_IGNORE( BrCtlInterface().HandleCommandL( (TInt)TBrCtlDefs::ECommandClearQuedTransactions + (TInt)TBrCtlDefs::ECommandIdBase ) );
         Display().StopProgressAnimationL(); //Stop Progress animation
+        if ( Fetching() )
+            {
+            BROWSER_LOG( ( _L( "CBrowserAppUi::RetryInternetConnection cancel fetch " ) ) );
+            CancelFetch();
+            }
         iDialogsProvider->UploadProgressNoteL(0, 0, ETrue, (MBrowserDialogsProviderObserver *)this ); //Close the uploading dialog.
         iDialogsProvider->CancelAll(); //connection has been lost, so cancel the authentication dialog.
         }
@@ -3403,7 +3444,7 @@
                 	{                         
                 	TRAP( err, homePgFound = Preferences().HomePageUrlL( ptr, ETrue ) );
                 	}
-                }
+                	}
             // we have a url to load
             if( err == KErrNone &&
                 homePgFound == KErrNone &&
@@ -4560,8 +4601,19 @@
         CloseContentViewL();
         }                
     }
+    
 #ifdef BRDO_IAD_UPDATE_ENABLED_FF
 // ---------------------------------------------------------
+// CBrowserAppUi::CompleteIADUpdateCallback
+// ---------------------------------------------------------
+TInt CBrowserAppUi::CompleteIADUpdateCallback( TAny* aBrowserAppUi )
+    {
+    TRAP_IGNORE( ((CBrowserAppUi*)aBrowserAppUi)->CheckUpdatesL() )
+    return KErrNone;
+    }
+
+
+// ---------------------------------------------------------
 // CBrowserAppUi::CheckUpdateFileAvailable
 // ---------------------------------------------------------
 TBool CBrowserAppUi::CheckUpdateFileAvailable()
--- a/browserui/browser/BrowserAppSrc/BrowserContentView.cpp	Tue May 25 12:45:31 2010 +0300
+++ b/browserui/browser/BrowserAppSrc/BrowserContentView.cpp	Wed Jun 09 09:45:02 2010 +0300
@@ -132,7 +132,8 @@
     iZoomMode(EFalse),
     iContentFullScreenMode( EFalse ),
     iIsPluginFullScreenMode( EFalse),
-    iWasContentFullScreenMode( EFalse )
+    iWasContentFullScreenMode( EFalse ),
+    iTitle( NULL )
     {
     iFindItemIsInProgress = EFalse;
     iWasInFeedsView = EFalse;
@@ -175,6 +176,7 @@
     delete iPeriodic;
     delete iAutoFSPeriodic;
     delete iIdlePeriodic;
+    delete iTitle;
     }
 
 
@@ -191,9 +193,6 @@
 
     iContainer = CBrowserContentViewContainer::NewL( this, ApiProvider() );
 
-    iContainer->SetRect( aRect );
-    iContainer->GotoPane()->SetGPObserver(this);
-    iContainer->FindKeywordPane()->SetGPObserver(this);
     iEnteredKeyword = NULL;
 
     // get the StatusPane pointer
@@ -972,7 +971,7 @@
         }
     else
         {
-        UpdateFullScreenL();
+        HandleStatusPaneCallBack();
         ApiProvider().SetLastActiveViewId(Id());
         }
 
@@ -980,6 +979,10 @@
 
     AppUi()->AddToViewStackL( *this, iContainer );
 
+    //Reset the title before updating the title in case of view activation
+    delete iTitle;
+    iTitle = NULL;
+    
     UpdateTitleL( ApiProvider() );
 
     ApiProvider().BrCtlInterface().MakeVisible(ETrue);
@@ -1030,35 +1033,35 @@
             {
             TBool sizeChangedCba = EFalse;
             TBool sizeChangedSP = EFalse;
-            TBool resIdChanged = EFalse;
-            TInt resId = StatusPane()->CurrentLayoutResId();
-
-            if ( Layout_Meta_Data::IsLandscapeOrientation() )
-                {
-                resIdChanged = resId != R_AVKON_STATUS_PANE_LAYOUT_USUAL;
-                StatusPane()->SwitchLayoutL(R_AVKON_STATUS_PANE_LAYOUT_USUAL);
-                }
-            else //Portrait
-                {
-                resIdChanged = resId != R_AVKON_STATUS_PANE_LAYOUT_SMALL;
-                StatusPane()->SwitchLayoutL(R_AVKON_STATUS_PANE_LAYOUT_SMALL);
-                }
-
+            
             if ( iContentFullScreenMode )
                 {
-                sizeChangedCba = Cba()->IsVisible();
+                SetContentContainerRect();
+                if (iPenEnabled)
+                    {
+					Toolbar()->SetToolbarVisibility( EFalse, EFalse );
+                    Toolbar()->MakeVisible( EFalse );
+                    }
+                if(Cba()->IsVisible())
+                {
                 Cba()->MakeVisible( EFalse );
                 UpdateCbaL();
-
+                }
                 if (!ApiProvider().Fetching())
                     {
-                    sizeChangedSP = StatusPane()->IsVisible();
-                    StatusPane()->MakeVisible( EFalse );
+                    if(StatusPane()->IsVisible())
+                        {
+                        sizeChangedSP = ETrue;
+                        StatusPane()->MakeVisible(EFalse);
+                        }
                     }
                 else
                     {
-                    sizeChangedSP = !StatusPane()->IsVisible();
-                    ShowFsStatusPane(ETrue);
+                    if(!StatusPane()->IsVisible())
+                        {
+                        sizeChangedSP = ETrue;
+                        ShowFsStatusPane(ETrue);
+                        }
                     }
                 }
             else
@@ -1071,14 +1074,13 @@
 
             ApiProvider().Display().FSPaneOnL( );
             ApiProvider().Display().SetGPRSIndicatorOnL();
+            
+            //Reset the title before updating the title in case of view activation
+            delete iTitle;
+            iTitle = NULL;
             UpdateTitleL(ApiProvider());
             ApiProvider().Display().RestoreTitleL();
             StatusPane()->ApplyCurrentSettingsL();
-            if ( resIdChanged || sizeChangedCba || sizeChangedSP  )
-                {
-                
-                SetContentContainerRect();
-                }
             }
         }
     }
@@ -1086,9 +1088,16 @@
 TRect CBrowserContentView::ResizeClientRect()
     {
     TRect clientRect = ClientRect();
-        
+	
+    if(iContentFullScreenMode &&  (Toolbar() && Toolbar()->IsVisible()) && Cba()->IsVisible()) 
+        {
+        TRect screenRect;
+        AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EApplicationWindow, screenRect);
+        clientRect = screenRect;
+        }
+		
     if (Layout_Meta_Data::IsLandscapeOrientation() &&
-         StatusPane()->IsVisible() && !Cba()->IsVisible())
+        (StatusPane() && StatusPane()->IsVisible()) && !Cba()->IsVisible())
         {
         TRect screenRect;
         AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EScreen, screenRect);
@@ -1859,7 +1868,12 @@
         TBrCtlDefs::EPageInfoTitle );
     if ( title && title->Length() )
         {
-        aApiProvider.Display().SetTitleL( title->Des() );
+            if( !iTitle || (iTitle && (iTitle->Des().Compare( title->Des())!= 0)))
+              {
+              delete iTitle;
+              iTitle = title->Des().AllocL();
+              aApiProvider.Display().SetTitleL( title->Des() );
+              }
         }
     else
         {
@@ -3159,11 +3173,6 @@
     TInt command( KErrNotFound );
     if ( aEnableFullScreen )
         {
-        if (iPenEnabled)
-            {
-            Toolbar()->SetToolbarVisibility( EFalse, EFalse );
-            Toolbar()->MakeVisible( EFalse );
-            }
         iContentFullScreenMode = ETrue;
         UpdateFullScreenL();
         command = TBrCtlDefs::ECommandEnterFullscreenBrowsing;
@@ -3431,4 +3440,30 @@
 	return  (retVal);
 	}
 
+void  CBrowserContentView::HandleStatusPaneCallBack()
+    {
+    TVwsViewId activeViewId;
+    TBool resIdChanged(EFalse);
+    TInt resId = StatusPane()->CurrentLayoutResId();
+
+    if ( AppUi()->GetActiveViewId( activeViewId ) == KErrNone )
+        {
+        if ( activeViewId.iViewUid == KUidBrowserContentViewId )
+            {
+            if ( Layout_Meta_Data::IsLandscapeOrientation() )
+                {
+                resIdChanged = resId != R_AVKON_STATUS_PANE_LAYOUT_USUAL;
+                StatusPane()->SwitchLayoutL(R_AVKON_STATUS_PANE_LAYOUT_USUAL);
+                }
+            else //Portrait
+                {
+                resIdChanged = resId != R_AVKON_STATUS_PANE_LAYOUT_SMALL;
+                StatusPane()->SwitchLayoutL(R_AVKON_STATUS_PANE_LAYOUT_SMALL);
+                }
+            }
+        }
+    if(resIdChanged)
+    SetContentContainerRect();
+}
+
 // End of File
--- a/browserui/browser/BrowserAppSrc/BrowserContentViewContainer.cpp	Tue May 25 12:45:31 2010 +0300
+++ b/browserui/browser/BrowserAppSrc/BrowserContentViewContainer.cpp	Wed Jun 09 09:45:02 2010 +0300
@@ -113,20 +113,6 @@
     SetAllowStrayPointers();
     SetMopParent( iView );
 
-    iGotoPane = CBrowserGotoPane::NewL( this,
-                                        EMbmAvkonQgn_indi_find_goto,
-                                        EMbmAvkonQgn_indi_find_goto_mask,
-                                        GOTOPANE_POPUPLIST_ENABLE,
-                                        iView );
-
-    // Create the find pane with magnifier glass icon, and
-    // without adaptive popup list...
-    iFindKeywordPane = CBrowserGotoPane::NewL( this,
-                                               EMbmAvkonQgn_indi_find_glass,
-                                               EMbmAvkonQgn_indi_find_glass_mask,
-                                               GOTOPANE_POPUPLIST_DISABLE,
-                                               iView,
-                                               ETrue );
     }
 
 // -----------------------------------------------------------------------------
@@ -650,7 +636,7 @@
         {
         if (!iView->FindItemIsInProgress())
             {
-            iView->UpdateFullScreenL();
+            iView->HandleStatusPaneCallBack();
             iApiProvider.Display().RestoreTitleL();
             }
 
--- a/browserui/browser/BrowserAppSrc/BrowserGotoPane.cpp	Tue May 25 12:45:31 2010 +0300
+++ b/browserui/browser/BrowserAppSrc/BrowserGotoPane.cpp	Wed Jun 09 09:45:02 2010 +0300
@@ -351,6 +351,9 @@
             // When the user copies and paste's content to the find dialog, the editor
             // is in Text Input mode, The engine should still get the find keyword request
             || iEditor->AknEditorCurrentInputMode() == EAknEditorTextInputMode
+            // Also Chinese and Japanese input modes should apply here
+            || iEditor->AknEditorCurrentInputMode() == EAknEditorFullWidthKatakanaInputMode 
+            || iEditor->AknEditorCurrentInputMode() == EAknEditorHiraganaInputMode 
             )
             {
             if ( aEventType == MCoeControlObserver::EEventStateChanged )