browserui/browser/BrowserAppSrc/BrowserAppUi.cpp
changeset 24 868cceedabd3
parent 11 16a119033e3e
child 25 92a061761a7b
equal deleted inserted replaced
18:b57c5fc53578 24:868cceedabd3
    17 *
    17 *
    18 */
    18 */
    19 
    19 
    20 
    20 
    21 // INCLUDES
    21 // INCLUDES
    22 #include <platform/mw/Browser_platform_variant.hrh>
    22 #include <browser_platform_variant.hrh>
    23 #include <BrowserNG.rsg>
    23 #include <BrowserNG.rsg>
    24 #include <uri16.h>
    24 #include <uri16.h>
    25 #include <uri8.h>
    25 #include <uri8.h>
    26 #include <uriutils.h>
    26 #include <uriutils.h>
    27 #include <ApUtils.h>
    27 #include <ApUtils.h>
    28 #include <StringLoader.h>
    28 #include <StringLoader.h>
    29 #include <e32def.h>
    29 #include <e32def.h>
    30 #include <aplistitemlist.h>
    30 #include <aplistitemlist.h>
    31 #include <aplistitem.h>
    31 #include <aplistitem.h>
    32 #include <apparc.h>
    32 #include <apparc.h>
    33 #include "FavouritesFile.h"
    33 #include "favouritesfile.h"
    34 #include <aknmessagequerydialog.h>
    34 #include <aknmessagequerydialog.h>
    35 #include <FeatMgr.h>
    35 #include <FeatMgr.h>
    36 #include <InternetConnectionManager.h>
    36 #include <internetconnectionmanager.h>
    37 #include <APSettingsHandlerUi.h>
    37 #include <APSettingsHandlerUi.h>
    38 #include <UriUtilsCommon.h>
    38 #include <UriUtilsCommon.h>
    39 #include <aknnavi.h>
    39 #include <aknnavi.h>
    40 #include <AiwGenericParam.h>
    40 #include <AiwGenericParam.h>
    41 #include <AknDef.h>
    41 #include <AknDef.h>
    44 #ifdef BRDO_APP_GALLERY_SUPPORTED_FF
    44 #ifdef BRDO_APP_GALLERY_SUPPORTED_FF
    45 #include <MGXFileManagerFactory.h>
    45 #include <MGXFileManagerFactory.h>
    46 #include <CMGXFileManager.h>
    46 #include <CMGXFileManager.h>
    47 #endif
    47 #endif
    48 
    48 
    49 #include <BrowserPluginInterface.h>
    49 #include <browserplugininterface.h>
    50 #include <oommonitorplugin.h>
    50 #include <oommonitorplugin.h>
    51 
    51 
    52 #include "BrowserOverriddenSettings.h"
    52 #include "browseroverriddensettings.h"
    53 #include "BrowserLauncherService.h"
    53 #include "BrowserLauncherService.h"
    54 
    54 
    55 #include "CookieManagerClient.h"
    55 #include "cookiemanagerclient.h"
    56 
    56 
    57 #ifdef __SERIES60_HELP
    57 #ifdef __SERIES60_HELP
    58 #include <hlplch.h>
    58 #include <hlplch.h>
    59 #endif //__SERIES60_HELP
    59 #endif //__SERIES60_HELP
    60 
    60 
    61 #include "BrowserAppDocument.h"
    61 #include "BrowserAppDocument.h"
    62 #include "DownloadedContentHandler.h"
    62 #include "downloadedcontenthandler.h"
    63 #include "BrowserBmOTABinSender.h"
    63 #include "BrowserBmOTABinSender.h"
    64 #include "BrowserCommandLineParser.h"
    64 #include "BrowserCommandLineParser.h"
    65 #include "BrowserApplication.h"
    65 #include "BrowserApplication.h"
    66 #include "BrowserContentView.h"
    66 #include "BrowserContentView.h"
    67 #include "BrowserContentViewContainer.h"
    67 #include "BrowserContentViewContainer.h"
    76 #include "BrowserCommsModel.h"
    76 #include "BrowserCommsModel.h"
    77 #include "BrowserUtil.h"
    77 #include "BrowserUtil.h"
    78 #include "BrowserPreferences.h"
    78 #include "BrowserPreferences.h"
    79 #include "SessionAndSecurity.h"
    79 #include "SessionAndSecurity.h"
    80 #include "BrowserUIVariant.hrh"
    80 #include "BrowserUIVariant.hrh"
       
    81 #include "BrowserWindowQueue.h"
    81 #include "Logger.h"
    82 #include "Logger.h"
    82 #include <data_caging_path_literals.hrh>
    83 #include <data_caging_path_literals.hrh>
    83 
    84 
    84 #include <BrCtlDefs.h>
    85 #include <brctldefs.h>
    85 #include "BrowserDialogsProvider.h"
    86 #include "browserdialogsprovider.h"
    86 #include "BrowserSoftkeysObserver.h"
    87 #include "BrowserSoftkeysObserver.h"
    87 #include "BrowserLoadObserver.h"
    88 #include "BrowserLoadObserver.h"
    88 #include "BrowserSpecialLoadObserver.h"
    89 #include "BrowserSpecialLoadObserver.h"
    89 #include "BrowserAsyncExit.h"
    90 #include "BrowserAsyncExit.h"
    90 #include "CommonConstants.h"
    91 #include "CommonConstants.h"
    91 
    92 
    92 
    93 
    93 // Dialogs Provider
    94 // Dialogs Provider
    94 #include <BrowserDialogsProviderObserver.h>
    95 #include <browserdialogsproviderobserver.h>
    95 #include <BrCtlInterface.h>
    96 #include <brctlinterface.h>
    96 #include <BrowserDialogsProvider.h>
    97 #include <browserdialogsprovider.h>
    97 
    98 
    98 // Multiple Windows
    99 // Multiple Windows
    99 #include "BrowserPopupEngine.h"
   100 #include "BrowserPopupEngine.h"
   100 #include "BrowserDialogsProviderProxy.h"
   101 #include "BrowserDialogsProviderProxy.h"
   101 #include "BrowserWindow.h"
   102 #include "BrowserWindow.h"
  3583 LOG_ENTERFN("AppUi::CloseWindowL");
  3584 LOG_ENTERFN("AppUi::CloseWindowL");
  3584 
  3585 
  3585 	//There are only two cases for closing window. One is user initialized and the
  3586 	//There are only two cases for closing window. One is user initialized and the
  3586 	//other is script initialized. For both cases, the window should be deleted.
  3587 	//other is script initialized. For both cases, the window should be deleted.
  3587     TBool forceDelete( ETrue );
  3588     TBool forceDelete( ETrue );
       
  3589     // this variable is useful to know if the window has a parent window which needs to be activated on closing current window
       
  3590     TBool parentPresent(EFalse);
       
  3591     if ( WindowMgr().CurrentWindowQue() && WindowMgr().CurrentWindowQue()->iParent )
       
  3592         {
       
  3593         parentPresent = ETrue;
       
  3594         }
  3588     // delete the current window by default
  3595     // delete the current window by default
  3589     if( aWindowId == 0 )
  3596     if( aWindowId == 0 )
  3590         {
  3597         {
  3591         aWindowId = WindowMgr().CurrentWindow()->WindowId();
  3598         aWindowId = WindowMgr().CurrentWindow()->WindowId();
  3592         // scripts directly pass a real windowId,
  3599         // scripts directly pass a real windowId,
  3617 #endif
  3624 #endif
  3618 
  3625 
  3619     if( winId > 0 )  // still remain a window to be activated
  3626     if( winId > 0 )  // still remain a window to be activated
  3620         {
  3627         {
  3621    	    WindowMgr().SwitchWindowL( winId );
  3628    	    WindowMgr().SwitchWindowL( winId );
  3622             if(CalledFromAnotherApp() && (!IsEmbeddedModeOn()))
  3629         if(CalledFromAnotherApp() && (!IsEmbeddedModeOn()) && !parentPresent)
  3623    	        {
  3630    	        {
  3624    	        SetCalledFromAnotherApp(EFalse);
  3631    	        SetCalledFromAnotherApp(EFalse);
  3625    	        SendBrowserToBackground();
  3632    	        SendBrowserToBackground();
  3626    	        }
  3633    	        }
  3627    	    }
  3634    	    }
  4086 }
  4093 }
  4087 
  4094 
  4088 // ---------------------------------------------------------
  4095 // ---------------------------------------------------------
  4089 // CBrowserAppUi::HandleSystemEventL
  4096 // CBrowserAppUi::HandleSystemEventL
  4090 // ---------------------------------------------------------
  4097 // ---------------------------------------------------------
  4091 
  4098 #if defined(__S60_50__)
  4092 void CBrowserAppUi::HandleSystemEventL(const TWsEvent& aEvent)
  4099 void CBrowserAppUi::HandleSystemEventL(const TWsEvent& aEvent)
  4093    {
  4100    {
  4094    
  4101    
  4095    /**
  4102    /**
  4096     * We need a special handling for System events to handle the situation 
  4103     * We need a special handling for System events to handle the situation 
  4107        break;
  4114        break;
  4108      }
  4115      }
  4109    // call base class implementation
  4116    // call base class implementation
  4110    CAknAppUi::HandleSystemEventL(aEvent);
  4117    CAknAppUi::HandleSystemEventL(aEvent);
  4111    }
  4118    }
  4112 
  4119 #endif  
  4113 // ---------------------------------------------------------
  4120 // ---------------------------------------------------------
  4114 // CBrowserAppUi::StartFetchHomePageL
  4121 // CBrowserAppUi::StartFetchHomePageL
  4115 // ---------------------------------------------------------
  4122 // ---------------------------------------------------------
  4116 void CBrowserAppUi::StartFetchHomePageL(void)
  4123 void CBrowserAppUi::StartFetchHomePageL(void)
  4117     {
  4124     {