browserutilities/connectionmanager/Src/ConnectionObservers.cpp
branchRCL_3
changeset 48 79859ed3eea9
parent 41 4bd5176e1bc8
child 49 919f36ff910f
equal deleted inserted replaced
47:e1bea15f9a39 48:79859ed3eea9
    16 *	  Both the requested and the stored AP's are here.
    16 *	  Both the requested and the stored AP's are here.
    17 *
    17 *
    18 *
    18 *
    19 */
    19 */
    20 
    20 
       
    21 
       
    22 
    21 #include <nifman.h>
    23 #include <nifman.h>
    22 #include <nifvar.h>
    24 #include <nifvar.h>
    23 #include <in_sock.h>
    25 #include <in_sock.h>
    24 #include <browser_platform_variant.hrh>
    26 
    25 #include <connectionobservers.h>
    27 #include "ConnectionObservers.h"
    26 #include "ConnectionManagerLogger.h"
    28 #include "ConnectionManagerLogger.h"
       
    29 
    27 
    30 
    28 //--------------------------------------------------------------------------
    31 //--------------------------------------------------------------------------
    29 //CConnectionStageNotifierWCB::NewL()
    32 //CConnectionStageNotifierWCB::NewL()
    30 //--------------------------------------------------------------------------
    33 //--------------------------------------------------------------------------
    31 EXPORT_C CConnectionStageNotifierWCB* CConnectionStageNotifierWCB::NewL( TInt aPriority )
    34 EXPORT_C CConnectionStageNotifierWCB* CConnectionStageNotifierWCB::NewL( TInt aPriority )
   104 //--------------------------------------------------------------------------
   107 //--------------------------------------------------------------------------
   105 void CConnectionStageNotifierWCB::RunL()
   108 void CConnectionStageNotifierWCB::RunL()
   106 	{
   109 	{
   107 	CLOG_ENTERFN("CConnectionStageNotifierWCB::RunL()");
   110 	CLOG_ENTERFN("CConnectionStageNotifierWCB::RunL()");
   108     CLOG_WRITE_1( "CConnectionStageNotifierWCB Stage: %d", iProgressBuf().iStage );
   111     CLOG_WRITE_1( "CConnectionStageNotifierWCB Stage: %d", iProgressBuf().iStage );
   109     CLOG_WRITE_1( "CConnectionStageNotifierWCB Stage Error id: %d", iProgressBuf().iError );
       
   110 
   112 
   111     if( !iMultiObserver )
   113     if( !iMultiObserver )
   112         {
   114         {
   113         CLOG_WRITE( "CConnectionStageNotifierWCB Browser UI" );
   115 	    if ( iProgressBuf().iStage == iStageToObserve )
   114         if ( iProgressBuf().iStage == iStageToObserve )
   116 		    {
   115             {
       
   116             CLOG_WRITE( "Stage achived" );
   117             CLOG_WRITE( "Stage achived" );
   117 		    DoCloseAgent();
   118 		    DoCloseAgent();
   118 		    iObserver->ConnectionStageAchievedL();
   119 		    iObserver->ConnectionStageAchievedL();
   119 		    }
   120 		    }
   120 	    else//reissuing request
   121 	    else//reissuing request
   124 		    SetActive();
   125 		    SetActive();
   125 		    }
   126 		    }
   126         }
   127         }
   127     else
   128     else
   128         {
   129         {
   129         CLOG_WRITE( "CConnectionStageNotifierWCB Connection Manager" );
       
   130         if( IsAnyStageReached( iProgressBuf().iStage ) )
   130         if( IsAnyStageReached( iProgressBuf().iStage ) )
   131             {
   131             {
   132             iMultiObserver->ConnectionStageAchievedL( iProgressBuf().iStage );
   132             iMultiObserver->ConnectionStageAchievedL( iProgressBuf().iStage );
   133             }
   133             }
   134 		else{
   134 		else{
   229     CLOG_ENTERFN( "CConnectionStageNotifierWCB::DoOpenAgentL" );
   229     CLOG_ENTERFN( "CConnectionStageNotifierWCB::DoOpenAgentL" );
   230     TInt err( KErrNone );
   230     TInt err( KErrNone );
   231     if( (err = iServer.Connect()) == KErrNone )
   231     if( (err = iServer.Connect()) == KErrNone )
   232         {
   232         {
   233         err = iConnection.Open( iServer, *aConnName );
   233         err = iConnection.Open( iServer, *aConnName );
   234 #ifndef BRDO_OCC_ENABLED_FF
       
   235         if( !err )
   234         if( !err )
   236             {
   235             {
   237             TBuf<64> query;
   236             TBuf<64> query;
   238             TUint32 apId;
   237             TUint32 apId;
   239             TUint32 netId;
   238             TUint32 netId;
   257                         CLOG_WRITE_1( "Attach result: %d", err );
   256                         CLOG_WRITE_1( "Attach result: %d", err );
   258                         }
   257                         }
   259                     }
   258                     }
   260                 }
   259                 }
   261             }
   260             }
   262 #endif
   261         }
   263         }
   262 
   264     CLOG_WRITE_1( "CConnectionStageNotifierWCB::DoOpenAgentL Any error: %d", err );
       
   265     if( err )
   263     if( err )
   266         {
   264         {
   267         iConnection.Close();
   265         iConnection.Close();
   268         iServer.Close();
   266         iServer.Close();
   269         User::Leave( err );
   267         User::Leave( err );
   294         }
   292         }
   295 
   293 
   296     return EFalse;
   294     return EFalse;
   297     }
   295     }
   298 
   296 
   299 //--------------------------------------------------------------------------
       
   300 //CConnectionStageNotifierWCB::GetProgressBuffer()
       
   301 //--------------------------------------------------------------------------
       
   302 EXPORT_C TNifProgressBuf
       
   303     CConnectionStageNotifierWCB::GetProgressBuffer()
       
   304     {
       
   305     CLOG_ENTERFN( "CConnectionStageNotifierWCB::GetProgressBuffer()" );
       
   306     return iProgressBuf;
       
   307     }
       
   308     
       
   309 //EOF
   297 //EOF