browserui/browser/BrowserAppSrc/BrowserLoadObserver.cpp
changeset 51 48e827313edd
parent 37 481242ead638
child 53 f427d27b98d8
equal deleted inserted replaced
37:481242ead638 51:48e827313edd
     1 /*
       
     2 * Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of the License "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  Handle special load events such as network connection,
       
    15 *                deal with non-http or non-html requests
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 
       
    21 // INCLUDE FILES
       
    22 #include "BrowserLoadObserver.h"
       
    23 #include "ApiProvider.h"
       
    24 #include "Display.h"
       
    25 #include "BrowserContentView.h"
       
    26 #include "CommonConstants.h"
       
    27 #include "BrowserAppUi.h"
       
    28 #include "logger.h"
       
    29 #include "BrowserWindow.h"
       
    30 #include "BrowserWindowManager.h"
       
    31 #include "BrowserDialogsProviderProxy.h"
       
    32 
       
    33 #include <FeatMgr.h>
       
    34 #include <mconnection.h>
       
    35 #include <browserdialogsprovider.h>
       
    36 
       
    37 #ifdef I__LOG_EVENT_TIME
       
    38     // defines a local timer with name 'localTime'
       
    39     #define START_TIMER( localTime )  TTime localTime;  localTime.HomeTime();
       
    40     
       
    41     // count the elapsed time based on timer 'localTime'
       
    42     // and increment number of timers called ( numOfTimer )
       
    43     #define STOP_TIMER( localTime, numOfTimer ) \
       
    44         TTime locTime__a;  locTime__a.HomeTime(); \
       
    45         TInt64 updateTime = locTime__a.MicroSecondsFrom( localTime ).Int64(); \
       
    46         LOG_WRITE_FORMAT( "Update time: %d", updateTime ); \
       
    47         ++numOfTimer; \
       
    48         CBrowserLoadObserver::iTotalUpdateTime += updateTime;
       
    49 #else  // I__LOG_EVENT_TIME
       
    50     // empty macros
       
    51     #define START_TIMER( a )
       
    52     #define STOP_TIMER( a, b )
       
    53 #endif  // I__LOG_EVENT_TIME
       
    54 
       
    55 // ---------------------------------------------------------
       
    56 // CBrowserLoadObserver::NewL()
       
    57 // ---------------------------------------------------------
       
    58 //
       
    59 CBrowserLoadObserver* CBrowserLoadObserver::NewL(
       
    60         MApiProvider& aApiProvider,
       
    61         CBrowserContentView& aContentView,
       
    62         CBrowserWindow& aWindow )
       
    63     {
       
    64     CBrowserLoadObserver* self = 
       
    65         new (ELeave) CBrowserLoadObserver( aApiProvider, aContentView, aWindow );
       
    66     CleanupStack::PushL( self );
       
    67     self->ConstructL( );
       
    68     CleanupStack::Pop();    // self
       
    69     return self;
       
    70     }
       
    71 
       
    72 // ---------------------------------------------------------
       
    73 // CBrowserLoadObserver::~CBrowserLoadObserver()
       
    74 // ---------------------------------------------------------
       
    75 //
       
    76 CBrowserLoadObserver::~CBrowserLoadObserver()
       
    77     {
       
    78     	// iApiProvider, iContentView, iWindow not owned by CBRowserLoadObserver.
       
    79 		// invalidate pointer for a cleaner/clearer destruction
       
    80         iApiProvider = NULL;
       
    81         iContentView = NULL;
       
    82 		iWindow = NULL;
       
    83     }
       
    84 
       
    85 // ----------------------------------------------------------------------------
       
    86 // CBrowserLoadObserver::HandleBrowserLoadEventL()
       
    87 // ----------------------------------------------------------------------------
       
    88 //
       
    89 void CBrowserLoadObserver::HandleBrowserLoadEventL(
       
    90         TBrCtlDefs::TBrCtlLoadEvent aLoadEvent,
       
    91         TUint aSize,
       
    92         TUint16 aTransactionId)
       
    93     {
       
    94 LOG_ENTERFN("CBrowserLoadObserver::HandleBrowserLoadEventL");
       
    95 LOG_WRITE_FORMAT(" LoadEvent: %d", aLoadEvent );
       
    96 LOG_WRITE_FORMAT("      Size: %d", aSize );
       
    97 LOG_WRITE_FORMAT("      TrId: %d", aTransactionId );
       
    98 LOG_WRITE_FORMAT(" LoadState: %d", iLoadState );
       
    99 LOG_WRITE_FORMAT("  LoadType: %d", iLoadUrlType );
       
   100 	if( aLoadEvent == TBrCtlDefs::EEventNewContentDisplayed )
       
   101 		{
       
   102 		iWindow->ResetPageOverviewLocalSettingL();
       
   103 		iWindow->SetImagesLoaded(EFalse);		
       
   104         } 
       
   105 	HandleLoadEventOtherL( aLoadEvent, aSize, aTransactionId );
       
   106     }
       
   107 
       
   108 // ----------------------------------------------------------------------------
       
   109 // CBrowserLoadObserver::HandleLoadEventOtherL()
       
   110 // ----------------------------------------------------------------------------
       
   111 //
       
   112 void CBrowserLoadObserver::HandleLoadEventOtherL(
       
   113         TBrCtlDefs::TBrCtlLoadEvent aLoadEvent,
       
   114         TUint aSize,
       
   115         TUint16 aTransactionId )
       
   116     {
       
   117 #define STATECHECK( a ) { if( (iLoadState & a) == 0 ) break; }
       
   118     
       
   119     TInt err( KErrNone );
       
   120     switch( aLoadEvent )
       
   121         {
       
   122         case TBrCtlDefs::EEventLoadError:
       
   123             {
       
   124             if(LoadStatus( ELoadStatusSecurePage ))
       
   125                 {
       
   126                 UpdateSecureIndicatorL();
       
   127                 }
       
   128             ClearStatus();
       
   129             SetStatus( ELoadStatusMainError );
       
   130             break;
       
   131             }
       
   132         case TBrCtlDefs::EEventEnteringSecurePage:
       
   133             {
       
   134             SetStatus( ELoadStatusSecurePage );
       
   135             SetStatus( ELoadStatusAllItemIsSecure );
       
   136             UpdateSecureIndicatorL();
       
   137             break;
       
   138             }
       
   139         case TBrCtlDefs::EEventSomeItemsNotSecure:
       
   140             {
       
   141             ClearStatus( ELoadStatusAllItemIsSecure );
       
   142             UpdateSecureIndicatorL();
       
   143             break;
       
   144             }
       
   145         case TBrCtlDefs::EEventSecureItemInNonSecurePage:
       
   146             {
       
   147             SetStatus( ELoadStatusSecureItemNonSecurePage );
       
   148             UpdateSecureIndicatorL();
       
   149             break;
       
   150             }
       
   151         case TBrCtlDefs::EEventExitingSecurePage:
       
   152         case TBrCtlDefs::EEventSubmittingToNonSecurePage:
       
   153             {
       
   154             ClearStatus( ELoadStatusSecurePage );
       
   155             ClearStatus( ELoadStatusAllItemIsSecure );
       
   156             SetStatus ( ELoadStatusSecurePageVisited );
       
   157             UpdateSecureIndicatorL();
       
   158             break;
       
   159             }
       
   160         case TBrCtlDefs::EEventTitleAvailable:
       
   161             {
       
   162             SetStatus( ELoadStatusTitleAvailable );
       
   163             NewTitleAvailableL();
       
   164             break;
       
   165             }
       
   166         case TBrCtlDefs::EEventNewContentStart:
       
   167             {
       
   168 #ifdef I__LOG_EVENT_TIME
       
   169             iStartDownloadTime.HomeTime();
       
   170             iTotalUpdateTime = 0;
       
   171             iNumberOfUpdates = 0;
       
   172 #endif  // I__LOG_EVENT_TIME
       
   173             StateChange( ELoadStateResponseInProgress );
       
   174             iApiProvider->SetProgressShown( ETrue );
       
   175             iApiProvider->Display().StartProgressAnimationL();
       
   176             
       
   177             // in case we're in bookmarks view and a background page load is in
       
   178             // progress, don't update the softkeys
       
   179             if( iApiProvider->IsForeGround() && InBrowserContentView() )
       
   180                 {
       
   181                 if( CBrowserAppUi::Static()->ActiveView() )
       
   182                     {
       
   183                     CBrowserAppUi::Static()->ActiveView()->UpdateCbaL();
       
   184                     }
       
   185                 }
       
   186             iApiProvider->WindowMgr().NotifyObserversL( EWindowLoadStart, iWindow->WindowId() );
       
   187             break;
       
   188             }
       
   189         case TBrCtlDefs::EEventUrlLoadingStart:
       
   190             {
       
   191             STATECHECK( ELoadStateResponseInProgress )
       
   192             iApiProvider->Display().StartProgressAnimationL();
       
   193 
       
   194             // If the load is not initiated from the bookmarks view (ie. engine initiated
       
   195             // via some timer on a page like cnn.com) then don't change view to content view
       
   196             if (iBrowserInitLoad)
       
   197                 {
       
   198                 iApiProvider->SetViewToBeActivatedIfNeededL(KUidBrowserContentViewId);
       
   199                 iBrowserInitLoad = EFalse;
       
   200                 }
       
   201 
       
   202             // add transaction to ProgressBar
       
   203             iApiProvider->Display().AddTransActIdL( aTransactionId );    
       
   204             
       
   205             // Display the status pane, while loading
       
   206             if ( InBrowserContentView() && iContentView->FullScreenMode() )
       
   207                 {
       
   208                 iContentView->ShowFsStatusPane(ETrue);
       
   209                 }
       
   210             break;
       
   211             }
       
   212         // first content chunk arrived
       
   213         case TBrCtlDefs::EEventNewUrlContentArrived:
       
   214             {
       
   215             STATECHECK( ELoadStateResponseInProgress )
       
   216             SetStatus( ELoadStatusFirstChunkArrived );
       
   217             // set MaxData for this transaction
       
   218             iApiProvider->Display().AddProgressDataL(
       
   219                 aTransactionId, 0, aSize );
       
   220             break;
       
   221             }
       
   222         // additional content chunk arrived
       
   223         case TBrCtlDefs::EEventMoreUrlContentArrived:
       
   224             {
       
   225             STATECHECK( ELoadStateResponseInProgress )
       
   226             START_TIMER( t1 );
       
   227             // set RecvdData for this transaction
       
   228             iApiProvider->Display().AddProgressDataL(
       
   229                 aTransactionId, aSize, 0 );
       
   230             if( iApiProvider->IsForeGround() )
       
   231                 {
       
   232                 iApiProvider->Display().NotifyProgress();
       
   233                 }
       
   234             STOP_TIMER( t1, iNumberOfUpdates );
       
   235             break;
       
   236             }
       
   237         // content is processed, new fetch is allowed.
       
   238         // some more event may still remain
       
   239         case TBrCtlDefs::EEventContentFinished:
       
   240             {
       
   241             StateChange( ELoadStateIdle );
       
   242             if( !ContentDisplayed() )
       
   243                 {
       
   244                 SetContentDisplayed( ETrue );
       
   245                 }
       
   246 
       
   247             if( !iApiProvider->ExitInProgress() && 
       
   248                 iApiProvider->IsForeGround() )
       
   249                 {
       
   250                 iApiProvider->Display().StopProgressAnimationL();
       
   251                 }
       
   252             User::ResetInactivityTime();
       
   253             
       
   254             if( LoadUrlType() == ELoadUrlTypeEmbeddedBrowserWithUrl &&
       
   255                 !LoadStatus( ELoadStatusFirstChunkArrived ) && 
       
   256                 !iApiProvider->ExitInProgress() )
       
   257                 {
       
   258                 // Don't do anything; let the embedder close the browser
       
   259                 }
       
   260             // No content to be shown, go back to where we came from
       
   261             else if ( !iRestoreContentFlag  )
       
   262                 {
       
   263                 CBrowserAppUi::Static()->ActivateLocalViewL( 
       
   264                                             iApiProvider->LastActiveViewId() );
       
   265                 if( iApiProvider->IsForeGround() )
       
   266                     {
       
   267                     if  ( CBrowserAppUi::Static()->ActiveView() )
       
   268                         {
       
   269                         CBrowserAppUi::Static()->ActiveView()->UpdateCbaL();
       
   270                         }
       
   271                     }
       
   272                 }                        
       
   273             else
       
   274                 {
       
   275                 ContentArrivedL();
       
   276                 
       
   277                 // in case we're in bookmarks view and a background page load is in
       
   278                 // progress, don't update the softkeys
       
   279                 if( iApiProvider->IsForeGround() && InBrowserContentView() )
       
   280                     {
       
   281                     if  ( CBrowserAppUi::Static()->ActiveView() )
       
   282                         {
       
   283                         CBrowserAppUi::Static()->ActiveView()->UpdateCbaL();
       
   284                         }
       
   285                     }
       
   286                 }
       
   287 #ifdef I__LOG_EVENT_TIME
       
   288             TTime endDownloadTime;
       
   289             endDownloadTime.HomeTime();
       
   290             TInt64 dlTime = endDownloadTime.MicroSecondsFrom(iStartDownloadTime).Int64();
       
   291             LOG_WRITE_FORMAT( "Total download time: %d", dlTime );
       
   292             LOG_WRITE_FORMAT( "Total update time: %d", iTotalUpdateTime );
       
   293             LOG_WRITE_FORMAT( "Total number of updates: %d", iNumberOfUpdates );
       
   294             if( iNumberOfUpdates )
       
   295                 {
       
   296                 LOG_WRITE_FORMAT( "Average update time: %d", 
       
   297                     iTotalUpdateTime / iNumberOfUpdates );
       
   298                 }
       
   299             if( dlTime )
       
   300                 {
       
   301                 LOG_WRITE_FORMAT( "Total update time (%% of download time): %d",
       
   302                     iTotalUpdateTime / (dlTime / 100) );
       
   303                 }
       
   304 #endif  // I__LOG_EVENT_TIME
       
   305             break;
       
   306             }
       
   307         // first chunk displayed, no parameter
       
   308         case TBrCtlDefs::EEventNewContentDisplayed:
       
   309             {
       
   310             iApiProvider->WindowMgr().SetContentExist( ETrue );
       
   311             SetStatus( ELoadStatusFirstChunkDisplayed );
       
   312             SetRestoreContentFlag( ETrue );
       
   313             ContentArrivedL();
       
   314             if( !ContentDisplayed() )
       
   315                 {
       
   316                 SetContentDisplayed( ETrue );
       
   317                 }
       
   318             break;
       
   319             }
       
   320         // additional chunk displayed, no parameter
       
   321         case TBrCtlDefs::EEventMoreContentDisplayed:
       
   322             {
       
   323             SetStatus( ELoadStatusContentDisplayed );
       
   324             SetRestoreContentFlag( ETrue );
       
   325             ContentArrivedL();
       
   326             break;
       
   327             }
       
   328         // last chunk arrived
       
   329         case TBrCtlDefs::EEventUrlLoadingFinished:
       
   330             {
       
   331             iApiProvider->Display().TransActIdComplete( aTransactionId );
       
   332 			SetRestoreContentFlag( ETrue );
       
   333             ContentArrivedL();
       
   334 			TRAP( err, iApiProvider->LogAccessToRecentUrlL( iWindow->BrCtlInterface() ) );            
       
   335             break;
       
   336             }
       
   337         case TBrCtlDefs::EEventLoadFinished:
       
   338             {
       
   339             if( !iApiProvider->ExitInProgress() &&
       
   340                 iApiProvider->IsForeGround() )
       
   341                 {
       
   342                 iApiProvider->Display().StopProgressAnimationL();
       
   343 
       
   344                 // Turn off status pane, SK, and Cba 
       
   345                 // If in content view, set to fullscreen after download complete
       
   346                 if ( InBrowserContentView() && iContentView->FullScreenMode() )
       
   347                     {
       
   348                     iContentView->ShowFsStatusPane(EFalse);
       
   349                     }
       
   350                 }
       
   351             iApiProvider->WindowMgr().NotifyObserversL( EWindowLoadStop, iWindow->WindowId() );
       
   352             break;
       
   353             }
       
   354         case TBrCtlDefs::EEventAuthenticationFailed:
       
   355             {
       
   356             // don't add url to Adaptive Bookmarks
       
   357             ClearStatus( ELoadStatusFirstChunkArrived );
       
   358             break;
       
   359             }
       
   360         // Large file upload events
       
   361 		case TBrCtlDefs::EEventUploadStart:
       
   362 			{
       
   363 			iMaxUploadContent = aSize;
       
   364             iWindow->DialogsProviderProxy().UploadProgressNoteL( 
       
   365                 iMaxUploadContent, 0, EFalse, this );
       
   366 			break;
       
   367 			}
       
   368 		case TBrCtlDefs::EEventUploadIncrement:
       
   369 			{
       
   370             iWindow->DialogsProviderProxy().UploadProgressNoteL( 
       
   371                 iMaxUploadContent, aSize, EFalse, this );
       
   372 			break;
       
   373          	}
       
   374 		case TBrCtlDefs::EEventUploadFinished:
       
   375 			{
       
   376             iWindow->DialogsProviderProxy().UploadProgressNoteL( 
       
   377                 iMaxUploadContent, aSize, ETrue, this ); 
       
   378 			break;         
       
   379 			}
       
   380         default:
       
   381             break;
       
   382         }
       
   383 #undef STATECHECK
       
   384     }
       
   385 
       
   386 // ----------------------------------------------------------------------------
       
   387 // CBrowserLoadObserver::CBrowserLoadObserver()
       
   388 // ----------------------------------------------------------------------------
       
   389 //
       
   390 CBrowserLoadObserver::CBrowserLoadObserver(
       
   391         MApiProvider& aApiProvider,
       
   392         CBrowserContentView& aContentView,
       
   393         CBrowserWindow& aWindow ) :
       
   394     iApiProvider( &aApiProvider ),
       
   395     iContentView( &aContentView ),
       
   396     iWindow( &aWindow ),
       
   397     iLoadState( ELoadStateIdle ),
       
   398     iLoadUrlType( ELoadUrlTypeOther ),
       
   399     iStatus( 0 )
       
   400     {
       
   401     }
       
   402 
       
   403 // ----------------------------------------------------------------------------
       
   404 // CBrowserLoadObserver::ConstructL()
       
   405 // ----------------------------------------------------------------------------
       
   406 //
       
   407 void CBrowserLoadObserver::ConstructL()
       
   408     {
       
   409     }
       
   410 
       
   411 // ----------------------------------------------------------------------------
       
   412 // CBrowserLoadObserver::DoStartLoad()
       
   413 // ----------------------------------------------------------------------------
       
   414 //
       
   415 void CBrowserLoadObserver::DoStartLoad(
       
   416         TBrowserLoadUrlType aLoadUrlType )
       
   417     {
       
   418 /*
       
   419 LOG_WRITE("-------------------")
       
   420 LOG_WRITE_FORMAT(" UrlType: %d ", aLoadUrlType )
       
   421 */
       
   422     // __ASSERT_DEBUG instead of condition?
       
   423     if( iLoadState == ELoadStateIdle )
       
   424         {                
       
   425         if (LoadStatus(ELoadStatusSecurePageVisited))
       
   426             {
       
   427             ClearStatus();  
       
   428             SetStatus(ELoadStatusSecurePageVisited);  
       
   429             }
       
   430         else 
       
   431             {
       
   432             ClearStatus();            
       
   433             }        
       
   434         
       
   435         iLoadUrlType = aLoadUrlType;
       
   436         iRestoreContentFlag = EFalse;
       
   437         }
       
   438         
       
   439     iBrowserInitLoad = ETrue;
       
   440     }
       
   441 
       
   442 // ----------------------------------------------------------------------------
       
   443 // CBrowserLoadObserver::DoEndLoad()
       
   444 // ----------------------------------------------------------------------------
       
   445 //
       
   446 void CBrowserLoadObserver::DoEndLoad(
       
   447         TBool aIsUserInitiated )
       
   448     {
       
   449 // LOG_WRITE( "Cancelling.")
       
   450     if( aIsUserInitiated)
       
   451         {
       
   452         // wait for the remaining load events
       
   453         StateChange( ELoadStateLoadDone );
       
   454         }
       
   455     else  // don't wait for anything
       
   456         {
       
   457         StateChange( ELoadStateIdle );
       
   458         }
       
   459 
       
   460     // first arrives ContentFinished and then UrlLoadingFinished!
       
   461     // what to do with status?
       
   462     // updatesoftkeys()  done in appui
       
   463 
       
   464     CBrowserViewBase* view = CBrowserAppUi::Static()->ActiveView();
       
   465     if( view ) // just to be sure
       
   466         {
       
   467         TVwsViewId activeViewId = view->ViewId();
       
   468         if( activeViewId.iViewUid == KUidBrowserBookmarksViewId)
       
   469             {
       
   470             SetRestoreContentFlag( EFalse );
       
   471             }
       
   472         }
       
   473     }
       
   474 
       
   475 // ----------------------------------------------------------------------------
       
   476 // CBrowserLoadObserver::NewTitleAvailableL()
       
   477 // ----------------------------------------------------------------------------
       
   478 //
       
   479 void CBrowserLoadObserver::NewTitleAvailableL()
       
   480     {
       
   481     if( iWindow->IsWindowActive() )
       
   482         {
       
   483         CBrowserViewBase* view = CBrowserAppUi::Static()->ActiveView();        
       
   484          if( view ) // just to be sure
       
   485               {
       
   486               TVwsViewId activeViewId = view->ViewId();
       
   487               if( activeViewId.iViewUid == KUidBrowserContentViewId )
       
   488                   {
       
   489                   iContentView->UpdateTitleL( *iApiProvider );
       
   490                   }
       
   491               }
       
   492         }
       
   493     SetRestoreContentFlag( ETrue );
       
   494     }
       
   495     
       
   496 // ----------------------------------------------------------------------------
       
   497 // CBrowserLoadObserver::InBrowserContentView()
       
   498 // ----------------------------------------------------------------------------
       
   499 //
       
   500 TBool CBrowserLoadObserver::InBrowserContentView()
       
   501     {
       
   502     CBrowserViewBase* view = CBrowserAppUi::Static()->ActiveView();        
       
   503     if( view ) // just to be sure
       
   504         {
       
   505         TVwsViewId activeViewId = view->ViewId();
       
   506         return ( activeViewId.iViewUid == KUidBrowserContentViewId );
       
   507         }
       
   508         
       
   509     return EFalse;
       
   510     }
       
   511 
       
   512 
       
   513 // ----------------------------------------------------------------------------
       
   514 // CBrowserLoadObserver::ContentArrivedL()
       
   515 // ----------------------------------------------------------------------------
       
   516 //
       
   517 void CBrowserLoadObserver::ContentArrivedL()
       
   518     {
       
   519     if( iApiProvider->Connection().Connected()
       
   520         && iApiProvider->Preferences().HttpSecurityWarningsStatSupressed() )
       
   521         {
       
   522         TInt secureUpdate = EAknIndicatorStateOff;
       
   523         if( LoadStatus( ELoadStatusSecurePage ) )
       
   524             {
       
   525             if( LoadStatus( ELoadStatusAllItemIsSecure ) )
       
   526                 {
       
   527                 secureUpdate = EAknIndicatorStateOn;
       
   528                 }
       
   529             }
       
   530         iApiProvider->Display().UpdateSecureIndicatorL( secureUpdate );
       
   531         }
       
   532     }
       
   533 
       
   534 //-----------------------------------------------------------------------------
       
   535 // CBrowserLoadObserver::ReportDialogEvent
       
   536 //-----------------------------------------------------------------------------
       
   537 // Handles dialog provider events
       
   538 void CBrowserLoadObserver::ReportDialogEventL(
       
   539         TInt aType,
       
   540         TInt aFlags )
       
   541     {
       
   542     switch( aType )
       
   543         {
       
   544         case MBrowserDialogsProviderObserver::ENotifyError:
       
   545             // aFlags contains error code
       
   546             {
       
   547             // If card not in deck error, go to first card of deck
       
   548             SetRestoreContentFlag( aFlags == KBrsrWmlbrowserCardNotInDeck );
       
   549             break;
       
   550             }
       
   551         case MBrowserDialogsProviderObserver::ENotifyHttpError:
       
   552             // aFlags contains error code
       
   553             {
       
   554             SetRestoreContentFlag( EFalse );
       
   555             break;
       
   556             }
       
   557         case MBrowserDialogsProviderObserver::EUserAuthentication:
       
   558             {
       
   559             SetRestoreContentFlag( aFlags ); // False == Cancelled
       
   560             break;
       
   561             }
       
   562         case MBrowserDialogsProviderObserver::EConfirm:
       
   563             // aFlags contains Cancel status
       
   564             {
       
   565             // if confirmation query was cancelled, step back to idle
       
   566             if( !aFlags )
       
   567                 {
       
   568                 DoEndLoad( EFalse );
       
   569                 }
       
   570             SetRestoreContentFlag( !aFlags );
       
   571             break;
       
   572             }
       
   573         case MBrowserDialogsProviderObserver::EUploadProgress:
       
   574             {
       
   575             // Cancel fetching - dialog is cancelled
       
   576             if ( aFlags == KErrCancel )
       
   577                 {
       
   578                 iWindow->BrCtlInterface().HandleCommandL( 
       
   579                     (TInt)TBrCtlDefs::ECommandCancelFetch +
       
   580                     (TInt)TBrCtlDefs::ECommandIdBase );
       
   581                 }
       
   582             break;
       
   583             }
       
   584         default:
       
   585             break;
       
   586         }
       
   587     }
       
   588 
       
   589 //-----------------------------------------------------------------------------
       
   590 // CBrowserLoadObserver::UpdateSecureIndicatorL
       
   591 //-----------------------------------------------------------------------------
       
   592 //
       
   593 void CBrowserLoadObserver::UpdateSecureIndicatorL()
       
   594     {
       
   595     TBool status = LoadStatus( ELoadStatusAllItemIsSecure );
       
   596     iApiProvider->Display().UpdateSecureIndicatorL( 
       
   597         status &&
       
   598         !iApiProvider->Preferences().HttpSecurityWarningsStatSupressed() );
       
   599     }
       
   600 
       
   601 //-----------------------------------------------------------------------------
       
   602 // CBrowserLoadObserver::LoadUrlType
       
   603 //-----------------------------------------------------------------------------
       
   604 //
       
   605 CBrowserLoadObserver::TBrowserLoadUrlType CBrowserLoadObserver::LoadUrlType() const
       
   606     {
       
   607     return iLoadUrlType;
       
   608     }
       
   609 
       
   610 //-----------------------------------------------------------------------------
       
   611 // CBrowserLoadObserver::LoadState
       
   612 //-----------------------------------------------------------------------------
       
   613 //
       
   614 CBrowserLoadObserver::TBrowserLoadState CBrowserLoadObserver::LoadState() const
       
   615     {
       
   616     return iLoadState;
       
   617     }
       
   618 //-----------------------------------------------------------------------------
       
   619 // CBrowserLoadObserver::StateChange
       
   620 //-----------------------------------------------------------------------------
       
   621 //
       
   622 void CBrowserLoadObserver::StateChange( TBrowserLoadState aNextState )
       
   623     {
       
   624     if( ELoadStateIdle == iLoadState &&
       
   625         iLoadState != aNextState )
       
   626        {
       
   627           iNewContentDisplayed = EFalse;
       
   628           iApiProvider->WindowMgr().NotifyObserversL( EWindowCntDisplayed, iWindow->WindowId() );
       
   629        }
       
   630     iLoadState = aNextState;
       
   631     }
       
   632 
       
   633 //-----------------------------------------------------------------------------
       
   634 // CBrowserLoadObserver::SetContentDisplayed
       
   635 //-----------------------------------------------------------------------------
       
   636 //
       
   637 
       
   638 void CBrowserLoadObserver::SetContentDisplayed( TBool aValue )
       
   639     { 
       
   640     iNewContentDisplayed = aValue;
       
   641     TRAP_IGNORE( iApiProvider->WindowMgr().NotifyObserversL( EWindowCntDisplayed, iWindow->WindowId()));
       
   642     }
       
   643 
       
   644 
       
   645 // End of file