Changeset 39210 in webkit


Ignore:
Timestamp:
Dec 11, 2008 7:57:00 AM (15 years ago)
Author:
Simon Hausmann
Message:

2008-12-11 Yael Aharon <yael.aharon@nokia.com>

Reviewed by Simon Hausmann.

Allow applications to save and restore their state between loads.

Location:
trunk/WebKit/qt
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebKit/qt/Api/qwebframe.cpp

    r39173 r39210  
    10231023
    10241024/*!
    1025   \since 4.5
    1026   \fn void QWebFrame::aboutToUpdateHistory(QWebHistoryItem* item);
    1027 
    1028   This signal is emitted shortly before the history of navigated pages
    1029   is changed, for example when navigating back in the history.
    1030 
    1031   The \a item parameter refers to the currently displayed frame.
    1032 
    1033   A potential use-case for this signal is to store custom data in
    1034   the QWebHistoryItem associated to the frame, using QWebHistoryItem::setUserData().
    1035 */
    1036 
    1037 /*!
    10381025    \class QWebHitTestResult
    10391026    \since 4.4
  • trunk/WebKit/qt/Api/qwebframe.h

    r39173 r39210  
    190190    void iconChanged();
    191191
    192     void aboutToUpdateHistory(QWebHistoryItem* item);
    193 
    194192private:
    195193    friend class QWebPage;
  • trunk/WebKit/qt/Api/qwebpage.cpp

    r39173 r39210  
    25942594*/
    25952595
     2596/*!
     2597  \since 4.5
     2598  \fn void QWebPage::saveFrameStateRequested(QWebFrame* frame, QWebHistoryItem* item);
     2599
     2600  This signal is emitted shortly before the history of navigated pages
     2601  is changed, for example when navigating back in the history.
     2602
     2603  A potential use-case for this signal is to store custom data in
     2604  the QWebHistoryItem associated to the frame, using QWebHistoryItem::setUserData().
     2605*/
     2606
     2607/*!
     2608  \since 4.5
     2609  \fn void QWebPage::restoreFrameStateRequested(QWebFrame* frame);
     2610
     2611  This signal is emitted when the load is finished and the application may now update its state accordingly.
     2612*/
     2613
    25962614
    25972615#include "moc_qwebpage.cpp"
  • trunk/WebKit/qt/Api/qwebpage.h

    r39173 r39210  
    4747class QWebPluginFactory;
    4848class QWebHitTestResult;
     49class QWebHistoryItem;
    4950
    5051namespace WebCore {
     
    290291    void databaseQuotaExceeded(QWebFrame* frame, QString databaseName);
    291292
     293    void saveFrameStateRequested(QWebFrame* frame, QWebHistoryItem* item);
     294    void restoreFrameStateRequested(QWebFrame* frame);
     295
    292296protected:
    293297    virtual QWebPage *createWindow(WebWindowType type);
  • trunk/WebKit/qt/ChangeLog

    r39201 r39210  
     12008-12-11  Yael Aharon  <yael.aharon@nokia.com>
     2
     3        Reviewed by Simon Hausmann.
     4
     5        Allow applications to save and restore their state between loads.
     6
     7        * Api/qwebframe.cpp:
     8        * Api/qwebframe.h:
     9        * WebCoreSupport/FrameLoaderClientQt.cpp:
     10        (WebCore::FrameLoaderClientQt::restoreViewState):
     11        (WebCore::FrameLoaderClientQt::saveViewStateToItem):
     12        * tests/qwebpage/tst_qwebpage.cpp:
     13        (tst_QWebPage::modified):
     14
    1152008-12-08  Tor Arne Vestbø  <tavestbo@trolltech.com>
    216
  • trunk/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp

    r39201 r39210  
    525525void FrameLoaderClientQt::restoreViewState()
    526526{
    527     notImplemented();
     527    if (!m_webFrame)
     528        return;
     529    emit m_webFrame->page()->restoreFrameStateRequested(m_webFrame);
    528530}
    529531
     
    620622{
    621623    QWebHistoryItem historyItem(new QWebHistoryItemPrivate(item));
    622     emit m_webFrame->aboutToUpdateHistory(&historyItem);
     624    emit m_webFrame->page()->saveFrameStateRequested(m_webFrame, &historyItem);
    623625}
    624626
  • trunk/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp

    r39173 r39210  
    342342    QVERIFY(m_page->history()->count() == 2);
    343343    m_page->mainFrame()->setUrl(QUrl("data:text/html,<body>This is fifth page"));
    344     QVERIFY(::waitForSignal(m_page->mainFrame(), SIGNAL(aboutToUpdateHistory(QWebHistoryItem*))));
     344    QVERIFY(::waitForSignal(m_page, SIGNAL(saveFrameStateRequested(QWebFrame*, QWebHistoryItem*))));
    345345}
    346346
Note: See TracChangeset for help on using the changeset viewer.