widgets/widgetapp/src/WidgetUiWindowManager.cpp
branchRCL_3
changeset 47 e1bea15f9a39
parent 46 30342f40acbf
child 48 79859ed3eea9
equal deleted inserted replaced
46:30342f40acbf 47:e1bea15f9a39
    24 #include "WidgetUiNetworkListener.h"
    24 #include "WidgetUiNetworkListener.h"
    25 #include "WidgetInstallerInternalCRKeys.h"
    25 #include "WidgetInstallerInternalCRKeys.h"
    26 #include "SWInstWidgetUid.h"
    26 #include "SWInstWidgetUid.h"
    27 #include "widgetappdefs.rh"
    27 #include "widgetappdefs.rh"
    28 #include "browser_platform_variant.hrh"
    28 #include "browser_platform_variant.hrh"
       
    29 #include "WidgetUiPSNotifier.h"
    29 #ifdef BRDO_WRT_HS_FF
    30 #ifdef BRDO_WRT_HS_FF
    30 #include "cpspublisher.h"
    31 #include "cpspublisher.h"
    31 #endif
    32 #endif
    32 
    33 
    33 #include <WidgetUi.rsg>
    34 #include <WidgetUi.rsg>
   195 #ifdef BRDO_OCC_ENABLED_FF
   196 #ifdef BRDO_OCC_ENABLED_FF
   196     iConnStageNotifier = CConnectionStageNotifierWCB::NewL();
   197     iConnStageNotifier = CConnectionStageNotifierWCB::NewL();
   197     iConnStageNotifier->SetPriority(CActive::EPriorityHigh);
   198     iConnStageNotifier->SetPriority(CActive::EPriorityHigh);
   198     iRetryConnectivity = CPeriodic::NewL(CActive::EPriorityStandard);
   199     iRetryConnectivity = CPeriodic::NewL(CActive::EPriorityStandard);
   199 #endif
   200 #endif
       
   201     
       
   202         //Creating observer WidgetWindowsObeserver
       
   203     iWidgetNotifier = CWidgetUiPSNotifier::NewL(*this, EWidgetRegAltered);
       
   204     	
       
   205 #ifdef BRDO_SAPINTFN_ENABLED_FF
       
   206     iWidgetSapiNotifier = CWidgetUiPSNotifier::NewL(*this, ESapiPrompt);
       
   207     iWidgetSapiClearNotifier = CWidgetUiPSNotifier::NewL(*this, ESapiPromptCleared);
       
   208 #endif
   200     }
   209     }
   201 
   210 
   202 // -----------------------------------------------------------------------------
   211 // -----------------------------------------------------------------------------
   203 // CWidgetUiWindowManager::NewL
   212 // CWidgetUiWindowManager::NewL
   204 // Two-phased constructor
   213 // Two-phased constructor
   264     delete iConnection;
   273     delete iConnection;
   265 #ifdef BRDO_WRT_HS_FF  
   274 #ifdef BRDO_WRT_HS_FF  
   266     delete iCpsPublisher;
   275     delete iCpsPublisher;
   267 #endif
   276 #endif
   268     delete iDb;
   277     delete iDb;
       
   278     delete iWidgetNotifier;
       
   279     
       
   280 #ifdef BRDO_SAPINTFN_ENABLED_FF
       
   281     delete iWidgetSapiNotifier;
       
   282     delete iWidgetSapiClearNotifier;
       
   283 #endif
   269     }
   284     }
   270 
   285 
   271 // -----------------------------------------------------------------------------
   286 // -----------------------------------------------------------------------------
   272 // CWidgetUiWindowManager::DeactivateMiniViewL()
   287 // CWidgetUiWindowManager::DeactivateMiniViewL()
   273 // Stop MiniView. Stops publishing and exits widget
   288 // Stop MiniView. Stops publishing and exits widget
   472                     {
   487                     {
   473                     iActiveFsWindow->Engine()->SetRect( View()->ClientRect() );
   488                     iActiveFsWindow->Engine()->SetRect( View()->ClientRect() );
   474                     }
   489                     }
   475                 iActiveFsWindow->SetCurrentWindow( ETrue ); 
   490                 iActiveFsWindow->SetCurrentWindow( ETrue ); 
   476           	   
   491           	   
   477             }else
   492                 }
   478          	    Exit( EEikCmdExit, aUid );
   493             else if (window->getSapiPromptCleared())
       
   494                 {
       
   495                 Exit( EEikCmdExit, aUid );
       
   496                 }
       
   497                        
       
   498          	    
   479 #else
   499 #else
   480                 Exit( EEikCmdExit, aUid );
   500                 Exit( EEikCmdExit, aUid );
   481 #endif
   501 #endif
   482         	}
   502         	}
   483         	break;
   503         	break;
   762 #ifdef BRDO_OCC_ENABLED_FF                                    
   782 #ifdef BRDO_OCC_ENABLED_FF                                    
   763                 StopConnectionObserving();
   783                 StopConnectionObserving();
   764 #endif
   784 #endif
   765                 iConnection->StopConnectionL();
   785                 iConnection->StopConnectionL();
   766                 }             
   786                 }             
   767             delete aWidgetWindow;
   787             if(!aWidgetWindow->Engine()->IsSynchRequestPending())
       
   788             	delete aWidgetWindow;
       
   789 			else
       
   790 				{
       
   791 				//Let sync request complete and then delete					
       
   792 				aWidgetWindow->DeleteItself();
       
   793 				}
   768             }
   794             }
   769         }
   795         }
   770     return EFalse;
   796     return EFalse;
   771     }
   797     }
   772 
   798 
  1421     TTimeIntervalSeconds  seconds;
  1447     TTimeIntervalSeconds  seconds;
  1422     TInt nCountWidgetClosed = 0;
  1448     TInt nCountWidgetClosed = 0;
  1423     TBool bAllWindowsClosed = ETrue;
  1449     TBool bAllWindowsClosed = ETrue;
  1424       
  1450       
  1425     TInt nWidgetsCount = iWindowList.Count();
  1451     TInt nWidgetsCount = iWindowList.Count();
       
  1452     if(nWidgetsCount > 0)
       
  1453         { 
       
  1454         CWidgetUiWindow* window = iWindowList[0];
       
  1455         TRAP_IGNORE( window->Engine()->HandleCommandL( 
       
  1456                     (TInt)TBrCtlDefs::ECommandIdBase +
       
  1457                     (TInt)TBrCtlDefs::ECommandOOMExit ) );
       
  1458         } 
  1426     for ( TInt i = (nWidgetsCount-1); i >= 0; i-- )
  1459     for ( TInt i = (nWidgetsCount-1); i >= 0; i-- )
  1427         {
  1460         {
  1428         CWidgetUiWindow* window = iWindowList[i];        
  1461         CWidgetUiWindow* window = iWindowList[i];        
  1429         err = currentTime.SecondsFrom(iTimeLastWidgetOpen,seconds);
  1462         err = currentTime.SecondsFrom(iTimeLastWidgetOpen,seconds);
  1430         if ( err == KErrOverflow || seconds.Int() > KOOMWidgetCloseTimeOut)
  1463         if ( err == KErrOverflow || seconds.Int() > KOOMWidgetCloseTimeOut)
  1584     TInt err = KErrNone;
  1617     TInt err = KErrNone;
  1585     if ( !iConnection->Connected() )
  1618     if ( !iConnection->Connected() )
  1586        {
  1619        {
  1587        TRAP_IGNORE( err = iConnection->StartConnectionL( ETrue ) );
  1620        TRAP_IGNORE( err = iConnection->StartConnectionL( ETrue ) );
  1588        }
  1621        }
       
  1622     
       
  1623     //Root cause needs to be identified..
       
  1624     //Fix for Array out of bound crash..
       
  1625     if(!iWindowList.Count())   
       
  1626     	return err;
       
  1627     	
  1589     CWidgetUiWindow* window( iWindowList[0] );
  1628     CWidgetUiWindow* window( iWindowList[0] );
  1590     if( err == KErrNone )
  1629     if( err == KErrNone )
  1591        { 
  1630        { 
  1592    
  1631    
  1593        TRAP_IGNORE( window->Engine()->HandleCommandL( (TInt)TBrCtlDefs::ECommandUnSetRetryConnectivityFlag + (TInt)TBrCtlDefs::ECommandIdBase ) );
  1632        TRAP_IGNORE( window->Engine()->HandleCommandL( (TInt)TBrCtlDefs::ECommandUnSetRetryConnectivityFlag + (TInt)TBrCtlDefs::ECommandIdBase ) );