browserui/browser/BrowserAppSrc/BrowserWindow.cpp
changeset 51 48e827313edd
parent 37 481242ead638
child 53 f427d27b98d8
equal deleted inserted replaced
37:481242ead638 51:48e827313edd
     1 /*
       
     2 * Copyright (c) 2002 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: 
       
    15 *     Browser content view
       
    16 *     
       
    17 *
       
    18 */
       
    19 
       
    20 
       
    21 // INCLUDE FILES
       
    22 
       
    23 #include <brctldefs.h>
       
    24 #include <brctlinterface.h>
       
    25 
       
    26 #include "BrowserWindow.h"
       
    27 #include "BrowserContentView.h"
       
    28 #include "BrowserContentViewContainer.h"
       
    29 #include <browserdialogsprovider.h>
       
    30 #include "BrowserDialogsProviderProxy.h"
       
    31 #include "BrowserSoftkeysObserver.h"
       
    32 #include "BrowserSpecialLoadObserver.h"
       
    33 #include "BrowserWindowManager.h"
       
    34 
       
    35 #include "ApiProvider.h"
       
    36 #include "BrowserAppUi.h"
       
    37 #include "BrowserUIVariant.hrh"
       
    38 #include "Logger.h"
       
    39 #include "BrowserDisplay.h"
       
    40 #include "BrowserPopupEngine.h"
       
    41 #include <cdownloadmgruidownloadslist.h>
       
    42 #include <downloadmgrclient.h>
       
    43 
       
    44 // for instantiating BrCtlInterface
       
    45 #include "CommonConstants.h"
       
    46 #include "BrowserApplication.h"
       
    47 #include "BrowserAppDocument.h"
       
    48 
       
    49 #include "Preferences.h"
       
    50 
       
    51 // for dialog notes
       
    52 #include <StringLoader.h>
       
    53 #include <BrowserNG.rsg>
       
    54 #include "BrowserDialogs.h"
       
    55 
       
    56 
       
    57 #define CALL_ORIG iWindowManager->ApiProvider()->
       
    58 
       
    59 TBool CBrowserWindow::iIsPageOverviewSupportQueried = EFalse;
       
    60 TBool CBrowserWindow::iIsPageOverviewSupported = EFalse;
       
    61 
       
    62 // -----------------------------------------------------------------------------
       
    63 // CBrowserWindow::NewLC()
       
    64 // -----------------------------------------------------------------------------
       
    65 //
       
    66 CBrowserWindow* CBrowserWindow::NewLC(
       
    67         TInt aWindowId,
       
    68         const TDesC* aTargetName,
       
    69         CBrowserWindowManager* aWindowMgr )
       
    70     {
       
    71     CBrowserWindow* self = new (ELeave) 
       
    72         CBrowserWindow( aWindowId, aTargetName, aWindowMgr );
       
    73     CleanupStack::PushL( self );
       
    74     self->ConstructL();
       
    75     return self;
       
    76     }
       
    77 
       
    78 // -----------------------------------------------------------------------------
       
    79 // CBrowserWindow::NewL()
       
    80 // -----------------------------------------------------------------------------
       
    81 //
       
    82 CBrowserWindow* CBrowserWindow::NewL(
       
    83         TInt aWindowId,
       
    84         const TDesC* aTargetName,
       
    85         CBrowserWindowManager* aWindowMgr )
       
    86     {
       
    87     CBrowserWindow* self = 
       
    88         CBrowserWindow::NewLC( aWindowId, aTargetName, aWindowMgr );
       
    89     CleanupStack::Pop( self );
       
    90     return self;
       
    91     }
       
    92 
       
    93 // -----------------------------------------------------------------------------
       
    94 // CBrowserWindow::~CBrowserWindow()
       
    95 // -----------------------------------------------------------------------------
       
    96 //
       
    97 CBrowserWindow::~CBrowserWindow()
       
    98     {
       
    99     iClosing = ETrue;
       
   100     
       
   101 LOG_ENTERFN("CBrowserWindow::~CBrowserWindow");
       
   102 BROWSER_LOG( ( _L( "window id: %d" ), WindowId() ) );
       
   103 
       
   104     if( iBrCtlInterface )
       
   105         {
       
   106         iBrCtlInterface->RemoveLoadEventObserver( iLoadObserver );
       
   107         BROWSER_LOG( ( _L( " RemoveLoadEventObserver" ) ) );
       
   108         
       
   109         CBrowserContentView* cv = iWindowManager->ContentView();    
       
   110         iBrCtlInterface->RemoveStateChangeObserver( cv );
       
   111         BROWSER_LOG( ( _L( " RemoveStateChangeObserver" ) ) );
       
   112         iBrCtlInterface->RemoveCommandObserver( cv );
       
   113         BROWSER_LOG( ( _L( " RemoveCommandObserver" ) ) );
       
   114         
       
   115         
       
   116         // TRAP_IGNORE( iBrCtlInterface->HandleCommandL(
       
   117         //    (TInt)TBrCtlDefs::ECommandCancelFetch + (TInt)TBrCtlDefs::ECommandIdBase ) );
       
   118         BROWSER_LOG( ( _L( " HandleCommandL" ) ) );
       
   119         }
       
   120 
       
   121     // security indicator must be set off.
       
   122     if( iDisplay && !iWindowManager->ApiProvider()->
       
   123         Preferences().HttpSecurityWarningsStatSupressed() )
       
   124         {
       
   125         BROWSER_LOG( ( _L( " UpdateSecureIndicatorL 1" ) ) );
       
   126         TRAP_IGNORE( iDisplay->UpdateSecureIndicatorL( EAknIndicatorStateOff ) );
       
   127         BROWSER_LOG( ( _L( " UpdateSecureIndicatorL 2" ) ) );
       
   128         // we cannot do much here if error occurs... application is closing anyway
       
   129         }
       
   130     delete iDisplay;
       
   131     BROWSER_LOG( ( _L( " Display deleted.") ) );
       
   132 
       
   133     //Delete iBrCtlInterface before observers. If this is not
       
   134     //done then browser crashes on exit when page is being loaded.
       
   135     delete iBrCtlInterface;
       
   136     BROWSER_LOG( ( _L( " BrCtlInterface deleted.") ) );
       
   137 
       
   138     delete iLoadObserver;
       
   139     BROWSER_LOG( ( _L( " LoadObserver deleted.") ) );
       
   140 
       
   141     delete iDialogsProviderProxy;
       
   142     BROWSER_LOG( ( _L( " DialogsProviderProxy deleted.") ) );
       
   143 
       
   144     delete iSpecialLoadObserver;
       
   145     BROWSER_LOG( ( _L( " SpecialLoadObserver deleted.") ) );
       
   146 
       
   147     delete iSoftkeysObserver;
       
   148     BROWSER_LOG( ( _L( " SoftkeysObserver deleted.") ) );
       
   149     //
       
   150     delete iTargetName;
       
   151     }
       
   152 
       
   153 // -----------------------------------------------------------------------------
       
   154 // CBrowserWindow::CBrowserWindow()
       
   155 // -----------------------------------------------------------------------------
       
   156 //
       
   157 CBrowserWindow::CBrowserWindow(
       
   158         TInt aWindowId,
       
   159         const TDesC* aTargetName, 
       
   160         CBrowserWindowManager* aWindowMgr ) :
       
   161     iWindowId( aWindowId ),
       
   162     iActive( EFalse ),
       
   163     iFirstPage(ETrue),
       
   164     iBrCtlInterface( NULL ),
       
   165     iDialogsProviderProxy( NULL ),
       
   166     iDisplay( NULL ),
       
   167     iLoadObserver( NULL ),
       
   168     iSoftkeysObserver( NULL ),
       
   169     iSpecialLoadObserver( NULL ),
       
   170     iWindowManager( aWindowMgr )
       
   171     {
       
   172     	__ASSERT_DEBUG( (aTargetName != NULL), Util::Panic( Util::EUninitializedData ));
       
   173     	iTargetName = aTargetName->Alloc();
       
   174     }
       
   175 
       
   176 // -----------------------------------------------------------------------------
       
   177 // CBrowserWindow::ConstructL()
       
   178 // -----------------------------------------------------------------------------
       
   179 //
       
   180 void CBrowserWindow::ConstructL()
       
   181     {
       
   182 PERFLOG_LOCAL_INIT
       
   183 LOG_ENTERFN("CBrowserWindow::ConstructL");
       
   184     MApiProvider* api = iWindowManager->ApiProvider();
       
   185     CleanupStack::PushL( api );
       
   186 PERFLOG_STOPWATCH_START
       
   187     iDisplay = CBrowserDisplay::NewL( *this, *this );
       
   188 PERFLOG_STOP_WRITE("*BrowserDisplay*")
       
   189     BROWSER_LOG( ( _L( "  Multiple Display up" ) ) );
       
   190 
       
   191     CBrowserContentView* cv = iWindowManager->ContentView();
       
   192     TRect rect = cv->Container()->Rect();
       
   193 
       
   194 PERFLOG_STOPWATCH_START
       
   195     iLoadObserver = CBrowserLoadObserver::NewL( *this, *cv, *this );
       
   196     BROWSER_LOG( ( _L( "  Multiple LoadObserver up" ) ) );
       
   197 PERFLOG_STOP_WRITE("*LoadObs*")
       
   198 PERFLOG_STOPWATCH_START
       
   199     iDialogsProviderProxy = CBrowserDialogsProviderProxy::NewL( 
       
   200         api->DialogsProvider(), iLoadObserver, *this );
       
   201 PERFLOG_STOP_WRITE("*DlgProxy*")
       
   202     BROWSER_LOG( ( _L( "  Multiple CBrowserDialogsProviderProxy UP" ) ) );
       
   203 PERFLOG_STOPWATCH_START
       
   204     iSoftkeysObserver = CBrowserSoftkeysObserver::NewL( *this );
       
   205     BROWSER_LOG( ( _L( "  Multiple SoftkeyObserver up" ) ) );
       
   206 PERFLOG_STOP_WRITE("*SoftKeyObs*")
       
   207 PERFLOG_STOPWATCH_START    
       
   208     iSpecialLoadObserver = CBrowserSpecialLoadObserver::NewL( 
       
   209         *this, this, CBrowserAppUi::Static()->Document(), cv );
       
   210 PERFLOG_STOP_WRITE("*SoftKeyObs*")
       
   211     BROWSER_LOG( ( _L( "  Multiple SpecialLoadObserver up" ) ) );
       
   212 
       
   213     TInt autoLaunch( TBrCtlDefs::ECapabilityLaunchViewer );
       
   214     CBrowserAppDocument* doc = STATIC_CAST( CBrowserAppDocument*,
       
   215         CBrowserAppUi::Static()->Document() );
       
   216 
       
   217     if( doc->IsContentHandlerRegistered() )
       
   218         {
       
   219         autoLaunch = 0;
       
   220         }                                                                  
       
   221 	
       
   222 PERFLOG_STOPWATCH_START
       
   223 	TUint capabilityFlags = ( TBrCtlDefs::ECapabilityLoadHttpFw |
       
   224         TBrCtlDefs::ECapabilityDisplayScrollBar |
       
   225         TBrCtlDefs::ECapabilityConfirmDownloads | 
       
   226         TBrCtlDefs::ECapabilitySavedPage |
       
   227         TBrCtlDefs::ECapabilityUseDlMgr |
       
   228         TBrCtlDefs::ECapabilityCursorNavigation |
       
   229 		TBrCtlDefs::ECapabilityFavicon |
       
   230         TBrCtlDefs::ECapabilityToolBar |
       
   231         TBrCtlDefs::ECapabilityFitToScreen |
       
   232         autoLaunch );
       
   233         
       
   234 	if ( Preferences().UiLocalFeatureSupported( KBrowserGraphicalPage ))
       
   235 		{
       
   236 		capabilityFlags = capabilityFlags | TBrCtlDefs::ECapabilityGraphicalPage;
       
   237 		}
       
   238 	if ( Preferences().UiLocalFeatureSupported( KBrowserGraphicalPage ) &&
       
   239 			Preferences().UiLocalFeatureSupported( KBrowserGraphicalHistory ))
       
   240 		{
       
   241 		capabilityFlags = capabilityFlags | TBrCtlDefs::ECapabilityGraphicalHistory;
       
   242 		}
       
   243 	if ( Preferences().UiLocalFeatureSupported( KBrowserAutoFormFill ) )
       
   244 		{
       
   245 		capabilityFlags = capabilityFlags | TBrCtlDefs::ECapabilityAutoFormFill;
       
   246 		}
       
   247     if (Preferences().AccessKeys())
       
   248 		{
       
   249 		capabilityFlags = capabilityFlags | TBrCtlDefs::ECapabilityAccessKeys;
       
   250 		}
       
   251 		
       
   252     iBrCtlInterface = CreateBrowserControlL(
       
   253         (CCoeControl*)cv->Container(),      // parent control
       
   254         rect,                               // client rect
       
   255         capabilityFlags,                    // capabilities
       
   256         (TUint)TBrCtlDefs::ECommandIdBase,    // command base
       
   257         iSoftkeysObserver,
       
   258         (MBrCtlLinkResolver*)NULL,            // LinkResolver
       
   259         iSpecialLoadObserver,
       
   260         (MBrCtlLayoutObserver*)NULL,          // Layout Observer
       
   261         iDialogsProviderProxy,
       
   262         this                                  // Window Observer
       
   263         );
       
   264     BROWSER_LOG( ( _L( "  Multiple Plugin Br Control up, Kimono." ) ) );
       
   265         
       
   266     iBrCtlInterface->SetBrowserSettingL(TBrCtlDefs::ESettingsLaunchAppUid, KUidBrowserApplication.iUid);
       
   267     iBrCtlInterface->SetBrowserSettingL(TBrCtlDefs::ESettingsLaunchViewId, KUidBrowserBookmarksViewId.iUid);
       
   268     iBrCtlInterface->SetBrowserSettingL(TBrCtlDefs::ESettingsLaunchCustomMessageId, KUidCustomMsgDownloadsList.iUid );
       
   269     BROWSER_LOG( ( _L( "  LaunchSettings are passed." ) ) );
       
   270 
       
   271 #if defined( __RSS_FEEDS )
       
   272     TPtrC rssMimeTypes = api->FeedsClientUtilities().SupportedMimeTypesL();
       
   273     BROWSER_LOG( ( _L( "  rss SupportedMimeTypes OK" ) ) );
       
   274     TPtrC selfDownloadContentTypes = api->Preferences().SelfDownloadContentTypesL();
       
   275     BROWSER_LOG( ( _L( "  SelfDownloadContentTypesL OK" ) ) );
       
   276 
       
   277     HBufC* buf = HBufC::NewLC(
       
   278         rssMimeTypes.Length() + selfDownloadContentTypes.Length() + 2 );
       
   279     TPtr ptr( buf->Des() );
       
   280     ptr.Append( rssMimeTypes );
       
   281     ptr.Append( TChar(';') );
       
   282     ptr.Append( selfDownloadContentTypes );
       
   283     ptr.ZeroTerminate();
       
   284 
       
   285     iBrCtlInterface->SetSelfDownloadContentTypesL( ptr );
       
   286     CleanupStack::PopAndDestroy();  // buf
       
   287 #else  // __RSS_FEEDS
       
   288     TPtrC selfDownloadContentTypes = api->Preferences().SelfDownloadContentTypesL();
       
   289     BROWSER_LOG( ( _L( "  SelfDownloadContentTypesL OK" ) ) );
       
   290     iBrCtlInterface->SetSelfDownloadContentTypesL( selfDownloadContentTypes );
       
   291 #endif  // __RSS_FEEDS
       
   292     BROWSER_LOG( ( _L( "  SetSelfDownloadContentTypesL") ) );
       
   293 
       
   294     iBrCtlInterface->AddLoadEventObserverL( iLoadObserver );
       
   295     BROWSER_LOG( ( _L( "  AddLoadEventObserverL") ) );
       
   296     iBrCtlInterface->AddStateChangeObserverL( cv );
       
   297     BROWSER_LOG( ( _L( "  AddStateChangeObserverL") ) );
       
   298     iBrCtlInterface->AddCommandObserverL( cv );
       
   299     BROWSER_LOG( ( _L( "  AddCommandObserverL") ) );
       
   300 
       
   301     // Window is not added as PreferencesObserver,
       
   302     // this message flow is controlled by the WindowManager.
       
   303     
       
   304     // Each window needs to notify its Browser Control of the settings
       
   305 PERFLOG_STOP_WRITE("***BctlItem creation***")
       
   306 PERFLOG_STOPWATCH_START    
       
   307     InitialiseLocalPreferencesL();
       
   308     UpdateBrCtlSettingsL();
       
   309 PERFLOG_STOP_WRITE("***BrowserCtl Settings update***")
       
   310     CleanupStack::Pop( api );
       
   311     
       
   312     iIsPageOverviewOn = iWindowManager->ApiProvider()->Preferences().PageOverview();
       
   313     
       
   314     }
       
   315 
       
   316 // -----------------------------------------------------------------------------
       
   317 // CBrowserWindow::OpenWindowL()
       
   318 // -----------------------------------------------------------------------------
       
   319 //
       
   320 CBrCtlInterface* CBrowserWindow::OpenWindowL(
       
   321         TDesC& /* aUrl */, TDesC* aTargetName,
       
   322         TBool aUserInitiated, TAny* /* aReserved */ )
       
   323     {
       
   324     // do not create new window when the browser is being closed
       
   325     if( iClosing )
       
   326         {
       
   327         return NULL;
       
   328         }
       
   329 LOG_ENTERFN("CBrowserWindow::OpenWindowL, OSS");
       
   330 	// Do not exceed the maximum number of windows allowed
       
   331 	if ( iWindowManager->WindowCount() == 
       
   332 	     iWindowManager->MaxWindowCount() )
       
   333 	    {
       
   334 	    
       
   335 	    // Show warning to user
       
   336 	  	TBrowserDialogs::ErrorNoteL( R_BROWSER_NOTE_MAX_WINDOWS );
       
   337 	  
       
   338         return NULL;
       
   339 	    }
       
   340 	    
       
   341 	CBrCtlInterface* retVal( NULL );
       
   342 	TBool loadUrl( EFalse );    // allow fetching of url
       
   343 	
       
   344 	CBrowserPopupEngine* popup = &( iWindowManager->ApiProvider()->PopupEngine() );
       
   345 	// embedded mode doesn't allow multiple windows feature, hence popup object is NULL
       
   346 	if (!popup) {
       
   347 		return retVal;
       
   348 	}
       
   349 
       
   350     HBufC* url = BrCtlInterface().PageInfoLC( TBrCtlDefs::EPageInfoUrl );
       
   351 	if(!url)
       
   352 	{
       
   353 		//The url is already pushed on to the cleanup stack and we have the ownership of it. Pop it.
       
   354 		CleanupStack::Pop(url);
       
   355 		return NULL;
       
   356 	}
       
   357 
       
   358 	TPtrC ptr( url->Des() );
       
   359 	
       
   360 	// Check if on the whitelist, if not a user initiated open
       
   361 	// or if pop-up blocking has been disabled
       
   362 	if ( !( iWindowManager->ApiProvider()->Preferences().PopupBlocking() ) ||
       
   363             popup->IsUrlOnWhiteListL( ptr ) || 
       
   364             aUserInitiated )
       
   365 		{		
       
   366 	   	loadUrl = ETrue;    // OK to fetch the URL
       
   367 	   	}	   	
       
   368     else
       
   369         {
       
   370         // Notify user that popup was blocked        
       
   371         HBufC* popupBlocked = StringLoader::LoadLC( 
       
   372                                             R_BROWSER_NOTE_POPUP_BLOCKED );
       
   373 	  	iWindowManager->ApiProvider()->
       
   374 	  	            DialogsProvider().ShowTooltipL( *popupBlocked );
       
   375 	  	
       
   376 	  	CleanupStack::PopAndDestroy( popupBlocked );
       
   377         }
       
   378         
       
   379     CleanupStack::PopAndDestroy( url );
       
   380     
       
   381 	if ( loadUrl )
       
   382 		{
       
   383 	    // Open a new popup window
       
   384 	    CBrowserWindow* window = iWindowManager->CreateWindowL( 
       
   385 	        WindowId(), aTargetName );
       
   386 	    if (window == NULL)
       
   387     	    {
       
   388             return retVal;
       
   389     	    }
       
   390     	    
       
   391         retVal = & ( window->BrCtlInterface() );
       
   392 	    
       
   393         // do not initiate load, it does by the engine automatically
       
   394         // aUrl is empty / NULL
       
   395         
       
   396         
       
   397 	    // Indicate to the user that a new window is being opened
       
   398 	    HBufC* newWindow = StringLoader::LoadLC( R_BROWSER_NEW_WINDOW_OPENED );
       
   399 	  	iWindowManager->ApiProvider()->DialogsProvider().
       
   400             ShowTooltipL( *newWindow );
       
   401 	  	CleanupStack::PopAndDestroy( newWindow );
       
   402 	    }
       
   403 		
       
   404     return retVal;
       
   405     }
       
   406             
       
   407 // -----------------------------------------------------------------------------
       
   408 // CBrowserWindow::FindWindowL()
       
   409 // -----------------------------------------------------------------------------
       
   410 //
       
   411 CBrCtlInterface* CBrowserWindow::FindWindowL( const TDesC& aTargetName ) const
       
   412     {
       
   413     CBrowserWindow* window = iWindowManager->FindWindowL( aTargetName );
       
   414     if( window )
       
   415         return & ( window->BrCtlInterface() );
       
   416     else
       
   417         return NULL;
       
   418     }
       
   419 
       
   420 // -----------------------------------------------------------------------------
       
   421 // CBrowserWindow::HandleWindowCommandL()
       
   422 // -----------------------------------------------------------------------------
       
   423 //
       
   424 void CBrowserWindow::HandleWindowCommandL(
       
   425         const TDesC& aTargetName,
       
   426         TBrCtlWindowCommand aCommand )
       
   427     {
       
   428 LOG_ENTERFN("CBrowserWindow::HandleWindowCommandL");
       
   429 BROWSER_LOG( ( _L( "window Id: %d, aCommand: %d" ), WindowId(), aCommand ) );
       
   430     
       
   431     // KNullDesC() refers to the current window
       
   432     
       
   433     // I am NOT that targetwindow
       
   434     if( aTargetName != KNullDesC() &&  iTargetName->Compare( aTargetName ) != 0 )
       
   435         {
       
   436         // try to find that window 
       
   437         CBrowserWindow* window = iWindowManager->FindWindowL( aTargetName );
       
   438         if( window )
       
   439             {
       
   440             window->HandleWindowCommandL( aTargetName, aCommand );
       
   441             }
       
   442         else
       
   443             {
       
   444             // no window with that name
       
   445             }
       
   446         }
       
   447     else  // I am that targetwindow
       
   448         {
       
   449         switch( aCommand )
       
   450             {
       
   451             case EShowWindow:  // to activate a window after creating it
       
   452             case EFocusWindow:  // window.focus or reload
       
   453                 // focusing this window
       
   454                 {
       
   455                 // Changes were made to ClearHistory that cause it to keep one (current) page
       
   456                 // In order to reuse a window we need to clear the history again after the first new page
       
   457                 // is loaded
       
   458                 if (iFirstPage)
       
   459 	            	{
       
   460 	            	BrCtlInterface().HandleCommandL((TInt)TBrCtlDefs::ECommandClearHistory + (TInt)TBrCtlDefs::ECommandIdBase);
       
   461 	            	iFirstPage = EFalse;
       
   462 	            	}
       
   463 				iWindowManager->SwitchWindowL( WindowId() );
       
   464                 break;
       
   465                 }
       
   466             case EUnfocusWindow:  // focusing the last active window
       
   467                 {
       
   468                 // iWindowManager->SwitchWindowL( );
       
   469                 break;
       
   470                 }
       
   471             case ECloseWindow:
       
   472                 {
       
   473                 CBrowserAppUi::Static()->CloseWindowL( WindowId() );
       
   474                 break;
       
   475                 }
       
   476 //            case EDisableScriptLog:
       
   477 //                iWindowManager->ApiProvider()->Preferences().SetScriptLogL( TBrCtlDefs::EScriptLogDisable );
       
   478 //                break;
       
   479             default:
       
   480                 {
       
   481                 break;
       
   482                 }
       
   483             }
       
   484         }
       
   485     }
       
   486 
       
   487 // ---------------------------------------------------------
       
   488 // CBrowserWindow::IsPageOverviewSupported
       
   489 // ---------------------------------------------------------
       
   490 // 
       
   491 TBool CBrowserWindow::IsPageOverviewSupportedL() 
       
   492     {
       
   493     if(!iIsPageOverviewSupportQueried)
       
   494         {
       
   495         iIsPageOverviewSupported = iBrCtlInterface->BrowserSettingL(
       
   496             TBrCtlDefs::ESettingsPageOverview );
       
   497         iIsPageOverviewSupportQueried = ETrue;                
       
   498         }
       
   499     
       
   500     return iIsPageOverviewSupported;    
       
   501     }
       
   502     
       
   503 // -----------------------------------------------------------------------------
       
   504 // CBrowserWindow::ResetPageOverviewLocalSettingL()
       
   505 // -----------------------------------------------------------------------------
       
   506 //	
       
   507 void CBrowserWindow::ResetPageOverviewLocalSettingL()
       
   508     {
       
   509     iIsPageOverviewOn = 
       
   510         iWindowManager->ApiProvider()->Preferences().PageOverview();
       
   511     BrCtlInterface().SetBrowserSettingL(TBrCtlDefs::ESettingsPageOverview,
       
   512                                         iIsPageOverviewOn );
       
   513     }        
       
   514 
       
   515 // -----------------------------------------------------------------------------
       
   516 // CBrowserWindow::ChangeTitlePaneTextUntilL()
       
   517 // -----------------------------------------------------------------------------
       
   518 //	
       
   519 void CBrowserWindow::ChangeTitlePaneTextUntilL(
       
   520         const TDesC& aTitle, TInt /* aInterval */ )
       
   521     {
       
   522     iWindowManager->ApiProvider()->DialogsProvider().ShowTooltipL( aTitle );
       
   523     }
       
   524     		    
       
   525 // -----------------------------------------------------------------------------
       
   526 // CBrowserWindow::FlipPageOverviewLocalSettingL()
       
   527 // -----------------------------------------------------------------------------
       
   528 //	
       
   529 void CBrowserWindow::FlipPageOverviewLocalSettingL()
       
   530     {  
       
   531     iIsPageOverviewOn = !iIsPageOverviewOn;
       
   532     BrCtlInterface().SetBrowserSettingL( TBrCtlDefs::ESettingsPageOverview, 
       
   533                                          iIsPageOverviewOn );                                            
       
   534     TInt tooltipResource = iIsPageOverviewOn ? 
       
   535         R_BROWSER_TOOLTIP_PAGE_OVERVIEW_ON : R_BROWSER_TOOLTIP_PAGE_OVERVIEW_OFF;
       
   536     HBufC* overviewTooltip = StringLoader::LoadLC( tooltipResource );
       
   537   
       
   538   	iWindowManager->ApiProvider()->DialogsProvider().ShowTooltipL( *overviewTooltip );  	
       
   539   	CleanupStack::PopAndDestroy( overviewTooltip );                                     
       
   540     }
       
   541     
       
   542 // -----------------------------------------------------------------------------
       
   543 // CBrowserWindow::BrCtlInterface()
       
   544 // -----------------------------------------------------------------------------
       
   545 //
       
   546 CBrCtlInterface& CBrowserWindow::BrCtlInterface() const
       
   547     {
       
   548     return *iBrCtlInterface;
       
   549     }
       
   550 
       
   551 // -----------------------------------------------------------------------------
       
   552 // CBrowserWindow::Display()
       
   553 // -----------------------------------------------------------------------------
       
   554 //
       
   555 MDisplay& CBrowserWindow::Display() const
       
   556     {
       
   557     return *iDisplay;
       
   558     }
       
   559 
       
   560 // -----------------------------------------------------------------------------
       
   561 // CBrowserWindow::LoadObserver()
       
   562 // -----------------------------------------------------------------------------
       
   563 //
       
   564 CBrowserLoadObserver& CBrowserWindow::LoadObserver() const
       
   565     {
       
   566     return *iLoadObserver;
       
   567     }
       
   568 
       
   569 // -----------------------------------------------------------------------------
       
   570 // CBrowserWindow::SoftkeysObserver()
       
   571 // -----------------------------------------------------------------------------
       
   572 //
       
   573 CBrowserSoftkeysObserver& CBrowserWindow::SoftkeysObserver() const
       
   574     {
       
   575     return *iSoftkeysObserver;
       
   576     }
       
   577 
       
   578 // -----------------------------------------------------------------------------
       
   579 // CBrowserWindow::SpecialLoadObserver()
       
   580 // -----------------------------------------------------------------------------
       
   581 //
       
   582 CBrowserSpecialLoadObserver& CBrowserWindow::SpecialLoadObserver() const
       
   583     {
       
   584     return *iSpecialLoadObserver;
       
   585     }
       
   586 
       
   587 // ----------------------------------------------------------------------------
       
   588 // CBrowserWindow::HandlePreferencesChangeL()
       
   589 // ----------------------------------------------------------------------------
       
   590 //
       
   591 void CBrowserWindow::HandlePreferencesChangeL( 
       
   592                                     TPreferencesEvent aEvent,
       
   593                                     TPreferencesValues& aValues,
       
   594                                     TBrCtlDefs::TBrCtlSettings aSettingType  )
       
   595     {
       
   596     switch ( aEvent )
       
   597         {
       
   598         case EPreferencesActivate:
       
   599             {
       
   600             // Provide local settings
       
   601             aValues.iFontSize = iFontSize;
       
   602             aValues.iTextWrap = iTextWrap;
       
   603             aValues.iEncoding = iEncoding;
       
   604             break;
       
   605             }
       
   606         case EPreferencesDeactivate:
       
   607             {
       
   608             // Save local preferences and notify Browser Control
       
   609             if ( iActive )  // Topmost window only
       
   610                 {
       
   611                 UpdateLocalPreferencesL( aValues );
       
   612                 }
       
   613             break;
       
   614             }
       
   615         case EPreferencesItemChange:
       
   616             {
       
   617             // All preferences changes should notify the 
       
   618             // Browser Control
       
   619             UpdateGlobalPreferencesL( aSettingType );
       
   620             
       
   621             if ( iActive )  // Topmost window only
       
   622                 {
       
   623                 UpdateLocalPreferencesL( aValues );
       
   624                 // Change the local setting to the changed setting.
       
   625                 iIsPageOverviewOn = iWindowManager->ApiProvider()->Preferences().PageOverview();
       
   626                 }                                            
       
   627             break;
       
   628             }
       
   629         default:
       
   630             // Do nothing
       
   631             break;
       
   632         }
       
   633     }
       
   634 
       
   635 // -----------------------------------------------------------------------------
       
   636 // CBrowserWindow::UpdateGlobalPreferencesL()
       
   637 // -----------------------------------------------------------------------------
       
   638 //
       
   639 void CBrowserWindow::UpdateGlobalPreferencesL( 
       
   640                                     TBrCtlDefs::TBrCtlSettings aSettingType )
       
   641     {
       
   642     // Local Settings should be ignored
       
   643     switch ( aSettingType )
       
   644         {
       
   645         case TBrCtlDefs::ESettingsAutoLoadImages:
       
   646                 {               
       
   647         // WebEngine has two different settings for Content Autoload enable/disable:
       
   648         // AutoLoad Images - True/False and Disable flash - True/False        
       
   649         // Here is how the Load Content setting in UI maps to the Image and 
       
   650         // Flash settings in Webengine in case flash Plugin is present
       
   651         // Load Content = 0, AutoLoadImages = 0, DisableFlash = 1
       
   652         // Load Content = 1, AutoLoadImages = 1, DisableFlash = 1
       
   653         // Load Content = 2, AutoLoadImages = 1, DisableFlash = 0
       
   654         // In case flash plugin is not present
       
   655         // Load Content = 0, AutoLoadImages = 0, DisableFlash = 1
       
   656         // Load Content = 1, AutoLoadImages = 1, DisableFlash = 1
       
   657         
       
   658                 iBrCtlInterface->SetBrowserSettingL( 
       
   659                                             TBrCtlDefs::ESettingsAutoLoadImages,
       
   660                                             ((Preferences().AutoLoadContent() == EWmlSettingsAutoloadText)
       
   661                                              ?EFalse:ETrue));
       
   662                 
       
   663                 iBrCtlInterface->SetBrowserSettingL( 
       
   664                                             TBrCtlDefs::ESettingsDisableFlash,                                                            
       
   665                                             ((Preferences().AutoLoadContent() == EWmlSettingsAutoloadAll)
       
   666                                              ?EFalse:ETrue));                                                                                       
       
   667                 break;
       
   668                 }
       
   669         case TBrCtlDefs::ESettingsEmbedded:
       
   670                 {
       
   671                 iBrCtlInterface->SetBrowserSettingL( 
       
   672                                             TBrCtlDefs::ESettingsEmbedded, 
       
   673                                             Preferences().EmbeddedMode() );
       
   674                 break;
       
   675                 }
       
   676         case TBrCtlDefs::ESettingsCookiesEnabled:
       
   677                 {
       
   678                 iBrCtlInterface->SetBrowserSettingL( 
       
   679                                             TBrCtlDefs::ESettingsCookiesEnabled, 
       
   680                                             Preferences().Cookies() );
       
   681                 break;
       
   682                 }
       
   683         case TBrCtlDefs::ESettingsECMAScriptEnabled:
       
   684                 {
       
   685                 iBrCtlInterface->SetBrowserSettingL( 
       
   686                                             TBrCtlDefs::ESettingsECMAScriptEnabled, 
       
   687                                             Preferences().Ecma() );
       
   688                 break;
       
   689                 }
       
   690         case TBrCtlDefs::ESettingsScriptLog:
       
   691                 {
       
   692                 iBrCtlInterface->SetBrowserSettingL( 
       
   693                                             TBrCtlDefs::ESettingsScriptLog, 
       
   694                                             Preferences().ScriptLog() );
       
   695                 break;
       
   696                 }
       
   697         case TBrCtlDefs::ESettingsIMEINotifyEnabled:
       
   698                 {
       
   699                 iBrCtlInterface->SetBrowserSettingL( 
       
   700                                             TBrCtlDefs::ESettingsIMEINotifyEnabled, 
       
   701                                             Preferences().IMEINotification() );
       
   702                 break;
       
   703                 }
       
   704         case TBrCtlDefs::ESettingsSendRefererHeader:
       
   705                 {
       
   706                 iBrCtlInterface->SetBrowserSettingL( 
       
   707                                             TBrCtlDefs::ESettingsSendRefererHeader, 
       
   708                                             Preferences().SendReferrer() );
       
   709                 break;
       
   710                 }
       
   711         case TBrCtlDefs::ESettingsSecurityWarnings:
       
   712                 {
       
   713                 iBrCtlInterface->SetBrowserSettingL( 
       
   714                                             TBrCtlDefs::ESettingsSecurityWarnings, 
       
   715                                             Preferences().HttpSecurityWarnings() );
       
   716                 break;
       
   717                 }
       
   718 
       
   719         case TBrCtlDefs::ESettingsAutoOpenDownloads:
       
   720                 {
       
   721                 iBrCtlInterface->SetBrowserSettingL( 
       
   722                                             TBrCtlDefs::ESettingsAutoOpenDownloads, 
       
   723                                             Preferences().DownloadsOpen() );
       
   724                 break;
       
   725                 }
       
   726 
       
   727         case TBrCtlDefs::ESettingsPageOverview:
       
   728         		{
       
   729         		if( IsPageOverviewSupportedL() )
       
   730         		    {
       
   731                     iBrCtlInterface->SetBrowserSettingL( 
       
   732                         TBrCtlDefs::ESettingsPageOverview, 
       
   733                         Preferences().PageOverview() );
       
   734         		    }
       
   735                 break;
       
   736                 } 
       
   737         case TBrCtlDefs::ESettingsBackList:
       
   738         		{
       
   739                 iBrCtlInterface->SetBrowserSettingL( 
       
   740                                             TBrCtlDefs::ESettingsBackList, 
       
   741                                             Preferences().BackList() );
       
   742                 break;
       
   743                 } 
       
   744         case TBrCtlDefs::ESettingsAutoRefresh:
       
   745         		{
       
   746                 iBrCtlInterface->SetBrowserSettingL( 
       
   747                                             TBrCtlDefs::ESettingsAutoRefresh, 
       
   748                                             Preferences().AutoRefresh() );
       
   749                 break;
       
   750                 }
       
   751         case TBrCtlDefs::ESettingsAutoFormFillEnabled:
       
   752             {
       
   753             iBrCtlInterface->SetBrowserSettingL(
       
   754                                         TBrCtlDefs::ESettingsAutoFormFillEnabled,
       
   755                                         Preferences().FormDataSaving() );
       
   756             break;
       
   757             }
       
   758         case TBrCtlDefs::ESettingsToolbarOnOff:
       
   759         	{
       
   760         	iBrCtlInterface->SetBrowserSettingL(
       
   761                                         TBrCtlDefs::ESettingsToolbarOnOff,
       
   762                                         Preferences().ShowToolbarOnOff() );
       
   763             break;
       
   764         	}
       
   765         case TBrCtlDefs::ESettingsToolbarButton1Cmd:
       
   766         	{
       
   767         	iBrCtlInterface->SetBrowserSettingL(
       
   768                                         TBrCtlDefs::ESettingsToolbarButton1Cmd,
       
   769                                         Preferences().ShowToolbarButton1Cmd() );
       
   770             break;
       
   771         	}
       
   772         case TBrCtlDefs::ESettingsToolbarButton2Cmd:
       
   773         	{
       
   774         	iBrCtlInterface->SetBrowserSettingL(
       
   775                                         TBrCtlDefs::ESettingsToolbarButton2Cmd,
       
   776                                         Preferences().ShowToolbarButton2Cmd() );
       
   777             break;
       
   778         	}
       
   779         case TBrCtlDefs::ESettingsToolbarButton3Cmd:
       
   780         	{
       
   781         	iBrCtlInterface->SetBrowserSettingL(
       
   782                                         TBrCtlDefs::ESettingsToolbarButton3Cmd,
       
   783                                         Preferences().ShowToolbarButton3Cmd() );
       
   784             break;
       
   785         	}
       
   786         case TBrCtlDefs::ESettingsToolbarButton4Cmd:
       
   787         	{
       
   788         	iBrCtlInterface->SetBrowserSettingL(
       
   789                                         TBrCtlDefs::ESettingsToolbarButton4Cmd,
       
   790                                         Preferences().ShowToolbarButton4Cmd() );
       
   791             break;
       
   792         	}
       
   793         case TBrCtlDefs::ESettingsToolbarButton5Cmd:
       
   794         	{
       
   795         	iBrCtlInterface->SetBrowserSettingL(
       
   796                                         TBrCtlDefs::ESettingsToolbarButton5Cmd,
       
   797                                         Preferences().ShowToolbarButton5Cmd() );
       
   798             break;
       
   799         	}
       
   800         case TBrCtlDefs::ESettingsToolbarButton6Cmd:
       
   801         	{
       
   802         	iBrCtlInterface->SetBrowserSettingL(
       
   803                                         TBrCtlDefs::ESettingsToolbarButton6Cmd,
       
   804                                         Preferences().ShowToolbarButton6Cmd() );
       
   805             break;
       
   806         	}
       
   807         case TBrCtlDefs::ESettingsToolbarButton7Cmd:
       
   808         	{
       
   809         	iBrCtlInterface->SetBrowserSettingL(
       
   810                                         TBrCtlDefs::ESettingsToolbarButton7Cmd,
       
   811                                         Preferences().ShowToolbarButton7Cmd() );
       
   812             break;
       
   813         	}
       
   814         case TBrCtlDefs::ESettingsZoomLevelMin:
       
   815             {
       
   816             iBrCtlInterface->SetBrowserSettingL(
       
   817                                         TBrCtlDefs::ESettingsZoomLevelMin,
       
   818                                         Preferences().ZoomLevelMinimum() );
       
   819             break;
       
   820             }
       
   821         case TBrCtlDefs::ESettingsZoomLevelMax:
       
   822             {
       
   823             iBrCtlInterface->SetBrowserSettingL(
       
   824                                         TBrCtlDefs::ESettingsZoomLevelMax,
       
   825                                         Preferences().ZoomLevelMaximum() );
       
   826             break;
       
   827             }
       
   828         case TBrCtlDefs::ESettingsZoomLevelDefault:
       
   829             {
       
   830             iBrCtlInterface->SetBrowserSettingL(
       
   831                                         TBrCtlDefs::ESettingsZoomLevelDefault,
       
   832                                         Preferences().ZoomLevelDefault() );
       
   833             break; 
       
   834             }
       
   835         case TBrCtlDefs::ESettingsCursorShowMode:
       
   836             {
       
   837             iBrCtlInterface->SetBrowserSettingL(
       
   838                                         TBrCtlDefs::ESettingsCursorShowMode,
       
   839                                         Preferences().CursorShowMode() );
       
   840             break; 
       
   841             }
       
   842             
       
   843         case TBrCtlDefs::ESettingsEnterKeyMode:
       
   844             {
       
   845             iBrCtlInterface->SetBrowserSettingL(
       
   846                                         TBrCtlDefs::ESettingsEnterKeyMode,
       
   847                                         Preferences().EnterKeyMode() );
       
   848             break; 
       
   849             }
       
   850 
       
   851         // LOCAL SETTINGS should be ignored
       
   852         case TBrCtlDefs::ESettingsTextWrapEnabled:
       
   853         case TBrCtlDefs::ESettingsFontSize:
       
   854         case TBrCtlDefs::ESettingsCharacterset:
       
   855             {            
       
   856             break;
       
   857             }
       
   858         case TBrCtlDefs::ESettingsUnknown: // ignore
       
   859         default:
       
   860             break;
       
   861         }
       
   862     }
       
   863 
       
   864 // -----------------------------------------------------------------------------
       
   865 // CBrowserWindow::UpdateLocalPreferencesL()
       
   866 // -----------------------------------------------------------------------------
       
   867 //
       
   868 void CBrowserWindow::UpdateLocalPreferencesL( TPreferencesValues& aValues )
       
   869     {
       
   870     if ( iFontSize != aValues.iFontSize )
       
   871         {
       
   872         iFontSize = aValues.iFontSize;
       
   873         iBrCtlInterface->SetBrowserSettingL( 
       
   874                 ( TUint ) TBrCtlDefs::ESettingsFontSize, iFontSize );
       
   875         }
       
   876     
       
   877     if ( iTextWrap != aValues.iTextWrap )
       
   878         {
       
   879         iTextWrap = aValues.iTextWrap;
       
   880         iBrCtlInterface->SetBrowserSettingL( 
       
   881                 ( TUint ) TBrCtlDefs::ESettingsTextWrapEnabled,  iTextWrap );
       
   882         }
       
   883     if ( iEncoding != aValues.iEncoding )
       
   884         {
       
   885         iEncoding = aValues.iEncoding;
       
   886         iBrCtlInterface->SetBrowserSettingL( 
       
   887                 ( TUint ) TBrCtlDefs::ESettingsCharacterset, iEncoding );
       
   888         }
       
   889     }
       
   890 
       
   891 // -----------------------------------------------------------------------------
       
   892 // CBrowserWindow::InitialiseLocalPreferencesL()
       
   893 // -----------------------------------------------------------------------------
       
   894 //
       
   895 void CBrowserWindow::InitialiseLocalPreferencesL()
       
   896     {
       
   897     // Initialise local settings from Central Repository
       
   898     const TPreferencesValues& pref = Preferences().AllPreferencesL();
       
   899     iFontSize = pref.iFontSize;
       
   900     iTextWrap = pref.iTextWrap;
       
   901     iEncoding = pref.iEncoding;
       
   902     }
       
   903     
       
   904 // ----------------------------------------------------------------------------
       
   905 // CBrowserWindow::UpdateBrCtlSettingsL()
       
   906 // ----------------------------------------------------------------------------
       
   907 //
       
   908 void CBrowserWindow::UpdateBrCtlSettingsL()
       
   909     {
       
   910     LOG_ENTERFN("CBrowserPreferences::UpdateBrCtlSettingsL");
       
   911 
       
   912     UpdateGlobalPreferencesL( TBrCtlDefs::ESettingsSmallScreen );
       
   913     UpdateGlobalPreferencesL( TBrCtlDefs::ESettingsAutoLoadImages );
       
   914     UpdateGlobalPreferencesL( TBrCtlDefs::ESettingsEmbedded );
       
   915     UpdateGlobalPreferencesL( TBrCtlDefs::ESettingsCookiesEnabled );
       
   916     UpdateGlobalPreferencesL( TBrCtlDefs::ESettingsCSSFetchEnabled );
       
   917     UpdateGlobalPreferencesL( TBrCtlDefs::ESettingsECMAScriptEnabled );
       
   918     UpdateGlobalPreferencesL( TBrCtlDefs::ESettingsScriptLog );
       
   919     UpdateGlobalPreferencesL( TBrCtlDefs::ESettingsIMEINotifyEnabled );
       
   920     UpdateGlobalPreferencesL( TBrCtlDefs::ESettingsSendRefererHeader );
       
   921     UpdateGlobalPreferencesL( TBrCtlDefs::ESettingsSecurityWarnings );
       
   922     UpdateGlobalPreferencesL( TBrCtlDefs::ESettingsAutoOpenDownloads );    
       
   923 	UpdateGlobalPreferencesL( TBrCtlDefs::ESettingsPageOverview );
       
   924 	UpdateGlobalPreferencesL( TBrCtlDefs::ESettingsBackList );
       
   925 	UpdateGlobalPreferencesL( TBrCtlDefs::ESettingsAutoRefresh );
       
   926 
       
   927 	UpdateGlobalPreferencesL( TBrCtlDefs::ESettingsAutoFormFillEnabled );
       
   928 	
       
   929 	UpdateGlobalPreferencesL( TBrCtlDefs::ESettingsToolbarOnOff );
       
   930 	UpdateGlobalPreferencesL( TBrCtlDefs::ESettingsToolbarButton1Cmd );
       
   931 	UpdateGlobalPreferencesL( TBrCtlDefs::ESettingsToolbarButton2Cmd );
       
   932 	UpdateGlobalPreferencesL( TBrCtlDefs::ESettingsToolbarButton3Cmd );
       
   933 	UpdateGlobalPreferencesL( TBrCtlDefs::ESettingsToolbarButton4Cmd );
       
   934 	UpdateGlobalPreferencesL( TBrCtlDefs::ESettingsToolbarButton5Cmd );
       
   935 	UpdateGlobalPreferencesL( TBrCtlDefs::ESettingsToolbarButton6Cmd );
       
   936 	UpdateGlobalPreferencesL( TBrCtlDefs::ESettingsToolbarButton7Cmd );
       
   937 	UpdateGlobalPreferencesL( TBrCtlDefs::ESettingsZoomLevelMin );
       
   938 	UpdateGlobalPreferencesL( TBrCtlDefs::ESettingsZoomLevelMax );
       
   939 	UpdateGlobalPreferencesL( TBrCtlDefs::ESettingsZoomLevelDefault );
       
   940 
       
   941 	UpdateGlobalPreferencesL( TBrCtlDefs::ESettingsCursorShowMode );
       
   942 	UpdateGlobalPreferencesL( TBrCtlDefs::ESettingsEnterKeyMode );
       
   943 	
       
   944     // Font Size - LOCAL Setting
       
   945     iBrCtlInterface->SetBrowserSettingL( TBrCtlDefs::ESettingsFontSize,
       
   946             iWindowManager->ApiProvider()->Preferences().FontSize() );
       
   947                         
       
   948     // Text Wrap - LOCAL Setting
       
   949     iBrCtlInterface->SetBrowserSettingL( TBrCtlDefs::ESettingsTextWrapEnabled,
       
   950             iWindowManager->ApiProvider()->Preferences().TextWrap() );
       
   951                         
       
   952     // Encoding - LOCAL Setting
       
   953     iBrCtlInterface->SetBrowserSettingL( TBrCtlDefs::ESettingsCharacterset, 
       
   954             iWindowManager->ApiProvider()->Preferences().Encoding() );
       
   955     }
       
   956 
       
   957 // -----------------------------------------------------------------------------
       
   958 // CBrowserWindow::ActivateL()
       
   959 // -----------------------------------------------------------------------------
       
   960 //
       
   961 void CBrowserWindow::ActivateL( TBool aDraw )
       
   962     {
       
   963 LOG_ENTERFN("CBrowserWindow::ActivateL");
       
   964 BROWSER_LOG( ( _L( "Activating window no. %d" ), WindowId() ) );
       
   965     iDialogsProviderProxy->WindowActivated();
       
   966     iBrCtlInterface->MakeVisible( ETrue );  // notify the engine
       
   967     iActive = ETrue;
       
   968     if( aDraw )
       
   969         {
       
   970         iBrCtlInterface->DrawNow();
       
   971         CBrowserContentView* cv = iWindowManager->ContentView();
       
   972         cv->UpdateFullScreenL();
       
   973         TRAP_IGNORE(Display().StopProgressAnimationL());//also updates title
       
   974         }       
       
   975     WindowMgr().NotifyObserversL( EWindowActivate, WindowId() );
       
   976     }
       
   977 
       
   978 // -----------------------------------------------------------------------------
       
   979 // CBrowserWindow::DeactivateL()
       
   980 // -----------------------------------------------------------------------------
       
   981 //
       
   982 void CBrowserWindow::DeactivateL()
       
   983     {
       
   984 LOG_ENTERFN("CBrowserWindow::DeactivateL");
       
   985 BROWSER_LOG( ( _L( "Deactivating window no. %d" ), WindowId() ) );
       
   986     iActive = EFalse;
       
   987     iBrCtlInterface->MakeVisible( EFalse ); // notify the engine
       
   988     }
       
   989 
       
   990 // -----------------------------------------------------------------------------
       
   991 // CBrowserWindow::Connection
       
   992 // -----------------------------------------------------------------------------
       
   993 //
       
   994 MConnection& CBrowserWindow::Connection() const
       
   995     {
       
   996     return CALL_ORIG Connection();
       
   997     }
       
   998 
       
   999 // -----------------------------------------------------------------------------
       
  1000 // CBrowserWindow::Preferences()
       
  1001 // -----------------------------------------------------------------------------
       
  1002 //
       
  1003 MPreferences& CBrowserWindow::Preferences() const
       
  1004     {
       
  1005     return CALL_ORIG Preferences(); 
       
  1006     }
       
  1007 
       
  1008 // -----------------------------------------------------------------------------
       
  1009 // CBrowserWindow::CommsModel
       
  1010 // -----------------------------------------------------------------------------
       
  1011 //
       
  1012 MCommsModel& CBrowserWindow::CommsModel() const
       
  1013     {
       
  1014     return CALL_ORIG CommsModel();
       
  1015     }
       
  1016 
       
  1017 // -----------------------------------------------------------------------------
       
  1018 // CBrowserWindow::DialogsProvider()
       
  1019 // -----------------------------------------------------------------------------
       
  1020 //
       
  1021 CBrowserDialogsProvider& CBrowserWindow::DialogsProvider() const
       
  1022     {
       
  1023 	__ASSERT_DEBUG( (iDialogsProviderProxy != NULL), Util::Panic( Util::EUninitializedData ));
       
  1024     return *( (CBrowserDialogsProvider*)iDialogsProviderProxy );
       
  1025     }
       
  1026 
       
  1027 // -----------------------------------------------------------------------------
       
  1028 // CBrowserWindow::BmOTABinSender
       
  1029 // -----------------------------------------------------------------------------
       
  1030 //
       
  1031 MBmOTABinSender& CBrowserWindow::BmOTABinSenderL()
       
  1032     {
       
  1033     return CALL_ORIG BmOTABinSenderL();
       
  1034     }
       
  1035 
       
  1036 // -----------------------------------------------------------------------------
       
  1037 // CBrowserWindow::PopupEngine
       
  1038 // -----------------------------------------------------------------------------
       
  1039 //
       
  1040 CBrowserPopupEngine& CBrowserWindow::PopupEngine() const
       
  1041     {
       
  1042     return CALL_ORIG PopupEngine();
       
  1043     }
       
  1044 
       
  1045 // -----------------------------------------------------------------------------
       
  1046 // CBrowserWindow::SetViewToBeActivatedIfNeededL
       
  1047 // -----------------------------------------------------------------------------
       
  1048 //
       
  1049 void CBrowserWindow::SetViewToBeActivatedIfNeededL(
       
  1050     TUid aUid,
       
  1051     TInt aMessageId )
       
  1052     {
       
  1053     CALL_ORIG SetViewToBeActivatedIfNeededL( aUid, aMessageId );
       
  1054     }
       
  1055 
       
  1056 // -----------------------------------------------------------------------------
       
  1057 // CBrowserWindow::IsCancelFetchAllowed
       
  1058 // -----------------------------------------------------------------------------
       
  1059 //
       
  1060 TBool CBrowserWindow::IsCancelFetchAllowed() const
       
  1061     {
       
  1062     return CALL_ORIG IsCancelFetchAllowed();
       
  1063     }
       
  1064 
       
  1065 // -----------------------------------------------------------------------------
       
  1066 // CBrowserWindow::LastActiveViewId
       
  1067 // -----------------------------------------------------------------------------
       
  1068 //
       
  1069 TUid CBrowserWindow::LastActiveViewId() const
       
  1070     {
       
  1071     return CALL_ORIG LastActiveViewId();
       
  1072     }
       
  1073 
       
  1074 // -----------------------------------------------------------------------------
       
  1075 // CBrowserWindow::SetLastActiveViewId
       
  1076 // -----------------------------------------------------------------------------
       
  1077 //
       
  1078 void CBrowserWindow::SetLastActiveViewId( TUid aUid )
       
  1079     {
       
  1080     CALL_ORIG SetLastActiveViewId( aUid );
       
  1081     }
       
  1082 
       
  1083 // -----------------------------------------------------------------------------
       
  1084 // CBrowserWindow::ExitInProgress
       
  1085 // -----------------------------------------------------------------------------
       
  1086 //
       
  1087 TBool CBrowserWindow::ExitInProgress() const
       
  1088     {
       
  1089     return CALL_ORIG ExitInProgress();
       
  1090     }
       
  1091 
       
  1092 // -----------------------------------------------------------------------------
       
  1093 // CBrowserWindow::SetExitInProgress
       
  1094 // -----------------------------------------------------------------------------
       
  1095 //
       
  1096 void CBrowserWindow::SetExitInProgress( TBool aValue )
       
  1097     {
       
  1098     CALL_ORIG SetExitInProgress( aValue );
       
  1099     }
       
  1100 
       
  1101 // -----------------------------------------------------------------------------
       
  1102 // CBrowserWindow::IsConnecting
       
  1103 // -----------------------------------------------------------------------------
       
  1104 //
       
  1105 TBool CBrowserWindow::IsConnecting() const
       
  1106     {
       
  1107     return CALL_ORIG IsConnecting();
       
  1108     }
       
  1109 
       
  1110 // -----------------------------------------------------------------------------
       
  1111 // CBrowserWindow::UpdateNaviPaneL
       
  1112 // -----------------------------------------------------------------------------
       
  1113 //
       
  1114 void CBrowserWindow::UpdateNaviPaneL( TDesC& aStatusMsg )
       
  1115     {
       
  1116     CALL_ORIG UpdateNaviPaneL( aStatusMsg );
       
  1117     }
       
  1118 
       
  1119 // -----------------------------------------------------------------------------
       
  1120 // CBrowserWindow::SetViewToReturnOnClose
       
  1121 // -----------------------------------------------------------------------------
       
  1122 //
       
  1123 void CBrowserWindow::SetViewToReturnOnClose( TUid const &aUid )
       
  1124     {
       
  1125     CALL_ORIG SetViewToReturnOnClose( aUid );
       
  1126     }
       
  1127 
       
  1128 // -----------------------------------------------------------------------------
       
  1129 // CBrowserWindow::CloseContentViewL
       
  1130 // -----------------------------------------------------------------------------
       
  1131 //
       
  1132 void CBrowserWindow::CloseContentViewL()
       
  1133     {
       
  1134     CALL_ORIG CloseContentViewL();
       
  1135     }
       
  1136 
       
  1137 // -----------------------------------------------------------------------------
       
  1138 // CBrowserWindow::IsEmbeddedModeOn
       
  1139 // -----------------------------------------------------------------------------
       
  1140 //
       
  1141 TBool CBrowserWindow::IsEmbeddedModeOn() const
       
  1142     {
       
  1143     return CALL_ORIG IsEmbeddedModeOn();
       
  1144     }
       
  1145 
       
  1146 // -----------------------------------------------------------------------------
       
  1147 // CBrowserWindow::IsShutdownRequested
       
  1148 // -----------------------------------------------------------------------------
       
  1149 //
       
  1150 TBool CBrowserWindow::IsShutdownRequested() const
       
  1151     {
       
  1152     return CALL_ORIG IsShutdownRequested();
       
  1153     }
       
  1154 
       
  1155 // -----------------------------------------------------------------------------
       
  1156 // CBrowserWindow::ExitBrowser
       
  1157 // -----------------------------------------------------------------------------
       
  1158 //
       
  1159 void CBrowserWindow::ExitBrowser( TBool aUserShutdown )
       
  1160     {
       
  1161     CALL_ORIG ExitBrowser( aUserShutdown );
       
  1162     }
       
  1163 
       
  1164 // -----------------------------------------------------------------------------
       
  1165 // CBrowserWindow::IsAppShutterActive
       
  1166 // -----------------------------------------------------------------------------
       
  1167 //
       
  1168 TBool CBrowserWindow::IsAppShutterActive() const
       
  1169     {
       
  1170     return CALL_ORIG IsAppShutterActive();
       
  1171     }
       
  1172 
       
  1173 // -----------------------------------------------------------------------------
       
  1174 // CBrowserWindow::StartPreferencesViewL
       
  1175 // -----------------------------------------------------------------------------
       
  1176 //
       
  1177 TBool CBrowserWindow::StartPreferencesViewL( TUint aListItems )
       
  1178     {
       
  1179     return CALL_ORIG StartPreferencesViewL( aListItems );
       
  1180     }
       
  1181 
       
  1182 // -----------------------------------------------------------------------------
       
  1183 // CBrowserWindow::IsPageLoaded
       
  1184 // -----------------------------------------------------------------------------
       
  1185 //
       
  1186 TBool CBrowserWindow::IsPageLoaded()
       
  1187     {
       
  1188     return CALL_ORIG IsPageLoaded();
       
  1189     }
       
  1190 
       
  1191 // -----------------------------------------------------------------------------
       
  1192 // CBrowserWindow::IsForeGround
       
  1193 // -----------------------------------------------------------------------------
       
  1194 //
       
  1195 TBool CBrowserWindow::IsForeGround() const
       
  1196     {
       
  1197     return CALL_ORIG IsForeGround();
       
  1198     }
       
  1199 
       
  1200 // -----------------------------------------------------------------------------
       
  1201 // CBrowserWindow::Fetching
       
  1202 // -----------------------------------------------------------------------------
       
  1203 //
       
  1204 TBool CBrowserWindow::Fetching() const
       
  1205     {
       
  1206     return CALL_ORIG Fetching();
       
  1207     }
       
  1208 // -----------------------------------------------------------------------------
       
  1209 // CBrowserWindow::ContentDisplayed
       
  1210 // -----------------------------------------------------------------------------
       
  1211 //
       
  1212 TBool CBrowserWindow::ContentDisplayed() const
       
  1213     {
       
  1214     return CALL_ORIG ContentDisplayed();
       
  1215     }
       
  1216 // -----------------------------------------------------------------------------
       
  1217 // CBrowserWindow::SetContentDisplayed
       
  1218 // -----------------------------------------------------------------------------
       
  1219 //
       
  1220 void CBrowserWindow::SetContentDisplayed(TBool aValue)
       
  1221     {
       
  1222     return CALL_ORIG SetContentDisplayed( aValue );
       
  1223     }
       
  1224 
       
  1225 // -----------------------------------------------------------------------------
       
  1226 // CBrowserWindow::FetchBookmarkL
       
  1227 // -----------------------------------------------------------------------------
       
  1228 //
       
  1229 void CBrowserWindow::FetchBookmarkL( TInt aBookmarkUid )
       
  1230     {
       
  1231     CALL_ORIG FetchBookmarkL( aBookmarkUid );
       
  1232     }
       
  1233 
       
  1234 // -----------------------------------------------------------------------------
       
  1235 // CBrowserWindow::FetchBookmarkL
       
  1236 // -----------------------------------------------------------------------------
       
  1237 //
       
  1238 void CBrowserWindow::FetchBookmarkL( const CFavouritesItem& aBookmarkItem )
       
  1239     {
       
  1240     CALL_ORIG FetchBookmarkL( aBookmarkItem );
       
  1241     }
       
  1242 
       
  1243 // -----------------------------------------------------------------------------
       
  1244 // CBrowserWindow::FetchL
       
  1245 // -----------------------------------------------------------------------------
       
  1246 //
       
  1247 void CBrowserWindow::FetchL(
       
  1248 	const TDesC& aUrl,
       
  1249 	const TDesC& aUserName,
       
  1250 	const TDesC& aPassword,
       
  1251 	const TFavouritesWapAp& aAccessPoint,
       
  1252     CBrowserLoadObserver::TBrowserLoadUrlType aUrlType )
       
  1253     {
       
  1254     CALL_ORIG FetchL( aUrl, aUserName, aPassword, aAccessPoint, aUrlType );
       
  1255     }
       
  1256 
       
  1257 // -----------------------------------------------------------------------------
       
  1258 // CBrowserWindow::FetchL
       
  1259 // -----------------------------------------------------------------------------
       
  1260 //
       
  1261 void CBrowserWindow::FetchL( 
       
  1262     const TDesC& aUrl, 
       
  1263     CBrowserLoadObserver::TBrowserLoadUrlType aUrlType )
       
  1264     {
       
  1265     CALL_ORIG FetchL( aUrl, aUrlType );
       
  1266     }
       
  1267 
       
  1268 // -----------------------------------------------------------------------------
       
  1269 // CBrowserWindow::CancelFetch
       
  1270 // -----------------------------------------------------------------------------
       
  1271 //
       
  1272 void CBrowserWindow::CancelFetch( TBool aIsUserInitiated )
       
  1273     {
       
  1274     CALL_ORIG CancelFetch( aIsUserInitiated );
       
  1275     }
       
  1276 
       
  1277 // -----------------------------------------------------------------------------
       
  1278 // CBrowserWindow::SetRequestedAP
       
  1279 // -----------------------------------------------------------------------------
       
  1280 //
       
  1281 void CBrowserWindow::SetRequestedAP( TInt aAp )
       
  1282     {
       
  1283     CALL_ORIG SetRequestedAP( aAp );
       
  1284     }
       
  1285 
       
  1286 // -----------------------------------------------------------------------------
       
  1287 // CBrowserWindow::SetExitFromEmbeddedMode
       
  1288 // -----------------------------------------------------------------------------
       
  1289 //
       
  1290 void CBrowserWindow::SetExitFromEmbeddedMode( TBool aFlag )
       
  1291     {
       
  1292     CALL_ORIG SetExitFromEmbeddedMode( aFlag );
       
  1293     }
       
  1294 
       
  1295 // -----------------------------------------------------------------------------
       
  1296 // CBrowserWindow::IsProgressShown
       
  1297 // -----------------------------------------------------------------------------
       
  1298 //
       
  1299 TBool CBrowserWindow::IsProgressShown() const
       
  1300     {
       
  1301     return CALL_ORIG IsProgressShown();
       
  1302     }
       
  1303 
       
  1304 // -----------------------------------------------------------------------------
       
  1305 // CBrowserWindow::SetProgressShown
       
  1306 // -----------------------------------------------------------------------------
       
  1307 //
       
  1308 void CBrowserWindow::SetProgressShown( TBool aProgressShown )
       
  1309     {
       
  1310     CALL_ORIG SetProgressShown( aProgressShown );
       
  1311     }
       
  1312 
       
  1313 // -----------------------------------------------------------------------------
       
  1314 // CBrowserWindow::StartedUp
       
  1315 // -----------------------------------------------------------------------------
       
  1316 //
       
  1317 TBool CBrowserWindow::StartedUp() const
       
  1318     {
       
  1319     return CALL_ORIG StartedUp();
       
  1320     }
       
  1321 
       
  1322 // -----------------------------------------------------------------------------
       
  1323 // CBrowserWindow::RequestedAp
       
  1324 // -----------------------------------------------------------------------------
       
  1325 //
       
  1326 TUint32 CBrowserWindow::RequestedAp() const
       
  1327     {
       
  1328     return CALL_ORIG RequestedAp();
       
  1329     }
       
  1330 // -----------------------------------------------------------------------------
       
  1331 // CBrowserWindow::LogAccessToRecentUrlL
       
  1332 // -----------------------------------------------------------------------------
       
  1333 //
       
  1334 void CBrowserWindow::LogAccessToRecentUrlL( CBrCtlInterface& aBrCtlInterface)
       
  1335     {
       
  1336     CALL_ORIG LogAccessToRecentUrlL( aBrCtlInterface );
       
  1337     }
       
  1338 
       
  1339 // -----------------------------------------------------------------------------
       
  1340 // CBrowserWindow::LogRequestedPageToRecentUrlL
       
  1341 // -----------------------------------------------------------------------------
       
  1342 //
       
  1343 void CBrowserWindow::LogRequestedPageToRecentUrlL( const TDesC& aUrl)
       
  1344     {
       
  1345     CALL_ORIG LogRequestedPageToRecentUrlL( aUrl );
       
  1346     }
       
  1347 
       
  1348 // ---------------------------------------------------------
       
  1349 // CBrowserWindow::StartProgressAnimationL
       
  1350 // ---------------------------------------------------------
       
  1351 //
       
  1352 void CBrowserWindow::StartProgressAnimationL()
       
  1353     {
       
  1354     CALL_ORIG StartProgressAnimationL();
       
  1355     }
       
  1356 
       
  1357 // ---------------------------------------------------------
       
  1358 // CBrowserWindow::StopProgressAnimationL
       
  1359 // ---------------------------------------------------------
       
  1360 //
       
  1361 void CBrowserWindow::StopProgressAnimationL()
       
  1362     {
       
  1363     CALL_ORIG StopProgressAnimationL();
       
  1364     }
       
  1365 
       
  1366 #ifdef __RSS_FEEDS
       
  1367 // ---------------------------------------------------------
       
  1368 // CBrowserWindow::FeedsClientUtilities
       
  1369 // ---------------------------------------------------------
       
  1370 //
       
  1371 CFeedsClientUtilities& CBrowserWindow::FeedsClientUtilities() const
       
  1372     {
       
  1373     return CALL_ORIG FeedsClientUtilities();
       
  1374     }
       
  1375 #endif  // __RSS_FEEDS
       
  1376 
       
  1377 // ---------------------------------------------------------
       
  1378 // CBrowserWindow::BrowserWasLaunchedIntoFeeds
       
  1379 // ---------------------------------------------------------
       
  1380 //        
       
  1381 TBool CBrowserWindow::BrowserWasLaunchedIntoFeeds()
       
  1382 { 
       
  1383 	return CALL_ORIG BrowserWasLaunchedIntoFeeds();
       
  1384 }
       
  1385 
       
  1386 // ---------------------------------------------------------
       
  1387 // CBrowserWindow::SetHasWMLContent
       
  1388 // ---------------------------------------------------------
       
  1389 //
       
  1390 void CBrowserWindow::SetHasWMLContent(TBool aHasWMLContent) 
       
  1391 	{
       
  1392 	iHasWMLContent = aHasWMLContent;
       
  1393 	}
       
  1394 
       
  1395 // ---------------------------------------------------------
       
  1396 // CBrowserWindow::SetCurrWinHasWMLContent
       
  1397 // ---------------------------------------------------------
       
  1398 //
       
  1399 void CBrowserWindow::SetCurrWinHasWMLContent(TBool aCurrWinHasWMLContent)
       
  1400 	{
       
  1401 	iCurrWinHasWMLContent = aCurrWinHasWMLContent;
       
  1402 	}
       
  1403 	
       
  1404 // ---------------------------------------------------------
       
  1405 // CBrowserWindow::HasWMLContent
       
  1406 // ---------------------------------------------------------
       
  1407 //
       
  1408 TBool CBrowserWindow::HasWMLContent (TBool aCurrWinOnly) 
       
  1409 	{ 
       
  1410 	if (aCurrWinOnly)
       
  1411 		{
       
  1412 		return iCurrWinHasWMLContent; 
       
  1413 		}
       
  1414 	else
       
  1415 		{
       
  1416 		return iHasWMLContent;	
       
  1417 		}
       
  1418 	}
       
  1419 
       
  1420 
       
  1421 // ---------------------------------------------------------
       
  1422 // CBrowserWindow::SetWMLMode
       
  1423 // ---------------------------------------------------------
       
  1424 //
       
  1425 void CBrowserWindow::SetWMLMode(TBool aWMLMode) 
       
  1426 	{
       
  1427 	iWMLMode = aWMLMode;
       
  1428 	}
       
  1429 
       
  1430 // ---------------------------------------------------------
       
  1431 // CBrowserWindow::SetFirstPage
       
  1432 // ---------------------------------------------------------
       
  1433 //
       
  1434 void CBrowserWindow::SetFirstPage(TBool aFirstPage) 
       
  1435 	{
       
  1436 	iFirstPage = aFirstPage;
       
  1437 	}
       
  1438 
       
  1439 // ---------------------------------------------------------
       
  1440 // CBrowserWindow::SetHasFeedsContent
       
  1441 // ---------------------------------------------------------
       
  1442 //
       
  1443 void CBrowserWindow::SetHasFeedsContent(TBool aHasFeedsContent) 
       
  1444 	{
       
  1445 	iHasFeedsContent = aHasFeedsContent;
       
  1446 	}
       
  1447 
       
  1448 // -----------------------------------------------------------------------------
       
  1449 // CBrowserWindow::SetLastCBAUpdateView
       
  1450 // -----------------------------------------------------------------------------
       
  1451 //
       
  1452 void CBrowserWindow::SetLastCBAUpdateView( TUid aView )
       
  1453     {
       
  1454     CALL_ORIG SetLastCBAUpdateView( aView );
       
  1455     }
       
  1456 
       
  1457 // -----------------------------------------------------------------------------
       
  1458 // CBrowserWindow::GetLastCBAUpdateView
       
  1459 // -----------------------------------------------------------------------------
       
  1460 //
       
  1461 TUid CBrowserWindow::GetLastCBAUpdateView()
       
  1462     {
       
  1463     return CALL_ORIG GetLastCBAUpdateView();
       
  1464     }
       
  1465 
       
  1466 // -----------------------------------------------------------------------------
       
  1467 // CBrowserWindow::GetPreviousViewFromViewHistory
       
  1468 // -----------------------------------------------------------------------------
       
  1469 //
       
  1470 TUid CBrowserWindow::GetPreviousViewFromViewHistory()
       
  1471     {
       
  1472     return CALL_ORIG GetPreviousViewFromViewHistory();
       
  1473     }
       
  1474 
       
  1475 // -----------------------------------------------------------------------------
       
  1476 // CBrowserWindow::CalledFromAnotherApp
       
  1477 // -----------------------------------------------------------------------------
       
  1478 //
       
  1479 TBool CBrowserWindow::CalledFromAnotherApp()
       
  1480     {
       
  1481     return CALL_ORIG CalledFromAnotherApp();
       
  1482     }
       
  1483 
       
  1484 // -----------------------------------------------------------------------------
       
  1485 // CBrowserWindow::SetCalledFromAnotherApp
       
  1486 // -----------------------------------------------------------------------------
       
  1487 //
       
  1488 void CBrowserWindow::SetCalledFromAnotherApp( TBool aValue )
       
  1489     {
       
  1490     return CALL_ORIG SetCalledFromAnotherApp( aValue );
       
  1491     }
       
  1492     
       
  1493 // -----------------------------------------------------------------------------
       
  1494 // CBrowserWindow::FlashPresent
       
  1495 // -----------------------------------------------------------------------------
       
  1496 //
       
  1497 TBool CBrowserWindow::FlashPresent()
       
  1498     {
       
  1499     return CALL_ORIG FlashPresent();
       
  1500     }
       
  1501     
       
  1502     
       
  1503 // -----------------------------------------------------------------------------
       
  1504 // CBrowserWindow::IsLaunchHomePageDimmedL
       
  1505 // -----------------------------------------------------------------------------
       
  1506 //
       
  1507 TBool CBrowserWindow::IsLaunchHomePageDimmedL()
       
  1508     {
       
  1509     return CALL_ORIG IsLaunchHomePageDimmedL();
       
  1510     }    
       
  1511 // -----------------------------------------------------------------------------
       
  1512 // CBrowserWindow::IsDisplayingMenuOrDialog
       
  1513 // -----------------------------------------------------------------------------
       
  1514 //
       
  1515 TBool CBrowserWindow::IsDisplayingMenuOrDialog()
       
  1516     {
       
  1517     return CALL_ORIG IsDisplayingMenuOrDialog();
       
  1518     } 
       
  1519 
       
  1520 #undef CALL_ORIG
       
  1521 
       
  1522 // End of file