browserui/browser/BrowserAppSrc/BrowserAppUi.cpp
changeset 10 4530440261a8
parent 1 57d5b8e231c4
child 11 16a119033e3e
equal deleted inserted replaced
5:e45c3f40ea5f 10:4530440261a8
   353         // set AP to be a default one (for Push messages)
   353         // set AP to be a default one (for Push messages)
   354         SetRequestedAP( Preferences().DefaultAccessPoint() );
   354         SetRequestedAP( Preferences().DefaultAccessPoint() );
   355         // get client rect before hiding CBAs
   355         // get client rect before hiding CBAs
   356         TRect rect = ClientRect();
   356         TRect rect = ClientRect();
   357         Cba()->MakeVisible( EFalse );
   357         Cba()->MakeVisible( EFalse );
       
   358         //-------------------------------------------------------------------------
       
   359         // Create bookmarkview
       
   360         PERFLOG_STOPWATCH_START;
       
   361         CBrowserBookmarksView* bookmarksView = NULL;
       
   362         TInt folderUid = doc->GetFolderToOpen();
       
   363         if ( IsEmbeddedModeOn() && folderUid!= KFavouritesRootUid)
       
   364             {
       
   365             bookmarksView = CBrowserBookmarksView::NewLC( *this, *iRecentUrlStore, folderUid );
       
   366             }
       
   367         else
       
   368             {
       
   369             bookmarksView = CBrowserBookmarksView::NewLC( *this, *iRecentUrlStore );
       
   370             }
       
   371         PERFLOG_STOP_WRITE("\t BMView NewL")
       
   372 
       
   373         iBookmarksView = bookmarksView;
       
   374 
       
   375         AddViewL( bookmarksView );  // transfer ownership to CAknViewAppUi
       
   376         CleanupStack::Pop(); // bookmarksView
       
   377         BROWSER_LOG( ( _L( "Bookmarksview up" ) ) );
   358 
   378 
   359         //-------------------------------------------------------------------------
   379         //-------------------------------------------------------------------------
   360         // Create ContentView
   380         // Create ContentView
   361 
   381 
   362         PERFLOG_STOPWATCH_START;
   382         PERFLOG_STOPWATCH_START;
   415         contentView->Container()->FindKeywordPane()->SetOrdinalPosition( 0 );
   435         contentView->Container()->FindKeywordPane()->SetOrdinalPosition( 0 );
   416         contentView->Container()->GotoPane()->SetOrdinalPosition( 0 );
   436         contentView->Container()->GotoPane()->SetOrdinalPosition( 0 );
   417 
   437 
   418         //-------------------------------------------------------------------------
   438         //-------------------------------------------------------------------------
   419 
   439 
   420         PERFLOG_STOPWATCH_START;
       
   421         CBrowserBookmarksView* bookmarksView = NULL;
       
   422         TInt folderUid = doc->GetFolderToOpen();
       
   423         if ( IsEmbeddedModeOn() && folderUid!= KFavouritesRootUid)
       
   424             {
       
   425             bookmarksView = CBrowserBookmarksView::NewLC( *this, *iRecentUrlStore, folderUid );
       
   426             }
       
   427         else
       
   428             {
       
   429             bookmarksView = CBrowserBookmarksView::NewLC( *this, *iRecentUrlStore );
       
   430             }
       
   431         PERFLOG_STOP_WRITE("\t BMView NewL")
       
   432 
       
   433         iBookmarksView = bookmarksView;
       
   434 
       
   435         AddViewL( bookmarksView );  // transfer ownership to CAknViewAppUi
       
   436         CleanupStack::Pop(); // bookmarksView
       
   437         BROWSER_LOG( ( _L( "Bookmarksview up" ) ) );
       
   438 
   440 
   439         CBrowserSettingsView* settingsView = CBrowserSettingsView::NewLC( *this );
   441         CBrowserSettingsView* settingsView = CBrowserSettingsView::NewLC( *this );
   440         AddViewL( settingsView );   // transfer ownership to CAknViewAppUi
   442         AddViewL( settingsView );   // transfer ownership to CAknViewAppUi
   441         CleanupStack::Pop(); // settingsView
   443         CleanupStack::Pop(); // settingsView
   442         BROWSER_LOG( ( _L( "SettingsView up" ) ) );
   444         BROWSER_LOG( ( _L( "SettingsView up" ) ) );
   443 
   445 
   444         CBrowserWindowSelectionView* windowSelectionView = CBrowserWindowSelectionView::NewLC( *this );
   446         CBrowserWindowSelectionView* windowSelectionView = CBrowserWindowSelectionView::NewLC( *this );
   445         AddViewL( windowSelectionView );   // transfer ownership to CAknViewAppUi
   447         AddViewL( windowSelectionView );   // transfer ownership to CAknViewAppUi
   446         CleanupStack::Pop(); // windowSelectionView
   448         CleanupStack::Pop(); // windowSelectionView
   447         BROWSER_LOG( ( _L( "windowSelectionView up" ) ) );
   449         BROWSER_LOG( ( _L( "windowSelectionView up" ) ) );
   448 
       
   449         CBrowserInitialView* initialView = CBrowserInitialView::NewLC( *this );
       
   450         AddViewL( initialView );   // transfer ownership to CAknViewAppUi
       
   451         CleanupStack::Pop(); // initialView
       
   452         BROWSER_LOG( ( _L( "initialView up" ) ) );
       
   453 
   450 
   454         //-------------------------------------------------------------------------
   451         //-------------------------------------------------------------------------
   455 
   452 
   456         iIdle = CIdle::NewL( CActive::EPriorityIdle );
   453         iIdle = CIdle::NewL( CActive::EPriorityIdle );
   457 
   454 
  1116 	        {
  1113 	        {
  1117 	        ActivateLocalViewL( iViewToBeActivatedIfNeeded );
  1114 	        ActivateLocalViewL( iViewToBeActivatedIfNeeded );
  1118 	        }
  1115 	        }
  1119 	    else
  1116 	    else
  1120 	        {
  1117 	        {
  1121 	        // LastActiveViewId() might return with 0!
  1118 	        TVwsViewId activeViewId;
  1122 	        TRAP_IGNORE( ActivateLocalViewL( LastActiveViewId() ) );
  1119 	        if( ( GetActiveViewId( activeViewId ) == KErrNone ) &&	        		
  1123 	        }    	
  1120 	            (  LastActiveViewId()  != activeViewId.iViewUid ) )
       
  1121 	             {
       
  1122 	             // LastActiveViewId() might return with 0!
       
  1123 	             TRAP_IGNORE( ActivateLocalViewL( LastActiveViewId() ) );
       
  1124 	             }
       
  1125 	        }
  1124     	}
  1126     	}
  1125 	iViewToBeActivatedIfNeeded.iUid = 0;    
  1127 	iViewToBeActivatedIfNeeded.iUid = 0;    
  1126     CAknViewAppUi::HandleForegroundEventL( aForeground );
  1128     CAknViewAppUi::HandleForegroundEventL( aForeground );
  1127             
  1129             
  1128     if( iIsForeground )
  1130     if( iIsForeground )
  1137         if( !Fetching() )
  1139         if( !Fetching() )
  1138             {
  1140             {
  1139             Display().StopProgressAnimationL();
  1141             Display().StopProgressAnimationL();
  1140             }
  1142             }
  1141         }
  1143         }
  1142     else if (ContentView()->FullScreenMode())
       
  1143 	    {
       
  1144 	    //Disable content view full screen mode if it goes to background
       
  1145     	ContentView()->EnableFullScreenModeL( EFalse);
       
  1146 	    }
       
  1147 
       
  1148 
  1144 
  1149     if (iWindowManager)
  1145     if (iWindowManager)
  1150         {
  1146         {
  1151         iWindowManager->SendCommandToAllWindowsL( iIsForeground
  1147         iWindowManager->SendCommandToAllWindowsL( iIsForeground
  1152             ? (TInt)TBrCtlDefs::ECommandAppForeground + (TInt)TBrCtlDefs::ECommandIdBase
  1148             ? (TInt)TBrCtlDefs::ECommandAppForeground + (TInt)TBrCtlDefs::ECommandIdBase
  1632 	            CleanupStack::PopAndDestroy(); //urlwoslash            	
  1628 	            CleanupStack::PopAndDestroy(); //urlwoslash            	
  1633             	}
  1629             	}
  1634                         
  1630                         
  1635             if (name && name->Length())
  1631             if (name && name->Length())
  1636             	{
  1632             	{
  1637             	iRecentUrlStore->SaveData(*url,*name);
  1633             	iRecentUrlStore->SaveDataL(*url,*name);
  1638             	}
  1634             	}
  1639             else
  1635             else
  1640             	{
  1636             	{
  1641             	if (url->Length() > KFavouritesMaxName)
  1637             	if (url->Length() > KFavouritesMaxName)
  1642                 	{
  1638                 	{
  1648                 	TPtr cnameDes = cname->Des();
  1644                 	TPtr cnameDes = cname->Des();
  1649 
  1645 
  1650                   	cnameDes.Append( cnameLeft );
  1646                   	cnameDes.Append( cnameLeft );
  1651                    	cnameDes.AppendFill( TChar(KDot),5 );   // '.....'
  1647                    	cnameDes.AppendFill( TChar(KDot),5 );   // '.....'
  1652                    	cnameDes.Append( cnameRight );
  1648                    	cnameDes.Append( cnameRight );
  1653                 	iRecentUrlStore->SaveData(*url,*cname);
  1649                 	iRecentUrlStore->SaveDataL(*url,*cname);
  1654                     CleanupStack::PopAndDestroy();//cname
  1650                     CleanupStack::PopAndDestroy();//cname
  1655                 	}
  1651                 	}
  1656                 else
  1652                 else
  1657             	    {
  1653             	    {
  1658             	    iRecentUrlStore->SaveData(*url,*url);
  1654             	    iRecentUrlStore->SaveDataL(*url,*url);
  1659             	    }
  1655             	    }
  1660             	}
  1656             	}
  1661             }
  1657             }
  1662         CleanupStack().PopAndDestroy(2); // url, name
  1658         CleanupStack().PopAndDestroy(2); // url, name
  1663         }
  1659         }
  1682             	TPtr cnameDes = cname->Des();
  1678             	TPtr cnameDes = cname->Des();
  1683 
  1679 
  1684               	cnameDes.Append( cnameLeft );
  1680               	cnameDes.Append( cnameLeft );
  1685                	cnameDes.AppendFill( TChar(KDot),5 );   // '.....'
  1681                	cnameDes.AppendFill( TChar(KDot),5 );   // '.....'
  1686                	cnameDes.Append( cnameRight );
  1682                	cnameDes.Append( cnameRight );
  1687             	iRecentUrlStore->SaveData(*url,*cname);
  1683             	iRecentUrlStore->SaveDataL(*url,*cname);
  1688                 CleanupStack::PopAndDestroy();//cname
  1684                 CleanupStack::PopAndDestroy();//cname
  1689             	}
  1685             	}
  1690             else
  1686             else
  1691         	    {
  1687         	    {
  1692         	    iRecentUrlStore->SaveData(*url,*url);
  1688         	    iRecentUrlStore->SaveDataL(*url,*url);
  1693         	    }
  1689         	    }
  1694             }
  1690             }
  1695         CleanupStack().PopAndDestroy(); // url
  1691         CleanupStack().PopAndDestroy(); // url
  1696         }
  1692         }
  1697     }
  1693     }
  2376     Display().StopProgressAnimationL();
  2372     Display().StopProgressAnimationL();
  2377 	if ( Fetching() )
  2373 	if ( Fetching() )
  2378 		{
  2374 		{
  2379                  CancelFetch();
  2375                  CancelFetch();
  2380 		}
  2376 		}
       
  2377     //Close the uploading dialog.
       
  2378     iDialogsProvider->UploadProgressNoteL(
       
  2379 	                0, 0, ETrue, (MBrowserDialogsProviderObserver *)this );
  2381 
  2380 
  2382     // SendDisconnectEventL();
  2381     // SendDisconnectEventL();
  2383     // not needed as by that point HTTPSession was already shutdown by executing disconnect menu option
  2382     // not needed as by that point HTTPSession was already shutdown by executing disconnect menu option
  2384     // will cause a crash when user tries to quickly reconnect right after disconnecting, as HTTP session
  2383     // will cause a crash when user tries to quickly reconnect right after disconnecting, as HTTP session
  2385     // is starting to initialize, while this call is trying to close it.
  2384     // is starting to initialize, while this call is trying to close it.