browserui/browser/BrowserAppSrc/BrowserAppUi.cpp
branchRCL_3
changeset 34 5dedbccec665
parent 33 dbd79466b1ed
child 35 5c11946e75b3
equal deleted inserted replaced
33:dbd79466b1ed 34:5dedbccec665
  1213     // Let's cancel the previous fetch if any
  1213     // Let's cancel the previous fetch if any
  1214     if ( Fetching() )
  1214     if ( Fetching() )
  1215 		{
  1215 		{
  1216         CancelFetch();
  1216         CancelFetch();
  1217 		}
  1217 		}
  1218 
  1218 #ifndef __WINS__
       
  1219 //Fix for bookmark specific access point
       
  1220     if( iConnection && iConnection->Connected() )
       
  1221        {
       
  1222        TUint32 passedIap( 0 );
       
  1223        if ( aAccessPoint.ApId() != KWmlNoDefaultAccessPoint )
       
  1224            {
       
  1225            passedIap = Util::IapIdFromWapIdL( *this, aAccessPoint.ApId());
       
  1226            BROWSER_LOG((_L("CBrowserAppUi::FetchL Passed Iap: %d"), passedIap));
       
  1227            TUint32 connectedAp = iConnection->CurrentAPId();
       
  1228            BROWSER_LOG((_L("CBrowserAppUi::FetchL Existing connected Iap: %d"), connectedAp));
       
  1229            if(passedIap != connectedAp)
       
  1230                {
       
  1231                StopConnectionObserving();
       
  1232                BROWSER_LOG((_L("CBrowserAppUi::FetchL Stopped the connection observation.")));
       
  1233                DisconnectL();
       
  1234                BROWSER_LOG((_L("CBrowserAppUi::FetchL Given iap and Connected iap are not same. Disconnected the existing connection.")));
       
  1235                }
       
  1236            }
       
  1237 
       
  1238        }
       
  1239 #endif // __WINS__
  1219     // iDoNotRestoreContentFlag = EFalse;
  1240     // iDoNotRestoreContentFlag = EFalse;
  1220 
  1241 
  1221     TInt toPop = 0;
  1242     TInt toPop = 0;
  1222     TUriParser uriParser;
  1243     TUriParser uriParser;
  1223     TInt err = uriParser.Parse(aUrl);
  1244     TInt err = uriParser.Parse(aUrl);
  1288              (defaultSnap == KWmlNoDefaultSnapId && iPreferences->AccessPointSelectionMode() == EDestination) )
  1309              (defaultSnap == KWmlNoDefaultSnapId && iPreferences->AccessPointSelectionMode() == EDestination) )
  1289             {
  1310             {
  1290             BROWSER_LOG( ( _L( "AP or SNAP was not added set to Always ask mode" ) ) );
  1311             BROWSER_LOG( ( _L( "AP or SNAP was not added set to Always ask mode" ) ) );
  1291             iPreferences->SetAccessPointSelectionModeL(EAlwaysAsk );
  1312             iPreferences->SetAccessPointSelectionModeL(EAlwaysAsk );
  1292             }
  1313             }
  1293         if ( iRequestedAp == KWmlNoDefaultAccessPoint )
  1314         if ( iRequestedAp != KWmlNoDefaultAccessPoint )
  1294             {
  1315             {
  1295             // For all cases just set dummy id to IAPid not to let Ap engine or Ap util to leave
  1316     		    BROWSER_LOG( ( _L( "AP added" ) ) );
  1296             // In the cases of EDest, EAA, since ap will not be used, it's ok to do so as well
  1317             IAPid = Util::IapIdFromWapIdL( *this, iRequestedAp );  // Get currently active ap
  1297             // In the case of EDest, need to preserve KWmlNoDefaultAccessPoint as the value
  1318             BROWSER_LOG( ( _L( "Access point: %d" ), IAPid ) );
  1298             // it'll be used in BrowserSpecialLoadObserver.cpp for for bug fix MLAN-7EKFV4
  1319             }
  1299             if ( Preferences().AccessPointSelectionMode() != EDestination )
  1320 
  1300                 {
       
  1301     		    iRequestedAp = 2;
       
  1302                 }
       
  1303             IAPid = 2;
       
  1304             }
       
  1305         else
       
  1306             {
       
  1307     		BROWSER_LOG( ( _L( "AP added" ) ) );
       
  1308     		IAPid = Util::IapIdFromWapIdL( *this, iRequestedAp );  // Get currently active ap
       
  1309     		BROWSER_LOG( ( _L( "No AP 2" ) ) );
       
  1310             }
       
  1311 #endif // BRDO_OCC_ENABLED_FF
  1321 #endif // BRDO_OCC_ENABLED_FF
  1312 #else	//we can use any numbers here
  1322 #else	//we can use any numbers here
  1313         // alr: snap on emulator should not exist; use cm mode instead?
  1323         // alr: snap on emulator should not exist; use cm mode instead?
  1314 		iRequestedAp = 2;
  1324 		iRequestedAp = 2;
  1315 		TUint32 IAPid = 2;
  1325 		TUint32 IAPid = 2;
  1338                 searchSchemePtr = uriParser.Extract( EUriScheme );
  1348                 searchSchemePtr = uriParser.Extract( EUriScheme );
  1339             
  1349             
  1340             err = uriParser.Parse(serviceSchemePtr);
  1350             err = uriParser.Parse(serviceSchemePtr);
  1341             if (!err)
  1351             if (!err)
  1342                 serviceSchemePtr = uriParser.Extract( EUriScheme );
  1352                 serviceSchemePtr = uriParser.Extract( EUriScheme );
  1343             
  1353 
  1344             if( scheme.Length() != 0 )
  1354 
       
  1355             if( scheme.Length() != 0 && (!scheme.Compare(serviceSchemePtr) || !scheme.Compare(searchSchemePtr)) )
  1345                 {
  1356                 {
  1346                 if( !scheme.Compare(serviceSchemePtr) || !scheme.Compare(searchSchemePtr) )
  1357                 iSpecialSchemeinAddress = ETrue;
  1347                 	{
  1358                 TRAP( err, BrCtlInterface().LoadUrlL( resultUrlBuf->Des(), IAPid ) );
  1348                 	iSpecialSchemeinAddress = ETrue;
       
  1349                 	TRAP( err, BrCtlInterface().LoadUrlL( resultUrlBuf->Des(), IAPid ) );
       
  1350                 	}
       
  1351                 else
       
  1352                 	{
       
  1353                 	LoadObserver().DoStartLoad( aUrlType );
       
  1354                     TRAP( err, BrCtlInterface().LoadUrlL( resultUrlBuf->Des(), IAPid ) );
       
  1355                 	}            
       
  1356                 }
  1359                 }
       
  1360             else
       
  1361                 {
       
  1362                 LoadObserver().DoStartLoad( aUrlType );
       
  1363                 TRAP( err, BrCtlInterface().LoadUrlL( resultUrlBuf->Des(), IAPid ) );
       
  1364                 }            
  1357 	        }
  1365 	        }
  1358 	    else
  1366 	    else
  1359 	        {
  1367 	        {
  1360 	        LoadObserver().DoStartLoad( aUrlType );
  1368 	        LoadObserver().DoStartLoad( aUrlType );
       
  1369 	        BROWSER_LOG( ( _L( "PASSED IAP: %d" ), IAPid ) );
  1361             TRAP( err, BrCtlInterface().LoadUrlL( resultUrlBuf->Des(), IAPid ) );
  1370             TRAP( err, BrCtlInterface().LoadUrlL( resultUrlBuf->Des(), IAPid ) );
  1362 	        }
  1371 	        }
  1363         
  1372         
  1364 		CleanupStack::PopAndDestroy(toPop); //resultUrlBuf and url if needed
  1373 		CleanupStack::PopAndDestroy(toPop); //resultUrlBuf and url if needed
  1365 		BROWSER_LOG( ( _L( "No AP 4 %d" ), err  ) );
  1374 		BROWSER_LOG( ( _L( "No AP 4 %d" ), err  ) );
  2174                             	!Preferences().UiLocalFeatureSupported( KBrowserMinimalMultipleWindows ))
  2183                             	!Preferences().UiLocalFeatureSupported( KBrowserMinimalMultipleWindows ))
  2175                                 {
  2184                                 {
  2176                                 // Cancel history view, mini map, toolbar or any other active control on the current window 
  2185                                 // Cancel history view, mini map, toolbar or any other active control on the current window 
  2177                                 BrCtlInterface().HandleCommandL( TBrCtlDefs::ECommandCancel + TBrCtlDefs::ECommandIdBase );
  2186                                 BrCtlInterface().HandleCommandL( TBrCtlDefs::ECommandCancel + TBrCtlDefs::ECommandIdBase );
  2178                                 // there is already a window, so create a new one
  2187                                 // there is already a window, so create a new one
  2179                                 CBrowserWindow *win = WindowMgr().CreateWindowL( 0, &KNullDesC );
  2188                                 CBrowserWindow *win = NULL; 
       
  2189                                 if(WindowMgr().CurrentWindow()) 
       
  2190                                     win = WindowMgr().CreateWindowL( (WindowMgr().CurrentWindow()->WindowId()) ? WindowMgr().CurrentWindow()->WindowId() : 0, &KNullDesC );
       
  2191                                 else
       
  2192                                     win = WindowMgr().CreateWindowL( 0, &KNullDesC );
  2180                                 if (win != NULL)
  2193                                 if (win != NULL)
  2181                                     {
  2194                                     {
  2182                                         
  2195                                         
  2183                                     CleanupStack::PushL( win );
  2196                                     CleanupStack::PushL( win );
  2184                                     WindowMgr().SwitchWindowL( win->WindowId() );
  2197                                     WindowMgr().SwitchWindowL( win->WindowId() );
  2324         iIdle->Start( TCallBack( StopDelay, this ) );
  2337         iIdle->Start( TCallBack( StopDelay, this ) );
  2325         iWait.Start();
  2338         iWait.Start();
  2326         iParametrizedLaunchInProgress = 2;
  2339         iParametrizedLaunchInProgress = 2;
  2327         }
  2340         }
  2328     }
  2341     }
       
  2342 void CBrowserAppUi::StopConnectionObserving()
       
  2343     {
       
  2344     LOG_ENTERFN("CBrowserAppUi::StopConnectionObserving");
       
  2345     if ( iConnStageNotifier && iConnStageNotifier->IsActive() )
       
  2346         {
       
  2347         BROWSER_LOG( ( _L( " CBrowserAppUi::StopConnectionObserving Cancelling Observer" ) ) );
       
  2348         iConnStageNotifier->Cancel();
       
  2349         }
       
  2350     }
  2329 
  2351 
  2330 // -----------------------------------------------------------------------------
  2352 // -----------------------------------------------------------------------------
  2331 // CBrowserAppUi::ConnNeededStatusL
  2353 // CBrowserAppUi::ConnNeededStatusL
  2332 // -----------------------------------------------------------------------------
  2354 // -----------------------------------------------------------------------------
  2333 //
  2355 //
  2334 void CBrowserAppUi::ConnNeededStatusL( TInt aErr )
  2356 void CBrowserAppUi::ConnNeededStatusL( TInt aErr )
  2335     {
  2357     {
       
  2358     LOG_ENTERFN("CBrowserAppUi::ConnNeededStatusL");
  2336     UpdateSoftKeys();
  2359     UpdateSoftKeys();
  2337     if (iSuppressAlwaysAsk)
  2360     if (iSuppressAlwaysAsk)
  2338         {
  2361         {
  2339         // Always ask was temporarily disabled, after creating the network connection, enable it again
  2362         // Always ask was temporarily disabled, after creating the network connection, enable it again
  2340         iPreferences->SetAccessPointSelectionModeL(EAlwaysAsk);
  2363         iPreferences->SetAccessPointSelectionModeL(EAlwaysAsk);
  2354 
  2377 
  2355 
  2378 
  2356 
  2379 
  2357     if ( !iConnStageNotifier->IsActive() )
  2380     if ( !iConnStageNotifier->IsActive() )
  2358         {
  2381         {
       
  2382         BROWSER_LOG( ( _L( " CBrowserAppUi::ConnNeededStatusL Starting Connection Observer" ) ) );
  2359         TName* connectionName = Connection().ConnectionNameL();
  2383         TName* connectionName = Connection().ConnectionNameL();
  2360         CleanupStack::PushL( connectionName );
  2384         CleanupStack::PushL( connectionName );
  2361         iConnStageNotifier->StartNotificationL(
  2385         iConnStageNotifier->StartNotificationL(
  2362             connectionName, KConnectionUninitialised, this);
  2386             connectionName, KConnectionUninitialised, this);
  2363         CleanupStack::PopAndDestroy();  //connectionName
  2387         CleanupStack::PopAndDestroy();  //connectionName