webengine/webkitutils/HistoryProvider/HistoryController.cpp
branchRCL_3
changeset 50 d96eed154187
parent 49 919f36ff910f
equal deleted inserted replaced
49:919f36ff910f 50:d96eed154187
    55 }
    55 }
    56 
    56 
    57 
    57 
    58 HistoryController::~HistoryController()
    58 HistoryController::~HistoryController()
    59 {
    59 {
    60 	m_historyStack.ResetAndDestroy();
    60     m_historyStack.ResetAndDestroy();
       
    61     if(m_historyView) { 
       
    62         delete m_historyView;
       
    63         m_historyView = NULL; 
       
    64     }
    61 }
    65 }
    62 
    66 
    63 /**
    67 /**
    64 */
    68 */
    65 void HistoryController::insert( const TPtrC8& url, const TPtrC8& requestUrl, 
    69 void HistoryController::insert( const TPtrC8& url, const TPtrC8& requestUrl, 
   494 
   498 
   495 /**
   499 /**
   496 */
   500 */
   497 void HistoryController::showHistoryViewL(bool previous)
   501 void HistoryController::showHistoryViewL(bool previous)
   498 {
   502 {
       
   503     if(m_historyView)
       
   504         return; 
       
   505     
   499     HistoryEntry* entry = entryByIndex(m_currentIndex);
   506     HistoryEntry* entry = entryByIndex(m_currentIndex);
   500     if (entry && ! entry->thumbnail()) {
   507     if (entry && ! entry->thumbnail()) {
   501         // get scaled page from PageScaler;
   508         // get scaled page from PageScaler;
   502         // update the history with new bitmap
   509         // update the history with new bitmap
   503         CFbsBitmap* scaledPage = m_historyCallback->scaledPage();
   510         CFbsBitmap* scaledPage = m_historyCallback->scaledPage();
   504         if(scaledPage) {
   511         if(scaledPage) {
   505             // Get the browser control rect
   512             // Get the browser control rect
   506             updateHistoryEntryThumbnailL(scaledPage);
   513             updateHistoryEntryThumbnailL(scaledPage);
   507         }
   514         }
   508             // ignore err since we will use the default image
   515         // ignore err since we will use the default image
   509     }
   516     }
   510     //Defer refresh timers on showing history view
   517     //Defer refresh timers on showing history view
   511     m_historyCallback->deferTimers(true);
   518     m_historyCallback->deferTimers(true);
   512     m_historyView = HistoryView::NewL( *this, previous );
   519     m_historyView = HistoryView::NewL( *this, previous );
   513     m_historyCallback->makeVisible(false);
   520     m_historyCallback->makeVisible(false);
   576     }
   583     }
   577 }
   584 }
   578 
   585 
   579 void HistoryController::performTransition(int direction)
   586 void HistoryController::performTransition(int direction)
   580 {
   587 {
   581 	m_historyView->performTransition(direction);	
   588     if(m_historyView) { 
       
   589         m_historyView->performTransition(direction);
       
   590     } 
   582 }
   591 }
   583 
   592 
   584 /**
   593 /**
   585 */
   594 */
   586 void HistoryController::updateCurrentEntryZoomLevelIfNeeded()
   595 void HistoryController::updateCurrentEntryZoomLevelIfNeeded()