|         |      1 /* | 
|         |      2 * Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). | 
|         |      3 * All rights reserved. | 
|         |      4 * This component and the accompanying materials are made available | 
|         |      5 * under the terms of the License "Eclipse Public License v1.0" | 
|         |      6 * which accompanies this distribution, and is available | 
|         |      7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". | 
|         |      8 * | 
|         |      9 * Initial Contributors: | 
|         |     10 * Nokia Corporation - initial contribution. | 
|         |     11 * | 
|         |     12 * Contributors: | 
|         |     13 * | 
|         |     14 * Description:   | 
|         |     15 * | 
|         |     16 */ | 
|         |     17  | 
|         |     18  | 
|         |     19 // INCLUDE Files | 
|         |     20  | 
|         |     21 // User includes | 
|         |     22 #include "BrowserWindowFocusNotifier.h"	// Class header | 
|         |     23 #include "logger.h" | 
|         |     24  | 
|         |     25 // System includes | 
|         |     26 #include <e32std.h> | 
|         |     27  | 
|         |     28 // CONSTANTS | 
|         |     29  | 
|         |     30 //----------------------------------------------------------------------------- | 
|         |     31 // CBrowserWindowFocusNotifier::CBrowserWindowFocusNotifier | 
|         |     32 //----------------------------------------------------------------------------- | 
|         |     33 CBrowserWindowFocusNotifier::CBrowserWindowFocusNotifier() | 
|         |     34 	{ | 
|         |     35 	} | 
|         |     36 	 | 
|         |     37 //----------------------------------------------------------------------------- | 
|         |     38 // CBrowserWindowFocusNotifier::~CBrowserWindowFocusNotifier | 
|         |     39 //----------------------------------------------------------------------------- | 
|         |     40 CBrowserWindowFocusNotifier::~CBrowserWindowFocusNotifier() | 
|         |     41 	{ | 
|         |     42 LOG_ENTERFN("~CBrowserWindowFocusNotifier"); | 
|         |     43 	FlushAOStatusArray(); | 
|         |     44 	} | 
|         |     45  | 
|         |     46 //----------------------------------------------------------------------------- | 
|         |     47 //	CBrowserWindowFocusNotifier* CBrowserWindowFocusNotifier::NewL | 
|         |     48 //----------------------------------------------------------------------------- | 
|         |     49 CBrowserWindowFocusNotifier* CBrowserWindowFocusNotifier::NewL() | 
|         |     50 	{ | 
|         |     51 	CBrowserWindowFocusNotifier* self = new (ELeave)  | 
|         |     52 	                                            CBrowserWindowFocusNotifier(); | 
|         |     53 	         | 
|         |     54 	CleanupStack::PushL( self ); | 
|         |     55 	self->ConstructL( ); | 
|         |     56 	CleanupStack::Pop( self );   // self | 
|         |     57 	return self; | 
|         |     58 	} | 
|         |     59  | 
|         |     60  | 
|         |     61 //----------------------------------------------------------------------------- | 
|         |     62 //  CBrowserWindowFocusNotifier::ConstructL | 
|         |     63 // | 
|         |     64 //----------------------------------------------------------------------------- | 
|         |     65 void CBrowserWindowFocusNotifier::ConstructL() | 
|         |     66 	{ | 
|         |     67 	} | 
|         |     68  | 
|         |     69  | 
|         |     70 //----------------------------------------------------------------------------- | 
|         |     71 //  CBrowserWindowFocusNotifier::Add() | 
|         |     72 //----------------------------------------------------------------------------- | 
|         |     73 TInt CBrowserWindowFocusNotifier::Add( TRequestStatus* aStatus ) | 
|         |     74     { | 
|         |     75     return iAOStatusArray.Append( aStatus ); | 
|         |     76     } | 
|         |     77      | 
|         |     78     | 
|         |     79 //----------------------------------------------------------------------------- | 
|         |     80 //  CBrowserWindowFocusNotifier::OnFocusGained() | 
|         |     81 //----------------------------------------------------------------------------- | 
|         |     82 void CBrowserWindowFocusNotifier::OnFocusGained() | 
|         |     83     { | 
|         |     84     FlushAOStatusArray(); | 
|         |     85     } | 
|         |     86      | 
|         |     87      | 
|         |     88 //----------------------------------------------------------------------------- | 
|         |     89 //  CBrowserWindowFocusNotifier::FlushAOStatusArray() | 
|         |     90 //----------------------------------------------------------------------------- | 
|         |     91 void CBrowserWindowFocusNotifier::FlushAOStatusArray() | 
|         |     92     { | 
|         |     93 LOG_ENTERFN("CBrowserWindowFocusNotifier::FlushAOStatusArray"); | 
|         |     94     TInt count = iAOStatusArray.Count(); | 
|         |     95 BROWSER_LOG( ( _L( "Flush count: %d" ), count ) ); | 
|         |     96 	 | 
|         |     97 	// Clear all status requests and then clear array - in order | 
|         |     98 	for ( TInt i = 0; i < count; i++ ) | 
|         |     99     	{ | 
|         |    100 BROWSER_LOG( ( _L( "Flushing: %d" ), i ) ); | 
|         |    101     	TRequestStatus* status = iAOStatusArray[i]; | 
|         |    102     	User::RequestComplete( status, KErrNone ); | 
|         |    103     	} | 
|         |    104     	 | 
|         |    105 	iAOStatusArray.Reset(); | 
|         |    106     } | 
|         |    107              | 
|         |    108 //  End of File |