browserui/browser/BrowserAppSrc/BrowserAppUi.cpp
branchRCL_3
changeset 45 dbd79466b1ed
parent 37 481242ead638
child 46 5dedbccec665
equal deleted inserted replaced
41:d6c1cc3e4806 45:dbd79466b1ed
    37 #include <UriUtilsCommon.h>
    37 #include <UriUtilsCommon.h>
    38 #include <aknnavi.h>
    38 #include <aknnavi.h>
    39 #include <AiwGenericParam.h>
    39 #include <AiwGenericParam.h>
    40 #include <AknDef.h>
    40 #include <AknDef.h>
    41 #include <DocumentHandler.h>
    41 #include <DocumentHandler.h>
       
    42 #include <SysUtil.h>
    42 
    43 
    43 #ifdef BRDO_APP_GALLERY_SUPPORTED_FF
    44 #ifdef BRDO_APP_GALLERY_SUPPORTED_FF
    44 #include <MGXFileManagerFactory.h>
    45 #include <MGXFileManagerFactory.h>
    45 #include <CMGXFileManager.h>
    46 #include <CMGXFileManager.h>
    46 #endif
    47 #endif
   119 const TUint KDot('.');
   120 const TUint KDot('.');
   120 const TUint KSlash('/');
   121 const TUint KSlash('/');
   121 _LIT( KDefaultSchema, "http://" );
   122 _LIT( KDefaultSchema, "http://" );
   122 const TInt KDefaultSchemaLength = 7;
   123 const TInt KDefaultSchemaLength = 7;
   123 
   124 
       
   125 const TInt KMinimumCDriveDiskSpace = 512 * 1024;
       
   126 
   124 // ================= MEMBER FUNCTIONS =======================
   127 // ================= MEMBER FUNCTIONS =======================
   125 
   128 
   126 // -----------------------------------------------------------------------------
   129 // -----------------------------------------------------------------------------
   127 // CBrowserAppUi::CBrowserAppUi()
   130 // CBrowserAppUi::CBrowserAppUi()
   128 // -----------------------------------------------------------------------------
   131 // -----------------------------------------------------------------------------
   270 // CBrowserAppUi::InitBrowser()
   273 // CBrowserAppUi::InitBrowser()
   271 // -----------------------------------------------------------------------------
   274 // -----------------------------------------------------------------------------
   272 //
   275 //
   273 void CBrowserAppUi::InitBrowserL()
   276 void CBrowserAppUi::InitBrowserL()
   274     {
   277     {
       
   278     RFs fs;
       
   279     User::LeaveIfError(fs.Connect());
       
   280     TInt drive( EDriveC );
       
   281     TBool isSpace( EFalse );
       
   282     TInt err( KErrNone );
       
   283     TRAP( err, isSpace = !SysUtil::DiskSpaceBelowCriticalLevelL(
       
   284                                                 &fs,
       
   285                                                 KMinimumCDriveDiskSpace,
       
   286                                                 drive ));
       
   287     fs.Close();
       
   288     if (!isSpace)
       
   289         User::Leave(KErrDiskFull);
       
   290 
   275     if (!iStartedUp)
   291     if (!iStartedUp)
   276         {
   292         {
   277         LOG_ENTERFN( "CBrowserAppUi::InitBrowser" );
   293         LOG_ENTERFN( "CBrowserAppUi::InitBrowser" );
   278 
   294 
   279         User::LeaveIfError( iFavouritesSess.Connect() );
   295         User::LeaveIfError( iFavouritesSess.Connect() );
  1234         if ( aAccessPoint.IsNull() || aAccessPoint.IsDefault() || (!Util::IsValidAPFromParamL( *this, aAccessPoint.ApId() )) )
  1250         if ( aAccessPoint.IsNull() || aAccessPoint.IsDefault() || (!Util::IsValidAPFromParamL( *this, aAccessPoint.ApId() )) )
  1235 			{
  1251 			{
  1236             if ( (Preferences().AccessPointSelectionMode() == EConnectionMethod) || 
  1252             if ( (Preferences().AccessPointSelectionMode() == EConnectionMethod) || 
  1237                  (Preferences().AccessPointSelectionMode() == EAlwaysAsk) )
  1253                  (Preferences().AccessPointSelectionMode() == EAlwaysAsk) )
  1238                 {
  1254                 {
  1239     			iRequestedAp = Preferences().DefaultAccessPoint();
  1255                 iRequestedAp = Preferences().DefaultAccessPoint();
       
  1256 #ifdef BRDO_OCC_ENABLED_FF //Setting ap should not be taken if OCC is enabled, instead bookmark ap should be taken
       
  1257 #ifndef __WINS__
       
  1258                 iRequestedAp = aAccessPoint.ApId();
       
  1259                 BROWSER_LOG( ( _L( "Bookmark Iap id : %d" ), iRequestedAp ) );
       
  1260 #endif
       
  1261 #endif                
  1240                 }
  1262                 }
  1241             else if ( Preferences().AccessPointSelectionMode() == EDestination ) 
  1263             else if ( Preferences().AccessPointSelectionMode() == EDestination ) 
  1242                 {
  1264                 {
  1243                 // for bug fix MLAN-7EKFV4
  1265                 // for bug fix MLAN-7EKFV4
  1244     			iRequestedAp = KWmlNoDefaultAccessPoint;
  1266     			iRequestedAp = KWmlNoDefaultAccessPoint;
  1252 					//as the ConnMan will present us with a selection
  1274 					//as the ConnMan will present us with a selection
  1253         BROWSER_LOG( ( _L( "requestedAp: %d" ), iRequestedAp ) );
  1275         BROWSER_LOG( ( _L( "requestedAp: %d" ), iRequestedAp ) );
  1254         // it's ok to assign in the case of EDest, since CBrCtl doesn't use the apId passed in LoadUrlL()
  1276         // it's ok to assign in the case of EDest, since CBrCtl doesn't use the apId passed in LoadUrlL()
  1255         TUint32 IAPid = iRequestedAp;
  1277         TUint32 IAPid = iRequestedAp;
  1256         TUint32 defaultSnap =  iPreferences->DefaultSnapId();
  1278         TUint32 defaultSnap =  iPreferences->DefaultSnapId();
       
  1279 #ifndef BRDO_OCC_ENABLED_FF
  1257         // if no AP or SNAP is defined, define it
  1280         // if no AP or SNAP is defined, define it
  1258         if( (iRequestedAp == KWmlNoDefaultAccessPoint && iPreferences->AccessPointSelectionMode() == EConnectionMethod) || 
  1281         if( (iRequestedAp == KWmlNoDefaultAccessPoint && iPreferences->AccessPointSelectionMode() == EConnectionMethod) || 
  1259             (defaultSnap == KWmlNoDefaultSnapId && iPreferences->AccessPointSelectionMode() == EDestination) )
  1282             (defaultSnap == KWmlNoDefaultSnapId && iPreferences->AccessPointSelectionMode() == EDestination) )
  1260             {
  1283             {
  1261             StartPreferencesViewL( EShowAlwaysAsk | EShowDestinations | EShowConnectionMethods );
  1284             StartPreferencesViewL( EShowAlwaysAsk | EShowDestinations | EShowConnectionMethods );
  1283             {
  1306             {
  1284     		BROWSER_LOG( ( _L( "AP added" ) ) );
  1307     		BROWSER_LOG( ( _L( "AP added" ) ) );
  1285     		IAPid = Util::IapIdFromWapIdL( *this, iRequestedAp );  // Get currently active ap
  1308     		IAPid = Util::IapIdFromWapIdL( *this, iRequestedAp );  // Get currently active ap
  1286     		BROWSER_LOG( ( _L( "No AP 2" ) ) );
  1309     		BROWSER_LOG( ( _L( "No AP 2" ) ) );
  1287             }
  1310             }
  1288 
  1311 #endif // BRDO_OCC_ENABLED_FF
  1289 #else	//we can use any numbers here
  1312 #else	//we can use any numbers here
  1290         // alr: snap on emulator should not exist; use cm mode instead?
  1313         // alr: snap on emulator should not exist; use cm mode instead?
  1291 		iRequestedAp = 2;
  1314 		iRequestedAp = 2;
  1292 		TUint32 IAPid = 2;
  1315 		TUint32 IAPid = 2;
  1293 #endif //__WINSCW__
  1316 #endif //__WINSCW__
  1886                 StartFetchHomePageL();
  1909                 StartFetchHomePageL();
  1887             	}
  1910             	}
  1888            
  1911            
  1889 	        if( !specialSchemeInHomePageAddress )
  1912 	        if( !specialSchemeInHomePageAddress )
  1890 	            {
  1913 	            {
  1891 	        	ActivateLocalViewL( LastActiveViewId() );
  1914                 if( iCurrentView != iLastViewId )
       
  1915                     ActivateLocalViewL( LastActiveViewId() );
  1892 	            }
  1916 	            }
  1893         	}        	   	  
  1917         	}        	   	  
  1894         }
  1918         }
  1895     else if ( aCommand == EApaCommandViewActivate )
  1919     else if ( aCommand == EApaCommandViewActivate )
  1896     // Get when activated from soft notification (Downloads List).
  1920     // Get when activated from soft notification (Downloads List).