|
1 /* |
|
2 * Copyright (c) 2004 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: Handle special load events such as network connection, |
|
15 * deal with non-http or non-html requests |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 |
|
21 // INCLUDE FILES |
|
22 #include "BrowserLoadObserver.h" |
|
23 #include "ApiProvider.h" |
|
24 #include "Display.h" |
|
25 #include "BrowserContentView.h" |
|
26 #include "CommonConstants.h" |
|
27 #include "BrowserAppUi.h" |
|
28 #include "logger.h" |
|
29 #include "BrowserWindow.h" |
|
30 #include "BrowserWindowManager.h" |
|
31 #include "BrowserDialogsProviderProxy.h" |
|
32 |
|
33 #include <FeatMgr.h> |
|
34 #include <MConnection.h> |
|
35 #include <BrowserDialogsProvider.h> |
|
36 |
|
37 #ifdef I__LOG_EVENT_TIME |
|
38 // defines a local timer with name 'localTime' |
|
39 #define START_TIMER( localTime ) TTime localTime; localTime.HomeTime(); |
|
40 |
|
41 // count the elapsed time based on timer 'localTime' |
|
42 // and increment number of timers called ( numOfTimer ) |
|
43 #define STOP_TIMER( localTime, numOfTimer ) \ |
|
44 TTime locTime__a; locTime__a.HomeTime(); \ |
|
45 TInt64 updateTime = locTime__a.MicroSecondsFrom( localTime ).Int64(); \ |
|
46 LOG_WRITE_FORMAT( "Update time: %d", updateTime ); \ |
|
47 ++numOfTimer; \ |
|
48 CBrowserLoadObserver::iTotalUpdateTime += updateTime; |
|
49 #else // I__LOG_EVENT_TIME |
|
50 // empty macros |
|
51 #define START_TIMER( a ) |
|
52 #define STOP_TIMER( a, b ) |
|
53 #endif // I__LOG_EVENT_TIME |
|
54 |
|
55 // --------------------------------------------------------- |
|
56 // CBrowserLoadObserver::NewL() |
|
57 // --------------------------------------------------------- |
|
58 // |
|
59 CBrowserLoadObserver* CBrowserLoadObserver::NewL( |
|
60 MApiProvider& aApiProvider, |
|
61 CBrowserContentView& aContentView, |
|
62 CBrowserWindow& aWindow ) |
|
63 { |
|
64 CBrowserLoadObserver* self = |
|
65 new (ELeave) CBrowserLoadObserver( aApiProvider, aContentView, aWindow ); |
|
66 CleanupStack::PushL( self ); |
|
67 self->ConstructL( ); |
|
68 CleanupStack::Pop(); // self |
|
69 return self; |
|
70 } |
|
71 |
|
72 // --------------------------------------------------------- |
|
73 // CBrowserLoadObserver::~CBrowserLoadObserver() |
|
74 // --------------------------------------------------------- |
|
75 // |
|
76 CBrowserLoadObserver::~CBrowserLoadObserver() |
|
77 { |
|
78 // iApiProvider, iContentView, iWindow not owned by CBRowserLoadObserver. |
|
79 // invalidate pointer for a cleaner/clearer destruction |
|
80 iApiProvider = NULL; |
|
81 iContentView = NULL; |
|
82 iWindow = NULL; |
|
83 } |
|
84 |
|
85 // ---------------------------------------------------------------------------- |
|
86 // CBrowserLoadObserver::HandleBrowserLoadEventL() |
|
87 // ---------------------------------------------------------------------------- |
|
88 // |
|
89 void CBrowserLoadObserver::HandleBrowserLoadEventL( |
|
90 TBrCtlDefs::TBrCtlLoadEvent aLoadEvent, |
|
91 TUint aSize, |
|
92 TUint16 aTransactionId) |
|
93 { |
|
94 LOG_ENTERFN("CBrowserLoadObserver::HandleBrowserLoadEventL"); |
|
95 LOG_WRITE_FORMAT(" LoadEvent: %d", aLoadEvent ); |
|
96 LOG_WRITE_FORMAT(" Size: %d", aSize ); |
|
97 LOG_WRITE_FORMAT(" TrId: %d", aTransactionId ); |
|
98 LOG_WRITE_FORMAT(" LoadState: %d", iLoadState ); |
|
99 LOG_WRITE_FORMAT(" LoadType: %d", iLoadUrlType ); |
|
100 if( aLoadEvent == TBrCtlDefs::EEventNewContentDisplayed ) |
|
101 { |
|
102 iWindow->ResetPageOverviewLocalSettingL(); |
|
103 iWindow->SetImagesLoaded(EFalse); |
|
104 } |
|
105 switch( iLoadUrlType ) |
|
106 { |
|
107 default: |
|
108 { |
|
109 HandleLoadEventOtherL( aLoadEvent, aSize, aTransactionId ); |
|
110 break; |
|
111 } |
|
112 } |
|
113 } |
|
114 |
|
115 // ---------------------------------------------------------------------------- |
|
116 // CBrowserLoadObserver::HandleLoadEventOtherL() |
|
117 // ---------------------------------------------------------------------------- |
|
118 // |
|
119 void CBrowserLoadObserver::HandleLoadEventOtherL( |
|
120 TBrCtlDefs::TBrCtlLoadEvent aLoadEvent, |
|
121 TUint aSize, |
|
122 TUint16 aTransactionId ) |
|
123 { |
|
124 #define STATECHECK( a ) { if( (iLoadState & a) == 0 ) break; } |
|
125 |
|
126 TInt err( KErrNone ); |
|
127 switch( aLoadEvent ) |
|
128 { |
|
129 case TBrCtlDefs::EEventLoadError: |
|
130 { |
|
131 SetStatus( ELoadStatusMainError ); |
|
132 break; |
|
133 } |
|
134 case TBrCtlDefs::EEventEnteringSecurePage: |
|
135 { |
|
136 SetStatus( ELoadStatusSecurePage ); |
|
137 SetStatus( ELoadStatusAllItemIsSecure ); |
|
138 UpdateSecureIndicatorL(); |
|
139 break; |
|
140 } |
|
141 case TBrCtlDefs::EEventSomeItemsNotSecure: |
|
142 { |
|
143 ClearStatus( ELoadStatusAllItemIsSecure ); |
|
144 UpdateSecureIndicatorL(); |
|
145 break; |
|
146 } |
|
147 case TBrCtlDefs::EEventSecureItemInNonSecurePage: |
|
148 { |
|
149 SetStatus( ELoadStatusSecureItemNonSecurePage ); |
|
150 UpdateSecureIndicatorL(); |
|
151 break; |
|
152 } |
|
153 case TBrCtlDefs::EEventExitingSecurePage: |
|
154 case TBrCtlDefs::EEventSubmittingToNonSecurePage: |
|
155 { |
|
156 ClearStatus( ELoadStatusSecurePage ); |
|
157 ClearStatus( ELoadStatusAllItemIsSecure ); |
|
158 SetStatus ( ELoadStatusSecurePageVisited ); |
|
159 UpdateSecureIndicatorL(); |
|
160 break; |
|
161 } |
|
162 case TBrCtlDefs::EEventTitleAvailable: |
|
163 { |
|
164 SetStatus( ELoadStatusTitleAvailable ); |
|
165 NewTitleAvailableL(); |
|
166 break; |
|
167 } |
|
168 case TBrCtlDefs::EEventNewContentStart: |
|
169 { |
|
170 #ifdef I__LOG_EVENT_TIME |
|
171 iStartDownloadTime.HomeTime(); |
|
172 iTotalUpdateTime = 0; |
|
173 iNumberOfUpdates = 0; |
|
174 #endif // I__LOG_EVENT_TIME |
|
175 StateChange( ELoadStateResponseInProgress ); |
|
176 iApiProvider->SetProgressShown( ETrue ); |
|
177 iApiProvider->Display().StartProgressAnimationL(); |
|
178 |
|
179 // in case we're in bookmarks view and a background page load is in |
|
180 // progress, don't update the softkeys |
|
181 if( iApiProvider->IsForeGround() && InBrowserContentView() ) |
|
182 { |
|
183 if( CBrowserAppUi::Static()->ActiveView() ) |
|
184 { |
|
185 CBrowserAppUi::Static()->ActiveView()->UpdateCbaL(); |
|
186 } |
|
187 } |
|
188 iApiProvider->WindowMgr().NotifyObserversL( EWindowLoadStart, iWindow->WindowId() ); |
|
189 break; |
|
190 } |
|
191 case TBrCtlDefs::EEventUrlLoadingStart: |
|
192 { |
|
193 STATECHECK( ELoadStateResponseInProgress ) |
|
194 iApiProvider->Display().StartProgressAnimationL(); |
|
195 |
|
196 // If the load is not initiated from the bookmarks view (ie. engine initiated |
|
197 // via some timer on a page like cnn.com) then don't change view to content view |
|
198 if (iBrowserInitLoad) |
|
199 { |
|
200 iApiProvider->SetViewToBeActivatedIfNeededL(KUidBrowserContentViewId); |
|
201 iBrowserInitLoad = EFalse; |
|
202 } |
|
203 |
|
204 // add transaction to ProgressBar |
|
205 iApiProvider->Display().AddTransActIdL( aTransactionId ); |
|
206 |
|
207 // Display the status pane, while loading |
|
208 if ( InBrowserContentView() && iContentView->FullScreenMode() ) |
|
209 { |
|
210 iContentView->ShowFsStatusPane(ETrue); |
|
211 } |
|
212 break; |
|
213 } |
|
214 // first content chunk arrived |
|
215 case TBrCtlDefs::EEventNewUrlContentArrived: |
|
216 { |
|
217 STATECHECK( ELoadStateResponseInProgress ) |
|
218 SetStatus( ELoadStatusFirstChunkArrived ); |
|
219 // set MaxData for this transaction |
|
220 iApiProvider->Display().AddProgressDataL( |
|
221 aTransactionId, 0, aSize ); |
|
222 break; |
|
223 } |
|
224 // additional content chunk arrived |
|
225 case TBrCtlDefs::EEventMoreUrlContentArrived: |
|
226 { |
|
227 STATECHECK( ELoadStateResponseInProgress ) |
|
228 START_TIMER( t1 ); |
|
229 // set RecvdData for this transaction |
|
230 iApiProvider->Display().AddProgressDataL( |
|
231 aTransactionId, aSize, 0 ); |
|
232 if( iApiProvider->IsForeGround() ) |
|
233 { |
|
234 iApiProvider->Display().NotifyProgress(); |
|
235 } |
|
236 STOP_TIMER( t1, iNumberOfUpdates ); |
|
237 break; |
|
238 } |
|
239 // content is processed, new fetch is allowed. |
|
240 // some more event may still remain |
|
241 case TBrCtlDefs::EEventContentFinished: |
|
242 { |
|
243 StateChange( ELoadStateIdle ); |
|
244 if( !ContentDisplayed() ) |
|
245 { |
|
246 SetContentDisplayed( ETrue ); |
|
247 } |
|
248 |
|
249 if( !iApiProvider->ExitInProgress() && |
|
250 iApiProvider->IsForeGround() ) |
|
251 { |
|
252 iApiProvider->Display().StopProgressAnimationL(); |
|
253 } |
|
254 User::ResetInactivityTime(); |
|
255 |
|
256 if( LoadUrlType() == ELoadUrlTypeEmbeddedBrowserWithUrl && |
|
257 !LoadStatus( ELoadStatusFirstChunkArrived ) && |
|
258 !iApiProvider->ExitInProgress() ) |
|
259 { |
|
260 // Go back to bookmarks and close the content view |
|
261 iApiProvider->SetViewToReturnOnClose( |
|
262 KUidBrowserBookmarksViewId ); |
|
263 iApiProvider->CloseContentViewL(); |
|
264 } |
|
265 // No content to be shown, go back to where we came from |
|
266 else if ( !iRestoreContentFlag ) |
|
267 { |
|
268 CBrowserAppUi::Static()->ActivateLocalViewL( |
|
269 iApiProvider->LastActiveViewId() ); |
|
270 if( iApiProvider->IsForeGround() ) |
|
271 { |
|
272 if ( CBrowserAppUi::Static()->ActiveView() ) |
|
273 { |
|
274 CBrowserAppUi::Static()->ActiveView()->UpdateCbaL(); |
|
275 } |
|
276 } |
|
277 } |
|
278 else |
|
279 { |
|
280 ContentArrivedL(); |
|
281 |
|
282 // in case we're in bookmarks view and a background page load is in |
|
283 // progress, don't update the softkeys |
|
284 if( iApiProvider->IsForeGround() && InBrowserContentView() ) |
|
285 { |
|
286 if ( CBrowserAppUi::Static()->ActiveView() ) |
|
287 { |
|
288 CBrowserAppUi::Static()->ActiveView()->UpdateCbaL(); |
|
289 } |
|
290 } |
|
291 } |
|
292 #ifdef I__LOG_EVENT_TIME |
|
293 TTime endDownloadTime; |
|
294 endDownloadTime.HomeTime(); |
|
295 TInt64 dlTime = endDownloadTime.MicroSecondsFrom(iStartDownloadTime).Int64(); |
|
296 LOG_WRITE_FORMAT( "Total download time: %d", dlTime ); |
|
297 LOG_WRITE_FORMAT( "Total update time: %d", iTotalUpdateTime ); |
|
298 LOG_WRITE_FORMAT( "Total number of updates: %d", iNumberOfUpdates ); |
|
299 if( iNumberOfUpdates ) |
|
300 { |
|
301 LOG_WRITE_FORMAT( "Average update time: %d", |
|
302 iTotalUpdateTime / iNumberOfUpdates ); |
|
303 } |
|
304 if( dlTime ) |
|
305 { |
|
306 LOG_WRITE_FORMAT( "Total update time (%% of download time): %d", |
|
307 iTotalUpdateTime / (dlTime / 100) ); |
|
308 } |
|
309 #endif // I__LOG_EVENT_TIME |
|
310 break; |
|
311 } |
|
312 // first chunk displayed, no parameter |
|
313 case TBrCtlDefs::EEventNewContentDisplayed: |
|
314 { |
|
315 iApiProvider->WindowMgr().SetContentExist( ETrue ); |
|
316 SetStatus( ELoadStatusFirstChunkDisplayed ); |
|
317 SetRestoreContentFlag( ETrue ); |
|
318 ContentArrivedL(); |
|
319 if( !ContentDisplayed() ) |
|
320 { |
|
321 SetContentDisplayed( ETrue ); |
|
322 } |
|
323 break; |
|
324 } |
|
325 // additional chunk displayed, no parameter |
|
326 case TBrCtlDefs::EEventMoreContentDisplayed: |
|
327 { |
|
328 SetStatus( ELoadStatusContentDisplayed ); |
|
329 SetRestoreContentFlag( ETrue ); |
|
330 ContentArrivedL(); |
|
331 break; |
|
332 } |
|
333 // last chunk arrived |
|
334 case TBrCtlDefs::EEventUrlLoadingFinished: |
|
335 { |
|
336 iApiProvider->Display().TransActIdComplete( aTransactionId ); |
|
337 SetRestoreContentFlag( ETrue ); |
|
338 ContentArrivedL(); |
|
339 TRAP( err, iApiProvider->LogAccessToRecentUrlL( iWindow->BrCtlInterface() ) ); |
|
340 break; |
|
341 } |
|
342 case TBrCtlDefs::EEventLoadFinished: |
|
343 { |
|
344 if( !iApiProvider->ExitInProgress() && |
|
345 iApiProvider->IsForeGround() ) |
|
346 { |
|
347 iApiProvider->Display().StopProgressAnimationL(); |
|
348 |
|
349 // Turn off status pane, SK, and Cba |
|
350 // If in content view, set to fullscreen after download complete |
|
351 if ( InBrowserContentView() && iContentView->FullScreenMode() ) |
|
352 { |
|
353 iContentView->ShowFsStatusPane(EFalse); |
|
354 } |
|
355 } |
|
356 iApiProvider->WindowMgr().NotifyObserversL( EWindowLoadStop, iWindow->WindowId() ); |
|
357 break; |
|
358 } |
|
359 case TBrCtlDefs::EEventAuthenticationFailed: |
|
360 { |
|
361 // don't add url to Adaptive Bookmarks |
|
362 ClearStatus( ELoadStatusFirstChunkArrived ); |
|
363 break; |
|
364 } |
|
365 // Large file upload events |
|
366 case TBrCtlDefs::EEventUploadStart: |
|
367 { |
|
368 iMaxUploadContent = aSize; |
|
369 iWindow->DialogsProviderProxy().UploadProgressNoteL( |
|
370 iMaxUploadContent, 0, EFalse, this ); |
|
371 break; |
|
372 } |
|
373 case TBrCtlDefs::EEventUploadIncrement: |
|
374 { |
|
375 iWindow->DialogsProviderProxy().UploadProgressNoteL( |
|
376 iMaxUploadContent, aSize, EFalse, this ); |
|
377 break; |
|
378 } |
|
379 case TBrCtlDefs::EEventUploadFinished: |
|
380 { |
|
381 iWindow->DialogsProviderProxy().UploadProgressNoteL( |
|
382 iMaxUploadContent, aSize, ETrue, this ); |
|
383 break; |
|
384 } |
|
385 default: |
|
386 break; |
|
387 } |
|
388 #undef STATECHECK |
|
389 } |
|
390 |
|
391 // ---------------------------------------------------------------------------- |
|
392 // CBrowserLoadObserver::CBrowserLoadObserver() |
|
393 // ---------------------------------------------------------------------------- |
|
394 // |
|
395 CBrowserLoadObserver::CBrowserLoadObserver( |
|
396 MApiProvider& aApiProvider, |
|
397 CBrowserContentView& aContentView, |
|
398 CBrowserWindow& aWindow ) : |
|
399 iApiProvider( &aApiProvider ), |
|
400 iContentView( &aContentView ), |
|
401 iWindow( &aWindow ), |
|
402 iLoadState( ELoadStateIdle ), |
|
403 iLoadUrlType( ELoadUrlTypeOther ), |
|
404 iStatus( 0 ) |
|
405 { |
|
406 } |
|
407 |
|
408 // ---------------------------------------------------------------------------- |
|
409 // CBrowserLoadObserver::ConstructL() |
|
410 // ---------------------------------------------------------------------------- |
|
411 // |
|
412 void CBrowserLoadObserver::ConstructL() |
|
413 { |
|
414 } |
|
415 |
|
416 // ---------------------------------------------------------------------------- |
|
417 // CBrowserLoadObserver::DoStartLoad() |
|
418 // ---------------------------------------------------------------------------- |
|
419 // |
|
420 void CBrowserLoadObserver::DoStartLoad( |
|
421 TBrowserLoadUrlType aLoadUrlType ) |
|
422 { |
|
423 /* |
|
424 LOG_WRITE("-------------------") |
|
425 LOG_WRITE_FORMAT(" UrlType: %d ", aLoadUrlType ) |
|
426 */ |
|
427 // __ASSERT_DEBUG instead of condition? |
|
428 if( iLoadState == ELoadStateIdle ) |
|
429 { |
|
430 if (LoadStatus(ELoadStatusSecurePageVisited)) |
|
431 { |
|
432 ClearStatus(); |
|
433 SetStatus(ELoadStatusSecurePageVisited); |
|
434 } |
|
435 else |
|
436 { |
|
437 ClearStatus(); |
|
438 } |
|
439 |
|
440 iLoadUrlType = aLoadUrlType; |
|
441 iRestoreContentFlag = EFalse; |
|
442 } |
|
443 |
|
444 iBrowserInitLoad = ETrue; |
|
445 } |
|
446 |
|
447 // ---------------------------------------------------------------------------- |
|
448 // CBrowserLoadObserver::DoEndLoad() |
|
449 // ---------------------------------------------------------------------------- |
|
450 // |
|
451 void CBrowserLoadObserver::DoEndLoad( |
|
452 TBool aIsUserInitiated ) |
|
453 { |
|
454 // LOG_WRITE( "Cancelling.") |
|
455 if( aIsUserInitiated) |
|
456 { |
|
457 // wait for the remaining load events |
|
458 StateChange( ELoadStateLoadDone ); |
|
459 } |
|
460 else // don't wait for anything |
|
461 { |
|
462 StateChange( ELoadStateIdle ); |
|
463 } |
|
464 |
|
465 // first arrives ContentFinished and then UrlLoadingFinished! |
|
466 // what to do with status? |
|
467 // updatesoftkeys() done in appui |
|
468 |
|
469 CBrowserViewBase* view = CBrowserAppUi::Static()->ActiveView(); |
|
470 if( view ) // just to be sure |
|
471 { |
|
472 TVwsViewId activeViewId = view->ViewId(); |
|
473 if( activeViewId.iViewUid == KUidBrowserBookmarksViewId) |
|
474 { |
|
475 SetRestoreContentFlag( EFalse ); |
|
476 } |
|
477 } |
|
478 } |
|
479 |
|
480 // ---------------------------------------------------------------------------- |
|
481 // CBrowserLoadObserver::NewTitleAvailableL() |
|
482 // ---------------------------------------------------------------------------- |
|
483 // |
|
484 void CBrowserLoadObserver::NewTitleAvailableL() |
|
485 { |
|
486 if( iWindow->IsWindowActive() ) |
|
487 { |
|
488 CBrowserViewBase* view = CBrowserAppUi::Static()->ActiveView(); |
|
489 if( view ) // just to be sure |
|
490 { |
|
491 TVwsViewId activeViewId = view->ViewId(); |
|
492 if( activeViewId.iViewUid == KUidBrowserContentViewId ) |
|
493 { |
|
494 iContentView->UpdateTitleL( *iApiProvider ); |
|
495 } |
|
496 } |
|
497 } |
|
498 SetRestoreContentFlag( ETrue ); |
|
499 } |
|
500 |
|
501 // ---------------------------------------------------------------------------- |
|
502 // CBrowserLoadObserver::InBrowserContentView() |
|
503 // ---------------------------------------------------------------------------- |
|
504 // |
|
505 TBool CBrowserLoadObserver::InBrowserContentView() |
|
506 { |
|
507 CBrowserViewBase* view = CBrowserAppUi::Static()->ActiveView(); |
|
508 if( view ) // just to be sure |
|
509 { |
|
510 TVwsViewId activeViewId = view->ViewId(); |
|
511 return ( activeViewId.iViewUid == KUidBrowserContentViewId ); |
|
512 } |
|
513 |
|
514 return EFalse; |
|
515 } |
|
516 |
|
517 |
|
518 // ---------------------------------------------------------------------------- |
|
519 // CBrowserLoadObserver::ContentArrivedL() |
|
520 // ---------------------------------------------------------------------------- |
|
521 // |
|
522 void CBrowserLoadObserver::ContentArrivedL() |
|
523 { |
|
524 if( iApiProvider->Connection().Connected() |
|
525 && iApiProvider->Preferences().HttpSecurityWarningsStatSupressed() ) |
|
526 { |
|
527 TInt secureUpdate = EAknIndicatorStateOff; |
|
528 if( LoadStatus( ELoadStatusSecurePage ) ) |
|
529 { |
|
530 if( LoadStatus( ELoadStatusAllItemIsSecure ) ) |
|
531 { |
|
532 secureUpdate = EAknIndicatorStateOn; |
|
533 } |
|
534 } |
|
535 iApiProvider->Display().UpdateSecureIndicatorL( secureUpdate ); |
|
536 } |
|
537 } |
|
538 |
|
539 //----------------------------------------------------------------------------- |
|
540 // CBrowserLoadObserver::ReportDialogEvent |
|
541 //----------------------------------------------------------------------------- |
|
542 // Handles dialog provider events |
|
543 void CBrowserLoadObserver::ReportDialogEventL( |
|
544 TInt aType, |
|
545 TInt aFlags ) |
|
546 { |
|
547 switch( aType ) |
|
548 { |
|
549 case MBrowserDialogsProviderObserver::ENotifyError: |
|
550 // aFlags contains error code |
|
551 { |
|
552 // If card not in deck error, go to first card of deck |
|
553 SetRestoreContentFlag( aFlags == KBrsrWmlbrowserCardNotInDeck ); |
|
554 break; |
|
555 } |
|
556 case MBrowserDialogsProviderObserver::ENotifyHttpError: |
|
557 // aFlags contains error code |
|
558 { |
|
559 SetRestoreContentFlag( EFalse ); |
|
560 break; |
|
561 } |
|
562 case MBrowserDialogsProviderObserver::EUserAuthentication: |
|
563 { |
|
564 SetRestoreContentFlag( aFlags ); // False == Cancelled |
|
565 break; |
|
566 } |
|
567 case MBrowserDialogsProviderObserver::EConfirm: |
|
568 // aFlags contains Cancel status |
|
569 { |
|
570 // if confirmation query was cancelled, step back to idle |
|
571 if( !aFlags ) |
|
572 { |
|
573 DoEndLoad( EFalse ); |
|
574 } |
|
575 SetRestoreContentFlag( !aFlags ); |
|
576 break; |
|
577 } |
|
578 case MBrowserDialogsProviderObserver::EUploadProgress: |
|
579 { |
|
580 // Cancel fetching - dialog is cancelled |
|
581 if ( aFlags == KErrCancel ) |
|
582 { |
|
583 iWindow->BrCtlInterface().HandleCommandL( |
|
584 (TInt)TBrCtlDefs::ECommandCancelFetch + |
|
585 (TInt)TBrCtlDefs::ECommandIdBase ); |
|
586 } |
|
587 break; |
|
588 } |
|
589 default: |
|
590 break; |
|
591 } |
|
592 } |
|
593 |
|
594 //----------------------------------------------------------------------------- |
|
595 // CBrowserLoadObserver::UpdateSecureIndicatorL |
|
596 //----------------------------------------------------------------------------- |
|
597 // |
|
598 void CBrowserLoadObserver::UpdateSecureIndicatorL() |
|
599 { |
|
600 TBool status = LoadStatus( ELoadStatusAllItemIsSecure ); |
|
601 iApiProvider->Display().UpdateSecureIndicatorL( |
|
602 status && |
|
603 !iApiProvider->Preferences().HttpSecurityWarningsStatSupressed() ); |
|
604 } |
|
605 |
|
606 //----------------------------------------------------------------------------- |
|
607 // CBrowserLoadObserver::LoadUrlType |
|
608 //----------------------------------------------------------------------------- |
|
609 // |
|
610 CBrowserLoadObserver::TBrowserLoadUrlType CBrowserLoadObserver::LoadUrlType() const |
|
611 { |
|
612 return iLoadUrlType; |
|
613 } |
|
614 |
|
615 //----------------------------------------------------------------------------- |
|
616 // CBrowserLoadObserver::LoadState |
|
617 //----------------------------------------------------------------------------- |
|
618 // |
|
619 CBrowserLoadObserver::TBrowserLoadState CBrowserLoadObserver::LoadState() const |
|
620 { |
|
621 return iLoadState; |
|
622 } |
|
623 //----------------------------------------------------------------------------- |
|
624 // CBrowserLoadObserver::StateChange |
|
625 //----------------------------------------------------------------------------- |
|
626 // |
|
627 void CBrowserLoadObserver::StateChange( TBrowserLoadState aNextState ) |
|
628 { |
|
629 if( ELoadStateIdle == iLoadState && |
|
630 iLoadState != aNextState ) |
|
631 { |
|
632 iNewContentDisplayed = EFalse; |
|
633 iApiProvider->WindowMgr().NotifyObserversL( EWindowCntDisplayed, iWindow->WindowId() ); |
|
634 } |
|
635 iLoadState = aNextState; |
|
636 } |
|
637 |
|
638 //----------------------------------------------------------------------------- |
|
639 // CBrowserLoadObserver::SetContentDisplayed |
|
640 //----------------------------------------------------------------------------- |
|
641 // |
|
642 |
|
643 void CBrowserLoadObserver::SetContentDisplayed( TBool aValue ) |
|
644 { |
|
645 iNewContentDisplayed = aValue; |
|
646 TRAP_IGNORE( iApiProvider->WindowMgr().NotifyObserversL( EWindowCntDisplayed, iWindow->WindowId())); |
|
647 } |
|
648 |
|
649 |
|
650 // End of file |