37 #include <UriUtilsCommon.h> |
38 #include <UriUtilsCommon.h> |
38 #include <aknnavi.h> |
39 #include <aknnavi.h> |
39 #include <AiwGenericParam.h> |
40 #include <AiwGenericParam.h> |
40 #include <AknDef.h> |
41 #include <AknDef.h> |
41 #include <DocumentHandler.h> |
42 #include <DocumentHandler.h> |
|
43 |
|
44 #ifdef BRDO_APP_GALLERY_SUPPORTED_FF |
42 #include <MGXFileManagerFactory.h> |
45 #include <MGXFileManagerFactory.h> |
43 #include <CMGXFileManager.h> |
46 #include <CMGXFileManager.h> |
|
47 #endif |
|
48 |
44 #include <BrowserPluginInterface.h> |
49 #include <BrowserPluginInterface.h> |
45 #include <oommonitorplugin.h> |
50 #include <oommonitorplugin.h> |
46 |
51 |
47 #include "BrowserOverriddenSettings.h" |
52 #include "BrowserOverriddenSettings.h" |
48 #include "BrowserLauncherService.h" |
53 #include "BrowserLauncherService.h" |
1266 TUint32 IAPid = 2; |
1271 TUint32 IAPid = 2; |
1267 #endif //__WINSCW__ |
1272 #endif //__WINSCW__ |
1268 |
1273 |
1269 err = KErrNone; |
1274 err = KErrNone; |
1270 BROWSER_LOG( ( _L( "Load the URL" ) ) ); |
1275 BROWSER_LOG( ( _L( "Load the URL" ) ) ); |
1271 LoadObserver().DoStartLoad( aUrlType ); |
1276 |
|
1277 if ( iPreferences->SearchFeature() || iPreferences->ServiceFeature()) |
|
1278 { |
|
1279 iSpecialSchemeinAddress = EFalse; |
|
1280 |
|
1281 HBufC* searchScheme = HBufC::NewLC( KMaxHomePgUrlLength ); // cleanupstack |
|
1282 TPtr searchSchemePtr( searchScheme->Des() ); |
|
1283 ++toPop; |
|
1284 |
|
1285 HBufC* serviceScheme = HBufC::NewLC( KMaxHomePgUrlLength ); // cleanupstack |
|
1286 TPtr serviceSchemePtr( serviceScheme->Des() ); |
|
1287 ++toPop; |
|
1288 |
|
1289 iPreferences->GetStringValueL( KBrowserSearchProviderUrl, KMaxHomePgUrlLength, searchSchemePtr ); |
|
1290 iPreferences->GetStringValueL( KBrowserServiceUrl, KMaxHomePgUrlLength, serviceSchemePtr ); |
|
1291 |
|
1292 TInt err = uriParser.Parse(searchSchemePtr); |
|
1293 if (!err) |
|
1294 searchSchemePtr = uriParser.Extract( EUriScheme ); |
|
1295 |
|
1296 err = uriParser.Parse(serviceSchemePtr); |
|
1297 if (!err) |
|
1298 serviceSchemePtr = uriParser.Extract( EUriScheme ); |
|
1299 |
|
1300 if( scheme.Length() != 0 ) |
|
1301 { |
|
1302 if( !scheme.Compare(serviceSchemePtr) || !scheme.Compare(searchSchemePtr) ) |
|
1303 { |
|
1304 iSpecialSchemeinAddress = ETrue; |
|
1305 TRAP( err, BrCtlInterface().LoadUrlL( resultUrlBuf->Des(), IAPid ) ); |
|
1306 } |
|
1307 else |
|
1308 { |
|
1309 LoadObserver().DoStartLoad( aUrlType ); |
|
1310 TRAP( err, BrCtlInterface().LoadUrlL( resultUrlBuf->Des(), IAPid ) ); |
|
1311 } |
|
1312 } |
|
1313 } |
|
1314 else |
|
1315 { |
|
1316 LoadObserver().DoStartLoad( aUrlType ); |
|
1317 TRAP( err, BrCtlInterface().LoadUrlL( resultUrlBuf->Des(), IAPid ) ); |
|
1318 } |
1272 |
1319 |
1273 TRAP( err, BrCtlInterface().LoadUrlL( resultUrlBuf->Des(), IAPid ) ); |
|
1274 |
|
1275 CleanupStack::PopAndDestroy(toPop); //resultUrlBuf and url if needed |
1320 CleanupStack::PopAndDestroy(toPop); //resultUrlBuf and url if needed |
1276 BROWSER_LOG( ( _L( "No AP 4 %d" ), err ) ); |
1321 BROWSER_LOG( ( _L( "No AP 4 %d" ), err ) ); |
1277 if ( err != KErrNone ) |
1322 if ( err != KErrNone ) |
1278 { |
1323 { |
1279 CancelFetch(); |
1324 CancelFetch(); |
1776 else if ( aCommand == EApaCommandRun ) |
1821 else if ( aCommand == EApaCommandRun ) |
1777 { |
1822 { |
1778 |
1823 |
1779 if ( LastActiveViewId() == KUidBrowserNullViewId ) |
1824 if ( LastActiveViewId() == KUidBrowserNullViewId ) |
1780 { |
1825 { |
|
1826 TBool specialSchemeInHomePageAddress = EFalse; |
|
1827 |
1781 if (NoHomePageToBeLaunchedL()) |
1828 if (NoHomePageToBeLaunchedL()) |
1782 { |
1829 { |
1783 // No homepage to be launched so start browser in bookmarks view |
1830 // No homepage to be launched so start browser in bookmarks view |
1784 SetLastActiveViewId(KUidBrowserBookmarksViewId); |
1831 SetLastActiveViewId(KUidBrowserBookmarksViewId); |
1785 } |
1832 } |
1786 else |
1833 else if ( iPreferences->SearchFeature() || iPreferences->ServiceFeature()) |
1787 { |
1834 { |
1788 // There's a homepage to be launched so start in content view |
1835 |
1789 SetLastActiveViewId(KUidBrowserContentViewId); |
1836 HBufC* buf = HBufC::NewLC( KMaxHomePgUrlLength ); // cleanupstack |
1790 |
1837 TPtr ptr( buf->Des() ); |
1791 //wait for contentview to initialize itself |
1838 TInt pgFound( KErrNotFound ); |
1792 WaitCVInit(); |
1839 pgFound = Preferences().HomePageUrlL( ptr ); |
1793 |
1840 |
1794 TInt error( KErrNone ); |
1841 HBufC* searchScheme = HBufC::NewLC( KMaxHomePgUrlLength ); // cleanupstack |
1795 TRAP( error, FetchHomePageL() ); |
1842 TPtr searchSchemePtr( searchScheme->Des() ); |
1796 if( error != KErrNone ) |
1843 |
1797 { |
1844 HBufC* serviceScheme = HBufC::NewLC( KMaxHomePgUrlLength ); // cleanupstack |
1798 CloseContentViewL(); |
1845 TPtr serviceSchemePtr( serviceScheme->Des() ); |
1799 } |
1846 |
1800 } |
1847 iPreferences->GetStringValueL( KBrowserSearchProviderUrl, KMaxHomePgUrlLength, searchSchemePtr ); |
1801 ActivateLocalViewL( LastActiveViewId() ); |
1848 iPreferences->GetStringValueL( KBrowserServiceUrl, KMaxHomePgUrlLength, serviceSchemePtr ); |
1802 } |
1849 |
1803 |
1850 |
|
1851 if( !ptr.Compare(serviceSchemePtr) || !ptr.Compare(searchSchemePtr) ) |
|
1852 { |
|
1853 specialSchemeInHomePageAddress = ETrue; |
|
1854 SetLastActiveViewId(KUidBrowserBookmarksViewId); |
|
1855 TRAPD( err, FetchL( ptr, CBrowserLoadObserver::ELoadUrlTypeOther ) ); |
|
1856 } |
|
1857 else |
|
1858 { |
|
1859 StartFetchHomePageL(); |
|
1860 } |
|
1861 CleanupStack::PopAndDestroy( 3,buf ); |
|
1862 } |
|
1863 else |
|
1864 { |
|
1865 StartFetchHomePageL(); |
|
1866 } |
|
1867 |
|
1868 if( !specialSchemeInHomePageAddress ) |
|
1869 { |
|
1870 ActivateLocalViewL( LastActiveViewId() ); |
|
1871 } |
|
1872 } |
1804 } |
1873 } |
1805 else if ( aCommand == EApaCommandViewActivate ) |
1874 else if ( aCommand == EApaCommandViewActivate ) |
1806 // Get when activated from soft notification (Downloads List). |
1875 // Get when activated from soft notification (Downloads List). |
1807 // Must behave as in case of EApaCommandOpen, but no OpenFileL() is called. |
1876 // Must behave as in case of EApaCommandOpen, but no OpenFileL() is called. |
1808 { |
1877 { |
3799 CleanupStack::PopAndDestroy(dataType8); // dataType8 |
3873 CleanupStack::PopAndDestroy(dataType8); // dataType8 |
3800 } |
3874 } |
3801 |
3875 |
3802 TFileName fName; |
3876 TFileName fName; |
3803 User::LeaveIfError(docHandler->GetPath(fName)); |
3877 User::LeaveIfError(docHandler->GetPath(fName)); |
|
3878 |
|
3879 #ifdef BRDO_APP_GALLERY_SUPPORTED_FF |
|
3880 |
3804 CMGXFileManager* mgFileManager = MGXFileManagerFactory::NewFileManagerL(CEikonEnv::Static()->FsSession()); |
3881 CMGXFileManager* mgFileManager = MGXFileManagerFactory::NewFileManagerL(CEikonEnv::Static()->FsSession()); |
3805 CleanupStack::PushL(mgFileManager); |
3882 CleanupStack::PushL(mgFileManager); |
3806 if( fName.Length() > 0 ) |
3883 if( fName.Length() > 0 ) |
3807 { |
3884 { |
3808 TRAP_IGNORE( mgFileManager->UpdateL( fName ) ); |
3885 TRAP_IGNORE( mgFileManager->UpdateL( fName ) ); |
3809 } |
3886 } |
3810 else |
3887 else |
3811 { |
3888 { |
3812 TRAP_IGNORE( mgFileManager->UpdateL() ); |
3889 TRAP_IGNORE( mgFileManager->UpdateL() ); |
3813 } |
3890 } |
3814 CleanupStack::PopAndDestroy(2); // imageCarrier, mgFileManager |
3891 CleanupStack::PopAndDestroy(1); // mgFileManager |
|
3892 |
|
3893 #endif |
|
3894 |
|
3895 CleanupStack::PopAndDestroy(1); // imageCarrier |
3815 } |
3896 } |
3816 |
3897 |
3817 // --------------------------------------------------------- |
3898 // --------------------------------------------------------- |
3818 // CBrowserAppUi::CheckFlashPresent |
3899 // CBrowserAppUi::CheckFlashPresent |
3819 // --------------------------------------------------------- |
3900 // --------------------------------------------------------- |
3955 |
4036 |
3956 switch (type) |
4037 switch (type) |
3957 { |
4038 { |
3958 case EEventPointerExit: |
4039 case EEventPointerExit: |
3959 { |
4040 { |
3960 CCoeControl* ctrl = &(BrCtlInterface()); |
4041 |
3961 CCoeControl* parent = ctrl->Parent(); |
|
3962 |
|
3963 if (aDestination == parent) |
|
3964 { |
|
3965 TPointerEvent event; |
|
3966 event.iType = TPointerEvent::EButton1Up; |
|
3967 event.iModifiers = 0; |
|
3968 event.iPosition = TPoint(0, 0); |
|
3969 parent->HandlePointerEventL(event); |
|
3970 } |
|
3971 break; |
4042 break; |
3972 } |
4043 } |
3973 |
4044 |
3974 case EEventPointerEnter: |
4045 case EEventPointerEnter: |
3975 { |
4046 { |
3993 |
4064 |
3994 } |
4065 } |
3995 } |
4066 } |
3996 CAknViewAppUi::HandleWsEventL(aEvent, aDestination); |
4067 CAknViewAppUi::HandleWsEventL(aEvent, aDestination); |
3997 } |
4068 } |
|
4069 |
|
4070 // --------------------------------------------------------- |
|
4071 // CBrowserAppUi::HandleSystemEventL |
|
4072 // --------------------------------------------------------- |
|
4073 |
|
4074 void CBrowserAppUi::HandleSystemEventL(const TWsEvent& aEvent) |
|
4075 { |
|
4076 |
|
4077 /** |
|
4078 * We need a special handling for System events to handle the situation |
|
4079 * like when the shut down is done while download is going on. |
|
4080 */ |
|
4081 |
|
4082 switch (*(TApaSystemEvent*)(aEvent.EventData())) |
|
4083 { |
|
4084 case EApaSystemEventShutdown: |
|
4085 // do things here |
|
4086 ExitBrowser ( IsAppShutterActive() ); |
|
4087 break; |
|
4088 default: |
|
4089 break; |
|
4090 } |
|
4091 // call base class implementation |
|
4092 CAknAppUi::HandleSystemEventL(aEvent); |
|
4093 } |
|
4094 |
|
4095 // --------------------------------------------------------- |
|
4096 // CBrowserAppUi::StartFetchHomePageL |
|
4097 // --------------------------------------------------------- |
|
4098 void CBrowserAppUi::StartFetchHomePageL(void) |
|
4099 { |
|
4100 |
|
4101 // There's a homepage to be launched so start in content view |
|
4102 SetLastActiveViewId(KUidBrowserContentViewId); |
|
4103 //wait for contentview to initialize itself |
|
4104 WaitCVInit(); |
|
4105 |
|
4106 TInt error( KErrNone ); |
|
4107 TRAP( error, FetchHomePageL() ); |
|
4108 if( error != KErrNone ) |
|
4109 { |
|
4110 CloseContentViewL(); |
|
4111 } |
|
4112 } |
|
4113 |
3998 // End of File |
4114 // End of File |