branch | RCL_3 |
changeset 60 | b149f0820e5a |
parent 58 | aead3f7e1bb0 |
child 62 | 5a044f6358c2 |
58:aead3f7e1bb0 | 60:b149f0820e5a |
---|---|
160 iFeatureManager( EFalse ), |
160 iFeatureManager( EFalse ), |
161 iUserExit( EFalse ), |
161 iUserExit( EFalse ), |
162 iPgNotFound( EFalse ), |
162 iPgNotFound( EFalse ), |
163 iOverriddenLaunchContextId( EBrowserContextIdNormal ), |
163 iOverriddenLaunchContextId( EBrowserContextIdNormal ), |
164 iBrowserAlreadyRunning (EFalse), |
164 iBrowserAlreadyRunning (EFalse), |
165 iCalledFromExternApp( EFalse ) |
165 iCalledFromExternApp( EFalse ), |
166 iFeedsClientUtilities( 0 ) |
|
166 { |
167 { |
167 iViewToBeActivatedIfNeeded.iUid = 0; |
168 iViewToBeActivatedIfNeeded.iUid = 0; |
168 iViewToReturnOnClose.iUid = 0; |
169 iViewToReturnOnClose.iUid = 0; |
169 } |
170 } |
170 |
171 |
288 #else |
289 #else |
289 BaseConstructL( EAknEnableSkin | EAknEnableMSK ); |
290 BaseConstructL( EAknEnableSkin | EAknEnableMSK ); |
290 #endif |
291 #endif |
291 if ( !IsEmbeddedModeOn( ) ) |
292 if ( !IsEmbeddedModeOn( ) ) |
292 { |
293 { |
293 InitBrowserL(); |
294 #ifdef BRDO_PERF_IMPROVEMENTS_ENABLED_FF |
295 InitBookmarksL(); |
|
296 #else |
|
297 InitBrowserL(); |
|
298 #endif |
|
294 LOG_WRITE( "Browser started standalone" ); |
299 LOG_WRITE( "Browser started standalone" ); |
295 } |
300 } |
296 else |
301 else |
297 { |
302 { |
298 iStartedUp = EFalse; |
303 iStartedUp = EFalse; |
444 delete aResult; // Ownership was transferred, so this must be deleted by the client |
449 delete aResult; // Ownership was transferred, so this must be deleted by the client |
445 CleanUpdateParams(); |
450 CleanUpdateParams(); |
446 LOG_WRITE( "CBrowserAppUi::UpdateComplete - Exit" ); |
451 LOG_WRITE( "CBrowserAppUi::UpdateComplete - Exit" ); |
447 } |
452 } |
448 #endif |
453 #endif |
449 // ----------------------------------------------------------------------------- |
454 |
450 // CBrowserAppUi::InitBrowser() |
455 |
451 // ----------------------------------------------------------------------------- |
456 // ----------------------------------------------------------------------------- |
452 // |
457 // CBrowserAppUi::InitBookmarksL() |
453 void CBrowserAppUi::InitBrowserL() |
458 // Initialize only bookmarks view related dependencies here. |
454 { |
459 // Note - Do not add unnecessary code here, it increases startup time for bookmarks view. |
460 // ----------------------------------------------------------------------------- |
|
461 // |
|
462 void CBrowserAppUi::InitBookmarksL() |
|
463 { |
|
464 //New constructor that just replaces the default primary storage size with this one. |
|
465 iRecentUrlStore = CRecentUrlStore::NewL(); |
|
466 |
|
467 // Init CommsModel |
|
468 iCommsModel = CBrowserCommsModel::NewL(); |
|
469 |
|
470 // check if it can be delayed ?? |
|
471 #ifdef BRDO_OCC_ENABLED_FF |
|
472 iConnection = CInternetConnectionManager::NewL( &iCommsModel->CommsDb(), ETrue ); |
|
473 #else |
|
474 iConnection = CInternetConnectionManager::NewL( &iCommsModel->CommsDb(), EFalse ); |
|
475 #endif |
|
476 |
|
477 // Creating object to hold application settings |
|
478 CBrowserAppDocument* doc = STATIC_CAST(CBrowserAppDocument*, Document()); |
|
479 iPreferences = CBrowserPreferences::NewL( *iCommsModel, *this, doc->GetOverriddenSettings()); |
|
480 |
|
481 // Create bookmarkview |
|
482 CBrowserBookmarksView* bookmarksView = NULL; |
|
483 TInt folderUid = doc->GetFolderToOpen(); |
|
484 if ( IsEmbeddedModeOn() && folderUid!= KFavouritesRootUid) |
|
485 { |
|
486 bookmarksView = CBrowserBookmarksView::NewLC( *this, *iRecentUrlStore, folderUid ); |
|
487 } |
|
488 else |
|
489 { |
|
490 bookmarksView = CBrowserBookmarksView::NewLC( *this, *iRecentUrlStore ); |
|
491 } |
|
492 |
|
493 iBookmarksView = bookmarksView; |
|
494 AddViewL( bookmarksView ); // transfer ownership to CAknViewAppUi |
|
495 CleanupStack::Pop(); // bookmarksView |
|
496 } |
|
497 |
|
498 |
|
499 // ----------------------------------------------------------------------------- |
|
500 // CBrowserAppUi::CompleteDelayedInit() |
|
501 // Delayed (async) init callback. This method can be invoked explicitly in case |
|
502 // some early startup cases fail if Browser has not initialized fully. No harm |
|
503 // if called multiple times since there is check in the beginning of thsi function. |
|
504 // ----------------------------------------------------------------------------- |
|
505 // |
|
506 TBool CBrowserAppUi::CompleteDelayedInit() |
|
507 { |
|
508 // Should not be called for other that 9.2 onward devices |
|
509 #ifdef BRDO_PERF_IMPROVEMENTS_ENABLED_FF |
|
510 if ( iStartedUp ) |
|
511 return EFalse; // no need to re-invoke automatically |
|
512 // complete initialization |
|
513 TRAP_IGNORE(DelayedInitL()); |
|
514 |
|
515 #ifdef BRDO_IAD_UPDATE_ENABLED_FF |
|
516 // complete the IAD check asynchronously |
|
517 iDelayedUpdate = CIdle::NewL( CActive::EPriorityIdle ); |
|
518 iDelayedUpdate->Start(TCallBack( CompleteIADUpdateCallback, this )); |
|
519 #endif |
|
520 #endif |
|
521 |
|
522 return EFalse; // no need to re-invoke automatically |
|
523 } |
|
524 |
|
525 // ----------------------------------------------------------------------------- |
|
526 // CBrowserAppUi::DelayedInitL() |
|
527 // Delayed (Async) initialization - whatever remains after InitBookmarksL(), do it here. |
|
528 // Note: - Do not add unnecessary code here, it increases startup time for contenview. |
|
529 // ----------------------------------------------------------------------------- |
|
530 // |
|
531 void CBrowserAppUi::DelayedInitL() |
|
532 { |
|
533 LOG_ENTERFN("CBrowserAppUi::DelayedInitL"); |
|
534 // Check for ciritical disk space |
|
455 RFs fs; |
535 RFs fs; |
456 User::LeaveIfError(fs.Connect()); |
536 User::LeaveIfError(fs.Connect()); |
457 TInt drive( EDriveC ); |
537 TInt drive( EDriveC ); |
458 TBool isSpace( EFalse ); |
538 TBool isSpace( EFalse ); |
459 TInt err( KErrNone ); |
539 TInt err( KErrNone ); |
460 TRAP( err, isSpace = !SysUtil::DiskSpaceBelowCriticalLevelL( |
540 TRAP( err, isSpace = !SysUtil::DiskSpaceBelowCriticalLevelL(&fs, KMinimumCDriveDiskSpace, drive )); |
461 &fs, |
|
462 KMinimumCDriveDiskSpace, |
|
463 drive )); |
|
464 fs.Close(); |
541 fs.Close(); |
465 if (!isSpace) |
542 if (!isSpace) User::Leave(KErrDiskFull); |
466 User::Leave(KErrDiskFull); |
543 |
467 |
544 // Create Favengine session |
468 if (!iStartedUp) |
545 User::LeaveIfError( iFavouritesSess.Connect() ); |
469 { |
546 |
470 LOG_ENTERFN( "CBrowserAppUi::InitBrowser" ); |
547 // Init FeatureManager |
471 |
548 FeatureManager::InitializeLibL(); |
472 User::LeaveIfError( iFavouritesSess.Connect() ); |
549 iFeatureManager = ETrue; |
473 |
550 |
474 PERFLOG_LOCAL_INIT; |
551 // check flash present |
475 |
552 iFlashPresent = CheckFlashPresent(); |
476 PERFLOG_STOPWATCH_START; |
553 |
477 |
554 // this is required, browser's connection oberver should be hit first. |
478 // Replace the original synchronous creation with this async |
555 // (incase of netscape plgins, transactions will be closed.) |
479 // creation. A new method was added to the interface stub that was |
556 iConnStageNotifier = CConnectionStageNotifierWCB::NewL(); |
480 // not added to the MAHLEClientAPI (it is owned by another group). |
557 iConnStageNotifier->SetPriority(CActive::EPriorityHigh); |
481 // // Init AHLE Interface |
558 |
482 // TAHLEScore adaptationSpeed; |
559 // Starts a background processing, so it must be started early, to get |
483 // TUint primarySize; |
560 // finished before the first send operation! Or it must be synchronized! |
484 // TUint secondarySize; |
561 iLateSendUi = CIdle::NewL( CActive::EPriorityIdle ); |
485 // iAHLEClient=CAHLEInterface::NewL(); |
562 iLateSendUi ->Start( TCallBack( DelayedSendUiConstructL, this ) ); |
486 // iAHLEClient->GetConfigurationL( primarySize, secondarySize, adaptationSpeed ); |
563 |
487 // iAHLEClient->ReconfigureL( KAhlePrimaryStorage, secondarySize, adaptationSpeed ); |
564 iHTTPSecurityIndicatorSupressed = iPreferences->HttpSecurityWarningsStatSupressed(); |
488 /* |
565 |
489 // Write to the file only if we are not below critical disk level |
566 // set AP to be a default one (for Push messages) |
490 if (SysUtil::DiskSpaceBelowCriticalLevelL (&rfs, aData.Length(), EDriveC)) |
567 SetRequestedAP( Preferences().DefaultAccessPoint() ); |
491 { |
568 |
492 User::Leave(KErrDiskFull); |
569 // Create ContentView |
493 } |
570 TRect rect = ClientRect(); |
494 |
571 CBrowserContentView* contentView = CBrowserContentView::NewLC( *this, rect ); |
495 TMemoryInfoV1Buf info; |
572 AddViewL( contentView ); // transfer ownership to CAknViewAppUi |
496 UserHal::MemoryInfo( info ); |
573 CleanupStack::Pop(); // contentView |
497 TInt freeRamInBytes = 10*1024*1024; |
574 |
498 TInt dataSize = iContext->iDataPtr.Length(); |
575 // proxy will handle dialog events through load observer |
499 if( UserHal::MemoryInfo( info ) == KErrNone ) |
576 iDialogsProvider = CBrowserDialogsProvider::NewL( NULL); |
500 freeRamInBytes = info().iFreeRamInBytes; |
577 |
501 |
578 #ifdef __RSS_FEEDS |
502 */ |
579 iFeedsClientUtilities = CFeedsClientUtilities::NewL( *this, *this ); |
503 //New constructor that just replaces the default primary storage size with this one. |
580 BROWSER_LOG( ( _L("Feeds up.") ) ); |
504 iRecentUrlStore = CRecentUrlStore::NewL(); |
581 #endif //__RSS_FEEDS |
505 |
582 |
506 iFlashPresent = CheckFlashPresent(); |
583 // Is Multiple Window feature suported? |
507 PERFLOG_STOP_WRITE("\t AhleInterface Creation + Configuration"); |
584 if ( Preferences().UiLocalFeatureSupported( KBrowserMultipleWindows ) ) |
508 BROWSER_LOG( ( _L( "AHLE Interface inited" ) ) ); |
585 { |
509 |
586 if (Preferences().UiLocalFeatureSupported( KBrowserMinimalMultipleWindows ))//midrange |
510 // Init FeatureManager |
587 { |
511 FeatureManager::InitializeLibL(); |
588 iWindowManager = CBrowserWindowManager::NewL( *this, *contentView, KMinNumOfOpenedWindows ); |
512 iFeatureManager = ETrue; |
|
513 |
|
514 // Init CommsModel |
|
515 |
|
516 PERFLOG_STOPWATCH_START; |
|
517 iCommsModel = CBrowserCommsModel::NewL(); |
|
518 PERFLOG_STOP_WRITE("\t CommsModel NewL"); |
|
519 BROWSER_LOG( ( _L( "CommsModel up" ) ) ); |
|
520 |
|
521 CBrowserAppDocument* doc = STATIC_CAST(CBrowserAppDocument*, Document()); |
|
522 |
|
523 // Creating object to hold application settings |
|
524 PERFLOG_STOPWATCH_START; |
|
525 iPreferences = CBrowserPreferences::NewL( *iCommsModel, *this, doc->GetOverriddenSettings()); |
|
526 PERFLOG_STOP_WRITE("\t Preferences NewL"); |
|
527 BROWSER_LOG( ( _L( "Preferences up" ) ) ); |
|
528 |
|
529 PERFLOG_STOPWATCH_START; |
|
530 #ifdef BRDO_OCC_ENABLED_FF |
|
531 iConnection = CInternetConnectionManager::NewL( &iCommsModel->CommsDb(), ETrue ); |
|
532 #else |
|
533 iConnection = CInternetConnectionManager::NewL( &iCommsModel->CommsDb(), EFalse ); |
|
534 #endif |
|
535 |
|
536 PERFLOG_STOP_WRITE("\t ConnMan NewL"); |
|
537 BROWSER_LOG( ( _L( "ConnectionManager up" ) ) ); |
|
538 |
|
539 |
|
540 PERFLOG_STOPWATCH_START; |
|
541 iConnStageNotifier = CConnectionStageNotifierWCB::NewL(); |
|
542 |
|
543 //this is required, browser's connection oberver should be hit first. (incase of netscape plgins, transactions will be closed.) |
|
544 iConnStageNotifier->SetPriority(CActive::EPriorityHigh); |
|
545 |
|
546 PERFLOG_STOP_WRITE("\t StageNotif NewL"); |
|
547 BROWSER_LOG( ( _L( "StageNofier up" ) ) ); |
|
548 |
|
549 // Starts a background processing, so it must be started early, to get |
|
550 // finished before the first send operation! Or it must be synchronized! |
|
551 PERFLOG_STOPWATCH_START; |
|
552 iLateSendUi = CIdle::NewL( CActive::EPriorityIdle ); |
|
553 iLateSendUi ->Start( TCallBack( DelayedSendUiConstructL, this ) ); |
|
554 PERFLOG_STOP_WRITE("\t OtaSender NewL"); |
|
555 |
|
556 iHTTPSecurityIndicatorSupressed = iPreferences->HttpSecurityWarningsStatSupressed(); |
|
557 |
|
558 // set AP to be a default one (for Push messages) |
|
559 SetRequestedAP( Preferences().DefaultAccessPoint() ); |
|
560 // get client rect before hiding CBAs |
|
561 TRect rect = ClientRect(); |
|
562 Cba()->MakeVisible( EFalse ); |
|
563 //------------------------------------------------------------------------- |
|
564 // Create bookmarkview |
|
565 PERFLOG_STOPWATCH_START; |
|
566 CBrowserBookmarksView* bookmarksView = NULL; |
|
567 TInt folderUid = doc->GetFolderToOpen(); |
|
568 if ( IsEmbeddedModeOn() && folderUid!= KFavouritesRootUid) |
|
569 { |
|
570 bookmarksView = CBrowserBookmarksView::NewLC( *this, *iRecentUrlStore, folderUid ); |
|
571 } |
589 } |
572 else |
590 else |
573 { |
591 { |
574 bookmarksView = CBrowserBookmarksView::NewLC( *this, *iRecentUrlStore ); |
592 iWindowManager = CBrowserWindowManager::NewL( *this, *contentView, KMaxNumOfOpenedWindows ); |
575 } |
593 } |
576 PERFLOG_STOP_WRITE("\t BMView NewL") |
594 LOG_WRITE_FORMAT("WindowManager Up. Max windows number. %d", KMaxNumOfOpenedWindows ); |
577 |
595 } |
578 iBookmarksView = bookmarksView; |
596 else |
579 |
597 { |
580 AddViewL( bookmarksView ); // transfer ownership to CAknViewAppUi |
598 iWindowManager = CBrowserWindowManager::NewL( *this, *contentView, KMinNumOfOpenedWindows ); |
581 CleanupStack::Pop(); // bookmarksView |
599 BROWSER_LOG( ( _L( "WindowManager Up. MWs not supported." ) ) ); |
582 BROWSER_LOG( ( _L( "Bookmarksview up" ) ) ); |
600 } |
583 |
601 |
584 //------------------------------------------------------------------------- |
602 contentView->SetZoomLevelL(); |
585 // Create ContentView |
603 BrCtlInterface().AddLoadEventObserverL(iBookmarksView); |
586 |
604 |
587 PERFLOG_STOPWATCH_START; |
605 // create settings view |
588 CBrowserContentView* contentView = |
606 CBrowserSettingsView* settingsView = CBrowserSettingsView::NewLC( *this ); |
589 CBrowserContentView::NewLC( *this, rect ); |
607 AddViewL( settingsView ); // transfer ownership to CAknViewAppUi |
590 AddViewL( contentView ); // transfer ownership to CAknViewAppUi |
608 CleanupStack::Pop(); // settingsView |
591 CleanupStack::Pop(); // contentView |
609 BROWSER_LOG( ( _L( "SettingsView up" ) ) ); |
592 PERFLOG_STOP_WRITE("\t ContentView NewL"); |
610 |
593 BROWSER_LOG( ( _L( "ContentView up" ) ) ); |
611 // window selection view |
594 |
612 CBrowserWindowSelectionView* windowSelectionView = CBrowserWindowSelectionView::NewLC( *this ); |
595 //------------------------------------------------------------------------- |
613 AddViewL( windowSelectionView ); // transfer ownership to CAknViewAppUi |
596 // Create the Plugin Browser Engine |
614 CleanupStack::Pop(); // windowSelectionView |
597 |
615 BROWSER_LOG( ( _L( "windowSelectionView up" ) ) ); |
598 // proxy will handle dialog events through load observer |
616 |
599 iDialogsProvider = CBrowserDialogsProvider::NewL( NULL); |
617 // Create asyncronous object to call when exit requires it. |
600 BROWSER_LOG( ( _L( "CBrowserDialogsProvider UP" ) ) ); |
618 iBrowserAsyncExit = CBrowserAsyncExit::NewL( this ); |
601 |
619 iIdle = CIdle::NewL( CActive::EPriorityIdle ); |
602 #ifdef __RSS_FEEDS |
620 |
603 iFeedsClientUtilities = CFeedsClientUtilities::NewL( *this, *this ); |
621 iPushMtmObserver = CBrowserPushMtmObserver::NewL( this ); |
604 |
622 iPushMtmObserver->StartObserver(); |
605 BROWSER_LOG( ( _L("Feeds up.") ) ); |
623 |
606 #endif //__RSS_FEEDS |
|
607 |
|
608 PERFLOG_STOPWATCH_START; |
|
609 // Is Multiple Window feature suported? |
|
610 if ( Preferences().UiLocalFeatureSupported( KBrowserMultipleWindows ) ) |
|
611 { |
|
612 if (Preferences().UiLocalFeatureSupported( KBrowserMinimalMultipleWindows ))//midrange |
|
613 { |
|
614 iWindowManager = CBrowserWindowManager::NewL( *this, *contentView, |
|
615 KMinNumOfOpenedWindows ); |
|
616 } |
|
617 else |
|
618 { |
|
619 iWindowManager = CBrowserWindowManager::NewL( *this, *contentView, |
|
620 KMaxNumOfOpenedWindows ); |
|
621 } |
|
622 LOG_WRITE_FORMAT("WindowManager Up. Max windows number. %d", |
|
623 KMaxNumOfOpenedWindows ); |
|
624 } |
|
625 else |
|
626 { |
|
627 iWindowManager = CBrowserWindowManager::NewL( *this, *contentView, |
|
628 KMinNumOfOpenedWindows ); |
|
629 BROWSER_LOG( ( _L( "WindowManager Up. MWs not supported." ) ) ); |
|
630 } |
|
631 |
|
632 PERFLOG_STOP_WRITE("\t WindowMgr + PopUp Engine"); |
|
633 contentView->SetZoomLevelL(); |
|
634 |
|
635 //------------------------------------------------------------------------- |
|
636 |
|
637 |
|
638 CBrowserSettingsView* settingsView = CBrowserSettingsView::NewLC( *this ); |
|
639 AddViewL( settingsView ); // transfer ownership to CAknViewAppUi |
|
640 CleanupStack::Pop(); // settingsView |
|
641 BROWSER_LOG( ( _L( "SettingsView up" ) ) ); |
|
642 |
|
643 CBrowserWindowSelectionView* windowSelectionView = CBrowserWindowSelectionView::NewLC( *this ); |
|
644 AddViewL( windowSelectionView ); // transfer ownership to CAknViewAppUi |
|
645 CleanupStack::Pop(); // windowSelectionView |
|
646 BROWSER_LOG( ( _L( "windowSelectionView up" ) ) ); |
|
647 |
|
648 //------------------------------------------------------------------------- |
|
649 |
|
650 iIdle = CIdle::NewL( CActive::EPriorityIdle ); |
|
651 |
|
652 // Create asyncronous object to call when exit requires it. |
|
653 iBrowserAsyncExit = CBrowserAsyncExit::NewL( this ); |
|
654 iStartedUp = ETrue; |
|
655 iSecureSiteVisited = EFalse; |
|
656 |
|
657 iPushMtmObserver = CBrowserPushMtmObserver::NewL( this ); |
|
658 iPushMtmObserver->StartObserver(); |
|
659 // Create two Panes of CBrowserContentViewContainer |
|
660 CBrowserGotoPane* gotoPane = CBrowserGotoPane::NewL( contentView->Container(), |
|
661 EMbmAvkonQgn_indi_find_goto, |
|
662 EMbmAvkonQgn_indi_find_goto_mask, |
|
663 ETrue, |
|
664 contentView ); |
|
665 |
|
666 // Create the find pane with magnifier glass icon, and |
|
667 // without adaptive popup list... |
|
668 CBrowserGotoPane* findKeywordPane = CBrowserGotoPane::NewL( contentView->Container(), |
|
669 EMbmAvkonQgn_indi_find_glass, |
|
670 EMbmAvkonQgn_indi_find_glass_mask, |
|
671 EFalse, |
|
672 contentView, |
|
673 ETrue ); |
|
674 contentView->Container()->SetGotoPane(gotoPane); |
|
675 contentView->Container()->SetFindKeywordPane(findKeywordPane); |
|
676 contentView->Container()->SetRect( rect ); |
|
677 contentView->Container()->GotoPane()->SetGPObserver(contentView); |
|
678 contentView->Container()->FindKeywordPane()->SetGPObserver(contentView); |
|
679 contentView->Container()->FindKeywordPane()->SetOrdinalPosition( 0 ); |
|
680 contentView->Container()->GotoPane()->SetOrdinalPosition( 0 ); |
|
681 |
|
682 #ifdef BRDO_OCC_ENABLED_FF |
624 #ifdef BRDO_OCC_ENABLED_FF |
683 iRetryConnectivity = CPeriodic::NewL(CActive::EPriorityStandard); |
625 iRetryConnectivity = CPeriodic::NewL(CActive::EPriorityStandard); |
684 #endif |
626 #endif |
685 |
627 |
628 // Create two Panes of CBrowserContentViewContainer |
|
629 CBrowserGotoPane* gotoPane = CBrowserGotoPane::NewL( contentView->Container(), |
|
630 EMbmAvkonQgn_indi_find_goto, |
|
631 EMbmAvkonQgn_indi_find_goto_mask, |
|
632 ETrue, |
|
633 contentView ); |
|
634 |
|
635 // Create the find pane with magnifier glass icon, and |
|
636 // without adaptive popup list... |
|
637 CBrowserGotoPane* findKeywordPane = CBrowserGotoPane::NewL( contentView->Container(), |
|
638 EMbmAvkonQgn_indi_find_glass, |
|
639 EMbmAvkonQgn_indi_find_glass_mask, |
|
640 EFalse, |
|
641 contentView, |
|
642 ETrue ); |
|
643 contentView->Container()->SetGotoPane(gotoPane); |
|
644 contentView->Container()->SetFindKeywordPane(findKeywordPane); |
|
645 //contentView->Container()->SetRect( rect ); // causes suncRepaint |
|
646 contentView->Container()->GotoPane()->SetGPObserver(contentView); |
|
647 contentView->Container()->FindKeywordPane()->SetGPObserver(contentView); |
|
648 contentView->Container()->FindKeywordPane()->SetOrdinalPosition( 0 ); |
|
649 contentView->Container()->GotoPane()->SetOrdinalPosition( 0 ); |
|
650 |
|
651 iStartedUp = ETrue; |
|
652 iSecureSiteVisited = EFalse; |
|
653 |
|
654 #ifdef BRDO_PERF_IMPROVEMENTS_ENABLED_FF |
|
655 if(LastActiveViewId() == KUidBrowserBookmarksViewId) |
|
656 { |
|
657 iBookmarksView->CheckForDownloads(); |
|
658 iBookmarksView->UpdateFavIconsL(); |
|
659 } |
|
660 #endif |
|
661 } |
|
662 |
|
663 // ----------------------------------------------------------------------------- |
|
664 // CBrowserAppUi::InitBrowserL() - THIS METHOD IS NOT USED FOR NORMAL STARTUP |
|
665 // This method is just for supporting Browser initialization if launched in Embedded mode |
|
666 // Normal initialization if split in BookmarksInit() and DelayedInit(). iStartedUp is FALSE |
|
667 // if BRowser has not initialized or partially initialized. |
|
668 // NOTE: DO NOT ADD ANY CODE HERE. IT IS JUST A WRAPPER. |
|
669 // ----------------------------------------------------------------------------- |
|
670 // |
|
671 void CBrowserAppUi::InitBrowserL() |
|
672 { |
|
673 // Bookmarks initialization |
|
674 InitBookmarksL(); |
|
675 |
|
676 // 2nd part of initialization |
|
677 DelayedInitL(); |
|
678 |
|
686 #ifdef BRDO_IAD_UPDATE_ENABLED_FF |
679 #ifdef BRDO_IAD_UPDATE_ENABLED_FF |
687 iDelayedUpdate = CIdle::NewL( CActive::EPriorityIdle ); |
680 // complete the IAD check asynchronously |
688 iDelayedUpdate->Start(TCallBack( CompleteIADUpdateCallback, this )); |
681 if(!IsEmbeddedModeOn()) |
682 { |
|
683 iDelayedUpdate = CIdle::NewL( CActive::EPriorityIdle ); |
|
684 iDelayedUpdate->Start(TCallBack( CompleteIADUpdateCallback, this )); |
|
685 } |
|
689 #endif |
686 #endif |
690 } //if (iStartedUp) |
687 } |
691 } |
688 |
692 |
689 |
693 // ----------------------------------------------------------------------------- |
690 // ----------------------------------------------------------------------------- |
694 // CBrowserAppUi::ProcessCommandL(TInt aCommand) |
691 // CBrowserAppUi::ProcessCommandL(TInt aCommand) |
695 // ----------------------------------------------------------------------------- |
692 // ----------------------------------------------------------------------------- |
696 // |
693 // |
1181 // CBrowserAppUi::FetchBookmarkL |
1178 // CBrowserAppUi::FetchBookmarkL |
1182 // ----------------------------------------------------------------------------- |
1179 // ----------------------------------------------------------------------------- |
1183 // |
1180 // |
1184 void CBrowserAppUi::FetchBookmarkL( TInt aBookmarkUid ) |
1181 void CBrowserAppUi::FetchBookmarkL( TInt aBookmarkUid ) |
1185 { |
1182 { |
1183 // complete initialization if not done yet, can happen if user selects |
|
1184 // a bookmark quickly after launch (within 1 second) |
|
1185 if ( !iStartedUp ) |
|
1186 CompleteDelayedInit(); |
|
1187 |
|
1186 SetViewToReturnOnClose( KUidBrowserBookmarksViewId ); |
1188 SetViewToReturnOnClose( KUidBrowserBookmarksViewId ); |
1187 if ( aBookmarkUid == KFavouritesStartPageUid ) |
1189 if ( aBookmarkUid == KFavouritesStartPageUid ) |
1188 { |
1190 { |
1189 TUint defaultAp = Preferences().DefaultAccessPoint(); |
1191 TUint defaultAp = Preferences().DefaultAccessPoint(); |
1190 if ( defaultAp != KWmlNoDefaultAccessPoint ) // There is no access point defined |
1192 if ( defaultAp != KWmlNoDefaultAccessPoint ) // There is no access point defined |
1219 // CBrowserAppUi::FetchBookmarkL |
1221 // CBrowserAppUi::FetchBookmarkL |
1220 // ----------------------------------------------------------------------------- |
1222 // ----------------------------------------------------------------------------- |
1221 // |
1223 // |
1222 void CBrowserAppUi::FetchBookmarkL( const CFavouritesItem& aBookmarkItem ) |
1224 void CBrowserAppUi::FetchBookmarkL( const CFavouritesItem& aBookmarkItem ) |
1223 { |
1225 { |
1226 // complete initialization if not done yet, can happen if user selects |
|
1227 // a bookmark quickly after launch (within 1 second) |
|
1228 if ( !iStartedUp ) |
|
1229 CompleteDelayedInit(); |
|
1230 |
|
1224 SetViewToReturnOnClose( KUidBrowserBookmarksViewId ); |
1231 SetViewToReturnOnClose( KUidBrowserBookmarksViewId ); |
1225 if ( Util::CheckBookmarkApL( *this, aBookmarkItem.WapAp()) ) |
1232 if ( Util::CheckBookmarkApL( *this, aBookmarkItem.WapAp()) ) |
1226 FetchL |
1233 FetchL |
1227 ( |
1234 ( |
1228 aBookmarkItem.Url() , |
1235 aBookmarkItem.Url() , |
1261 ( LastActiveViewId() == KUidBrowserContentViewId ) ) |
1268 ( LastActiveViewId() == KUidBrowserContentViewId ) ) |
1262 { |
1269 { |
1263 ContentView()->SetFullScreenOffL(); |
1270 ContentView()->SetFullScreenOffL(); |
1264 } |
1271 } |
1265 |
1272 |
1266 if ( iWindowManager->ContentView()->FullScreenMode() ) |
1273 if ( iWindowManager && iWindowManager->ContentView()->FullScreenMode() ) |
1267 { |
1274 { |
1268 if ( aUid == KUidBrowserFeedsFeedViewId ) |
1275 if ( aUid == KUidBrowserFeedsFeedViewId ) |
1269 { |
1276 { |
1270 BrCtlInterface().HandleCommandL( (TInt)TBrCtlDefs::ECommandIdBase + |
1277 BrCtlInterface().HandleCommandL( (TInt)TBrCtlDefs::ECommandIdBase + |
1271 (TInt)TBrCtlDefs::ECommandLeaveFullscreenBrowsing ); |
1278 (TInt)TBrCtlDefs::ECommandLeaveFullscreenBrowsing ); |
1283 |
1290 |
1284 if ( iIsForeground ) |
1291 if ( iIsForeground ) |
1285 { |
1292 { |
1286 if ( aUid == KUidBrowserSettingsViewId ) |
1293 if ( aUid == KUidBrowserSettingsViewId ) |
1287 { |
1294 { |
1295 //complete initialisation |
|
1296 if( !iStartedUp ) |
|
1297 CompleteDelayedInit(); |
|
1298 |
|
1288 CEikStatusPane* sp = STATIC_CAST( CAknAppUi*, |
1299 CEikStatusPane* sp = STATIC_CAST( CAknAppUi*, |
1289 CEikonEnv::Static()->EikAppUi() ) |
1300 CEikonEnv::Static()->EikAppUi() ) |
1290 ->StatusPane(); |
1301 ->StatusPane(); |
1291 sp->DrawNow(); |
1302 sp->DrawNow(); |
1292 } |
1303 } |
1351 // ----------------------------------------------------------------------------- |
1362 // ----------------------------------------------------------------------------- |
1352 // |
1363 // |
1353 void CBrowserAppUi::HandleForegroundEventL( TBool aForeground ) |
1364 void CBrowserAppUi::HandleForegroundEventL( TBool aForeground ) |
1354 { |
1365 { |
1355 // Handle this event only if the browser is started up |
1366 // Handle this event only if the browser is started up |
1356 if ( !StartedUp() ) |
1367 iIsForeground = IsForeground(); |
1357 { |
1368 if (!iStartedUp) |
1358 return; |
1369 return; |
1359 } |
1370 |
1360 iIsForeground = IsForeground(); |
|
1361 if( iIsForeground ) |
1371 if( iIsForeground ) |
1362 { |
1372 { |
1363 if (iViewToBeActivatedIfNeeded.iUid) |
1373 if (iViewToBeActivatedIfNeeded.iUid) |
1364 { |
1374 { |
1365 ActivateLocalViewL( iViewToBeActivatedIfNeeded ); |
1375 ActivateLocalViewL( iViewToBeActivatedIfNeeded ); |
1416 const TDesC& aPassword, |
1426 const TDesC& aPassword, |
1417 const TFavouritesWapAp& aAccessPoint, |
1427 const TFavouritesWapAp& aAccessPoint, |
1418 CBrowserLoadObserver::TBrowserLoadUrlType aUrlType ) |
1428 CBrowserLoadObserver::TBrowserLoadUrlType aUrlType ) |
1419 { |
1429 { |
1420 LOG_ENTERFN("CBrowserAppUi::FetchL"); |
1430 LOG_ENTERFN("CBrowserAppUi::FetchL"); |
1431 |
|
1432 // complete the initialization if not done yet |
|
1433 if(!iStartedUp) |
|
1434 CompleteDelayedInit(); |
|
1435 |
|
1421 // Let's cancel the previous fetch if any |
1436 // Let's cancel the previous fetch if any |
1422 if ( Fetching() ) |
1437 if ( Fetching() ) |
1423 { |
1438 { |
1424 CancelFetch(); |
1439 CancelFetch(); |
1425 } |
1440 } |
1628 |
1643 |
1629 TInt err( KErrNone ); |
1644 TInt err( KErrNone ); |
1630 TBool isStandAlone = !IsEmbeddedModeOn(); |
1645 TBool isStandAlone = !IsEmbeddedModeOn(); |
1631 BROWSER_LOG( ( _L( " isStandAlone: %d" ), isStandAlone ) ); |
1646 BROWSER_LOG( ( _L( " isStandAlone: %d" ), isStandAlone ) ); |
1632 |
1647 |
1633 if( isStandAlone && aUserInitiated ) |
1648 if(isStandAlone && aUserInitiated ) |
1634 { |
1649 { |
1635 if( !BrCtlInterface().OkToExit() ) |
1650 if( iStartedUp && !BrCtlInterface().OkToExit() ) |
1636 { |
1651 { |
1637 return; |
1652 return; |
1638 } |
1653 } |
1639 } |
1654 } |
1640 |
1655 |
1668 // if browser is embedded, should not call Exit(), |
1683 // if browser is embedded, should not call Exit(), |
1669 // just delete the object, otherwise leave occurs. |
1684 // just delete the object, otherwise leave occurs. |
1670 if( ( IsEmbeddedInOperatorMenu() || IsEmbeddedModeOn() ) && |
1685 if( ( IsEmbeddedInOperatorMenu() || IsEmbeddedModeOn() ) && |
1671 !ExitInProgress() && |
1686 !ExitInProgress() && |
1672 ((LoadObserver().LoadUrlType() == CBrowserLoadObserver::ELoadUrlTypeEmbeddedBrowserWithUrl) || |
1687 ((LoadObserver().LoadUrlType() == CBrowserLoadObserver::ELoadUrlTypeEmbeddedBrowserWithUrl) || |
1673 (LoadObserver().LoadUrlType() == CBrowserLoadObserver::ELoadUrlTypeOther) ) ) |
1688 (LoadObserver().LoadUrlType() == CBrowserLoadObserver::ELoadUrlTypeOther) ) ) |
1674 // ELoadUrlTypeEmbeddedBrowserWithUrl is typical for load via Phonebook, MMS, OperatorMenu |
1689 // ELoadUrlTypeEmbeddedBrowserWithUrl is typical for load via Phonebook, MMS, OperatorMenu |
1675 // ELoadUrlTypeOther is typical via Media download since those are via GotoPane entered urls |
1690 // ELoadUrlTypeOther is typical via Media download since those are via GotoPane entered urls |
1676 { |
1691 { |
1677 // Simulate an escape key event in order to close any open resources (for example an open dialog) |
1692 // Simulate an escape key event in order to close any open resources (for example an open dialog) |
1678 TKeyEvent keyEvent; |
1693 TKeyEvent keyEvent; |
1696 { |
1711 { |
1697 TRAP_IGNORE( SendDisconnectEventL() ); |
1712 TRAP_IGNORE( SendDisconnectEventL() ); |
1698 iConnection->Disconnect(); |
1713 iConnection->Disconnect(); |
1699 #ifdef __RSS_FEEDS |
1714 #ifdef __RSS_FEEDS |
1700 BROWSER_LOG( ( _L( " iFeedsClientUtilities->DisconnectFeedsViewL()" ) ) ); |
1715 BROWSER_LOG( ( _L( " iFeedsClientUtilities->DisconnectFeedsViewL()" ) ) ); |
1716 if ( iFeedsClientUtilities ) |
|
1717 { |
|
1701 TRAP_IGNORE( iFeedsClientUtilities->DisconnectFeedsViewL() ); |
1718 TRAP_IGNORE( iFeedsClientUtilities->DisconnectFeedsViewL() ); |
1702 //notify feeds engine to close the connection |
1719 //notify feeds engine to close the connection |
1703 TRAP_IGNORE( iFeedsClientUtilities->DisconnectManualUpdateConnectionL() ); |
1720 TRAP_IGNORE( iFeedsClientUtilities->DisconnectManualUpdateConnectionL() ); |
1721 } |
|
1704 #endif |
1722 #endif |
1705 } |
1723 } |
1706 if (SpecialLoadObserver().IsConnectionStarted()) |
1724 if (SpecialLoadObserver().IsConnectionStarted()) |
1707 { |
1725 { |
1708 if ( iWindowManager ) |
1726 if ( iWindowManager ) |
1726 if ( iConnection ) |
1744 if ( iConnection ) |
1727 { |
1745 { |
1728 TRAP_IGNORE( SendDisconnectEventL() ); |
1746 TRAP_IGNORE( SendDisconnectEventL() ); |
1729 iConnection->Disconnect(); |
1747 iConnection->Disconnect(); |
1730 #ifdef __RSS_FEEDS |
1748 #ifdef __RSS_FEEDS |
1749 if ( iFeedsClientUtilities ) |
|
1750 { |
|
1731 BROWSER_LOG( ( _L( " iFeedsClientUtilities->DisconnectFeedsViewL()" ) ) ); |
1751 BROWSER_LOG( ( _L( " iFeedsClientUtilities->DisconnectFeedsViewL()" ) ) ); |
1732 TRAP_IGNORE( iFeedsClientUtilities->DisconnectFeedsViewL() ); |
1752 TRAP_IGNORE( iFeedsClientUtilities->DisconnectFeedsViewL() ); |
1733 //notify feeds engine to close the connection |
1753 //notify feeds engine to close the connection |
1734 TRAP_IGNORE( iFeedsClientUtilities->DisconnectManualUpdateConnectionL() ); |
1754 TRAP_IGNORE( iFeedsClientUtilities->DisconnectManualUpdateConnectionL() ); |
1755 } |
|
1735 #endif |
1756 #endif |
1736 } |
1757 } |
1737 if (SpecialLoadObserver().IsConnectionStarted()) // If Connection request is in processing calling CAknAppUI::Exit() causes crash (JSAA-84RG9R) |
1758 if (SpecialLoadObserver().IsConnectionStarted()) // If Connection request is in processing calling CAknAppUI::Exit() causes crash (JSAA-84RG9R) |
1738 { |
1759 { |
1739 //ensure that the params are saved in BrCtl |
1760 //ensure that the params are saved in BrCtl |
2099 { |
2120 { |
2100 LOG_ENTERFN("CBrowserAppUi::ProcessCommandParametersL"); |
2121 LOG_ENTERFN("CBrowserAppUi::ProcessCommandParametersL"); |
2101 LOG_WRITE_FORMAT(" aCommand: %d", aCommand); |
2122 LOG_WRITE_FORMAT(" aCommand: %d", aCommand); |
2102 |
2123 |
2103 // The browser is in embedded mode and it is not initialized yet |
2124 // The browser is in embedded mode and it is not initialized yet |
2104 if ( !StartedUp() ) |
2125 if ( IsEmbeddedModeOn() && !iStartedUp) |
2105 { |
2126 { |
2106 return EFalse; |
2127 return EFalse; |
2107 } |
2128 } |
2108 |
2129 |
2109 if ( aCommand == EApaCommandOpen ) |
2130 if ( aCommand == EApaCommandOpen ) |
2144 |
2165 |
2145 if( !ptr.Compare(serviceSchemePtr) || !ptr.Compare(searchSchemePtr) ) |
2166 if( !ptr.Compare(serviceSchemePtr) || !ptr.Compare(searchSchemePtr) ) |
2146 { |
2167 { |
2147 specialSchemeInHomePageAddress = ETrue; |
2168 specialSchemeInHomePageAddress = ETrue; |
2148 SetLastActiveViewId(KUidBrowserBookmarksViewId); |
2169 SetLastActiveViewId(KUidBrowserBookmarksViewId); |
2170 SetViewToBeActivatedIfNeededL(KUidBrowserContentViewId, 0); |
|
2149 TRAPD( err, FetchL( ptr, CBrowserLoadObserver::ELoadUrlTypeOther ) ); |
2171 TRAPD( err, FetchL( ptr, CBrowserLoadObserver::ELoadUrlTypeOther ) ); |
2150 } |
2172 } |
2151 else |
2173 else |
2152 { |
2174 { |
2175 SetViewToBeActivatedIfNeededL(KUidBrowserContentViewId, 0); |
|
2153 StartFetchHomePageL(); |
2176 StartFetchHomePageL(); |
2154 } |
2177 } |
2155 CleanupStack::PopAndDestroy( 3,buf ); |
2178 CleanupStack::PopAndDestroy( 3,buf ); |
2156 } |
2179 } |
2157 else |
2180 else |
2158 { |
2181 { |
2182 SetViewToBeActivatedIfNeededL(KUidBrowserContentViewId, 0); |
|
2159 StartFetchHomePageL(); |
2183 StartFetchHomePageL(); |
2160 } |
2184 } |
2161 |
2185 |
2162 if( !specialSchemeInHomePageAddress ) |
2186 if( !specialSchemeInHomePageAddress ) |
2163 { |
2187 { |
2259 } |
2283 } |
2260 |
2284 |
2261 CBrowserCommandLineParser8* command = CBrowserCommandLineParser8::NewL( *params ); |
2285 CBrowserCommandLineParser8* command = CBrowserCommandLineParser8::NewL( *params ); |
2262 CleanupStack::PopAndDestroy( params ); |
2286 CleanupStack::PopAndDestroy( params ); |
2263 CleanupStack::PushL( command ); |
2287 CleanupStack::PushL( command ); |
2288 |
|
2289 |
|
2290 // complete the delayed initialization if bookmarks view is not the first view |
|
2291 if(ViewToActivate != KUidBrowserBookmarksViewId && !iStartedUp) |
|
2292 CompleteDelayedInit(); |
|
2264 |
2293 |
2265 //wait a while, contentview initializing itself |
2294 //wait a while, contentview initializing itself |
2266 WaitCVInit(); |
2295 WaitCVInit(); |
2267 switch ( command->Count() ) |
2296 switch ( command->Count() ) |
2268 { |
2297 { |
2291 iLongZeroPressed = ETrue; |
2320 iLongZeroPressed = ETrue; |
2292 FetchHomePageL(); |
2321 FetchHomePageL(); |
2293 } |
2322 } |
2294 else |
2323 else |
2295 { |
2324 { |
2325 if (iStartedUp) |
|
2296 ContentView()->SetFullScreenOffL(); |
2326 ContentView()->SetFullScreenOffL(); |
2327 |
|
2297 if ( !IsEmbeddedModeOn() ) |
2328 if ( !IsEmbeddedModeOn() ) |
2298 { |
2329 { |
2299 SetLastActiveViewId( KUidBrowserBookmarksViewId ); |
2330 SetLastActiveViewId( KUidBrowserBookmarksViewId ); |
2300 } |
2331 } |
2301 } |
2332 } |
2582 // CBrowserAppUi::WaitCVInit |
2613 // CBrowserAppUi::WaitCVInit |
2583 // ----------------------------------------------------------------------------- |
2614 // ----------------------------------------------------------------------------- |
2584 // |
2615 // |
2585 void CBrowserAppUi::WaitCVInit() |
2616 void CBrowserAppUi::WaitCVInit() |
2586 { |
2617 { |
2587 if( iParametrizedLaunchInProgress == 0 ) |
2618 if( iParametrizedLaunchInProgress == 0 && iStartedUp) |
2588 { |
2619 { |
2589 iParametrizedLaunchInProgress = 1; |
2620 iParametrizedLaunchInProgress = 1; |
2590 iIdle->Cancel(); |
2621 iIdle->Cancel(); |
2591 iIdle->Start( TCallBack( StopDelay, this ) ); |
2622 iIdle->Start( TCallBack( StopDelay, this ) ); |
2592 iWait.Start(); |
2623 iWait.Start(); |
3853 { |
3884 { |
3854 CBrowserViewBase* activeView = ActiveView( ); |
3885 CBrowserViewBase* activeView = ActiveView( ); |
3855 if( activeView != NULL ) |
3886 if( activeView != NULL ) |
3856 { |
3887 { |
3857 activeView->HandleClientRectChange(); |
3888 activeView->HandleClientRectChange(); |
3858 if (activeView != ContentView()) |
3889 if ( ContentView() && (activeView != ContentView()) ) |
3859 { |
3890 { |
3860 ContentView()->HandleClientRectChange(); |
3891 ContentView()->HandleClientRectChange(); |
3861 } |
3892 } |
3862 } |
3893 } |
3863 } |
3894 } |
4197 // --------------------------------------------------------- |
4228 // --------------------------------------------------------- |
4198 // |
4229 // |
4199 void CBrowserAppUi::SendDisconnectEventL() |
4230 void CBrowserAppUi::SendDisconnectEventL() |
4200 { |
4231 { |
4201 LOG_ENTERFN("CBrowserAppUi::SendDisconnectEventL"); |
4232 LOG_ENTERFN("CBrowserAppUi::SendDisconnectEventL"); |
4233 |
|
4234 if(!iStartedUp) |
|
4235 return; |
|
4236 |
|
4202 SpecialLoadObserver().CancelConnection(); |
4237 SpecialLoadObserver().CancelConnection(); |
4203 CArrayFixFlat<CWindowInfo*>* windows = iWindowManager->GetWindowInfoL( this ); |
4238 CArrayFixFlat<CWindowInfo*>* windows = iWindowManager->GetWindowInfoL( this ); |
4204 if( windows ) |
4239 if( windows ) |
4205 { |
4240 { |
4206 TInt i; |
4241 TInt i; |
4218 } |
4253 } |
4219 } |
4254 } |
4220 |
4255 |
4221 CBrowserWindow* window = NULL; |
4256 CBrowserWindow* window = NULL; |
4222 iWindowManager->Window( windows->At( 0 )->iWindowId, window ); |
4257 iWindowManager->Window( windows->At( 0 )->iWindowId, window ); |
4223 |
4258 |
4224 // Close session only once |
|
4225 if (window) |
|
4226 { |
|
4227 window->BrCtlInterface().HandleCommandL( (TInt)TBrCtlDefs::ECommandDisconnect + (TInt)TBrCtlDefs::ECommandIdBase ); |
|
4228 } |
|
4229 |
|
4230 // delete the window items before deleting the array |
4259 // delete the window items before deleting the array |
4231 for( i=0; i<windows->Count(); ++i ) |
4260 for( i=0; i<windows->Count(); ++i ) |
4232 delete windows->At( i ); |
4261 delete windows->At( i ); |
4233 |
4262 |
4234 delete windows; |
4263 delete windows; |
4586 // --------------------------------------------------------- |
4615 // --------------------------------------------------------- |
4587 // CBrowserAppUi::StartFetchHomePageL |
4616 // CBrowserAppUi::StartFetchHomePageL |
4588 // --------------------------------------------------------- |
4617 // --------------------------------------------------------- |
4589 void CBrowserAppUi::StartFetchHomePageL(void) |
4618 void CBrowserAppUi::StartFetchHomePageL(void) |
4590 { |
4619 { |
4620 if(!iStartedUp) |
|
4621 CompleteDelayedInit(); |
|
4591 |
4622 |
4592 // There's a homepage to be launched so start in content view |
4623 // There's a homepage to be launched so start in content view |
4593 SetLastActiveViewId(KUidBrowserContentViewId); |
4624 SetLastActiveViewId(KUidBrowserContentViewId); |
4594 //wait for contentview to initialize itself |
4625 //wait for contentview to initialize itself |
4595 WaitCVInit(); |
4626 WaitCVInit(); |