Changeset 109130 in webkit
- Timestamp:
- Feb 28, 2012 11:40:45 AM (12 years ago)
- Location:
- trunk/Source/WebKit2
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r109129 r109130 1 2012-02-28 Jocelyn Turcotte <jocelyn.turcotte@nokia.com> 2 3 [Qt] Signal and property cleanup in QQuickWebView 4 https://bugs.webkit.org/show_bug.cgi?id=78820 5 6 Reviewed by Noam Rosenthal. 7 8 - Remove parameters from property change notify signals: 9 titleChanged, urlChanged, iconChanged, loadProgressChanged 10 - Rename the parameters of linkHovered to prevent shadoing properties of WebView 11 - Rename navigationStateChanged to navigationHistoryChanged 12 13 * UIProcess/API/qt/qquickwebview.cpp: 14 (QQuickWebViewPrivate::QQuickWebViewPrivate): 15 (QQuickWebViewPrivate::initialize): 16 (QQuickWebViewPrivate::_q_onUrlChanged): 17 (QQuickWebViewPrivate::setIcon): 18 * UIProcess/API/qt/qquickwebview_p.h: 19 * UIProcess/API/qt/qquickwebview_p_p.h: 20 (QQuickWebViewPrivate): 21 * UIProcess/API/qt/tests/publicapi/tst_publicapi.cpp: 22 * UIProcess/API/qt/tests/qmltests/DesktopBehavior/tst_linkHovered.qml: 23 * UIProcess/API/qt/tests/qmltests/DesktopBehavior/tst_loadHtml.qml: 24 * UIProcess/API/qt/tests/qquickwebview/tst_qquickwebview.cpp: 25 (tst_QQuickWebView::loadProgress): 26 * UIProcess/qt/QtWebPageLoadClient.cpp: 27 (QtWebPageLoadClient::didCommitLoadForFrame): 28 (QtWebPageLoadClient::didSameDocumentNavigationForFrame): 29 (QtWebPageLoadClient::didReceiveTitleForFrame): 30 (QtWebPageLoadClient::setLoadProgress): 31 * UIProcess/qt/QtWebPageLoadClient.h: 32 (QtWebPageLoadClient): 33 1 34 2012-02-28 Mario Sanchez Prada <msanchez@igalia.com> 2 35 -
trunk/Source/WebKit2/UIProcess/API/qt/qquickwebview.cpp
r108889 r109130 85 85 viewport->setFlags(QQuickItem::ItemClipsChildrenToShape); 86 86 QObject::connect(viewport, SIGNAL(visibleChanged()), viewport, SLOT(_q_onVisibleChanged())); 87 QObject::connect(viewport, SIGNAL(urlChanged()), viewport, SLOT(_q_onUrlChanged())); 87 88 pageView.reset(new QQuickWebPage(viewport)); 88 89 } … … 115 116 QtWebIconDatabaseClient* iconDatabase = context->iconDatabase(); 116 117 QObject::connect(iconDatabase, SIGNAL(iconChangedForPageURL(QUrl, QUrl)), q_ptr, SLOT(_q_onIconChangedForPageURL(QUrl, QUrl))); 117 QObject::connect(q_ptr, SIGNAL(urlChanged(QUrl)), iconDatabase, SLOT(requestIconForPageURL(QUrl)));118 118 119 119 // Any page setting should preferrable be set before creating the page. … … 231 231 } 232 232 233 void QQuickWebViewPrivate::_q_onUrlChanged() 234 { 235 Q_Q(QQuickWebView); 236 context->iconDatabase()->requestIconForPageURL(q->url()); 237 } 238 233 239 void QQuickWebViewPrivate::_q_onReceivedResponseFromDownload(QWebDownloadItem* downloadItem) 234 240 { … … 431 437 432 438 m_iconURL = iconURL; 433 emit q->iconChanged( m_iconURL);439 emit q->iconChanged(); 434 440 } 435 441 -
trunk/Source/WebKit2/UIProcess/API/qt/qquickwebview_p.h
r108889 r109130 71 71 Q_PROPERTY(QUrl url READ url NOTIFY urlChanged) 72 72 Q_PROPERTY(QUrl icon READ icon NOTIFY iconChanged FINAL) 73 Q_PROPERTY(bool canGoBack READ canGoBack NOTIFY navigationHistoryChanged FINAL) 74 Q_PROPERTY(bool canGoForward READ canGoForward NOTIFY navigationHistoryChanged FINAL) 73 75 Q_PROPERTY(bool loading READ loading NOTIFY loadingChanged FINAL) 74 76 Q_PROPERTY(int loadProgress READ loadProgress NOTIFY loadProgressChanged) 75 Q_PROPERTY(bool canGoBack READ canGoBack NOTIFY navigationStateChanged FINAL)76 Q_PROPERTY(bool canGoForward READ canGoForward NOTIFY navigationStateChanged FINAL)77 77 Q_ENUMS(NavigationRequestAction) 78 78 Q_ENUMS(LoadStatus) … … 147 147 148 148 Q_SIGNALS: 149 void titleChanged(const QString& title); 150 void loadProgressChanged(int progress); 151 void urlChanged(const QUrl& url); 152 void iconChanged(const QUrl& iconURL); 153 void linkHovered(const QUrl& url, const QString& title); 154 void navigationStateChanged(); 149 void titleChanged(); 150 void navigationHistoryChanged(); 155 151 void loadingChanged(QWebLoadRequest* loadRequest); 152 void loadProgressChanged(); 153 void urlChanged(); 154 void iconChanged(); 155 void linkHovered(const QUrl& hoveredUrl, const QString& hoveredTitle); 156 156 void navigationRequested(QWebNavigationRequest* request); 157 157 … … 193 193 Q_PRIVATE_SLOT(d_func(), void _q_onOpenPanelFinished(int result)); 194 194 Q_PRIVATE_SLOT(d_func(), void _q_onVisibleChanged()); 195 Q_PRIVATE_SLOT(d_func(), void _q_onUrlChanged()); 195 196 Q_PRIVATE_SLOT(d_func(), void _q_onReceivedResponseFromDownload(QWebDownloadItem*)); 196 197 Q_PRIVATE_SLOT(d_func(), void _q_onIconChangedForPageURL(const QUrl&, const QUrl&)); -
trunk/Source/WebKit2/UIProcess/API/qt/qquickwebview_p_p.h
r108889 r109130 96 96 void _q_onOpenPanelFinished(int result); 97 97 void _q_onVisibleChanged(); 98 void _q_onUrlChanged(); 98 99 void _q_onReceivedResponseFromDownload(QWebDownloadItem*); 99 100 void _q_onIconChangedForPageURL(const QUrl& pageURL, const QUrl& iconURLString); -
trunk/Source/WebKit2/UIProcess/API/qt/tests/publicapi/tst_publicapi.cpp
r109113 r109130 59 59 << "QQuickWebView.url --> QUrl" 60 60 << "QQuickWebView.icon --> QUrl" 61 << "QQuickWebView.loadProgress --> int"62 61 << "QQuickWebView.canGoBack --> bool" 63 62 << "QQuickWebView.canGoForward --> bool" 64 63 << "QQuickWebView.loading --> bool" 65 << "QQuickWebView.titleChanged(QString) --> void" 66 << "QQuickWebView.loadProgressChanged(int) --> void" 67 << "QQuickWebView.urlChanged(QUrl) --> void" 68 << "QQuickWebView.iconChanged(QUrl) --> void" 64 << "QQuickWebView.loadProgress --> int" 65 << "QQuickWebView.titleChanged() --> void" 66 << "QQuickWebView.navigationHistoryChanged() --> void" 69 67 << "QQuickWebView.loadingChanged(QWebLoadRequest*) --> void" 68 << "QQuickWebView.loadProgressChanged() --> void" 69 << "QQuickWebView.urlChanged() --> void" 70 << "QQuickWebView.iconChanged() --> void" 70 71 << "QQuickWebView.linkHovered(QUrl,QString) --> void" 71 << "QQuickWebView.navigationStateChanged() --> void"72 72 << "QQuickWebView.navigationRequested(QWebNavigationRequest*) --> void" 73 73 << "QQuickWebView.load(QUrl) --> void" -
trunk/Source/WebKit2/UIProcess/API/qt/tests/qmltests/DesktopBehavior/tst_linkHovered.qml
r108889 r109130 20 20 21 21 onLinkHovered: { 22 webView.lastUrl = url23 webView.lastTitle = title22 webView.lastUrl = hoveredUrl 23 webView.lastTitle = hoveredTitle 24 24 } 25 25 -
trunk/Source/WebKit2/UIProcess/API/qt/tests/qmltests/DesktopBehavior/tst_loadHtml.qml
r108889 r109130 19 19 20 20 onLinkHovered: { 21 webView.lastUrl = url21 webView.lastUrl = hoveredUrl 22 22 } 23 23 -
trunk/Source/WebKit2/UIProcess/API/qt/tests/qquickwebview/tst_qquickwebview.cpp
r108889 r109130 253 253 254 254 webView()->load(QUrl::fromLocalFile(QLatin1String(TESTS_SOURCE_DIR "/html/basic_page.html"))); 255 QSignalSpy loadProgressChangedSpy(webView(), SIGNAL(loadProgressChanged( int)));255 QSignalSpy loadProgressChangedSpy(webView(), SIGNAL(loadProgressChanged())); 256 256 QVERIFY(waitForLoadSucceeded(webView())); 257 257 -
trunk/Source/WebKit2/UIProcess/qt/QtWebPageLoadClient.cpp
r108889 r109130 57 57 } 58 58 59 void QtWebPageLoadClient::didCommitLoadForFrame( const QUrl& url)59 void QtWebPageLoadClient::didCommitLoadForFrame() 60 60 { 61 emit m_webView->navigation StateChanged();62 emit m_webView->urlChanged( url);61 emit m_webView->navigationHistoryChanged(); 62 emit m_webView->urlChanged(); 63 63 m_webView->d_func()->loadDidCommit(); 64 64 } 65 65 66 void QtWebPageLoadClient::didSameDocumentNavigationForFrame( const QUrl& url)66 void QtWebPageLoadClient::didSameDocumentNavigationForFrame() 67 67 { 68 emit m_webView->navigation StateChanged();69 emit m_webView->urlChanged( url);68 emit m_webView->navigationHistoryChanged(); 69 emit m_webView->urlChanged(); 70 70 } 71 71 72 void QtWebPageLoadClient::didReceiveTitleForFrame( const QString& title)72 void QtWebPageLoadClient::didReceiveTitleForFrame() 73 73 { 74 emit m_webView->titleChanged( title);74 emit m_webView->titleChanged(); 75 75 } 76 76 … … 107 107 { 108 108 m_loadProgress = loadProgress; 109 emit m_webView->loadProgressChanged( m_loadProgress);109 emit m_webView->loadProgressChanged(); 110 110 } 111 111 … … 137 137 if (!WKFrameIsMainFrame(frame)) 138 138 return; 139 WebFrameProxy* wkframe = toImpl(frame); 140 QString urlStr(wkframe->url()); 141 QUrl qUrl = urlStr; 142 toQtWebPageLoadClient(clientInfo)->didCommitLoadForFrame(qUrl); 139 toQtWebPageLoadClient(clientInfo)->didCommitLoadForFrame(); 143 140 } 144 141 … … 159 156 void QtWebPageLoadClient::didSameDocumentNavigationForFrame(WKPageRef page, WKFrameRef frame, WKSameDocumentNavigationType type, WKTypeRef userData, const void* clientInfo) 160 157 { 161 WebFrameProxy* wkframe = toImpl(frame); 162 QString urlStr(wkframe->url()); 163 QUrl qUrl = urlStr; 164 toQtWebPageLoadClient(clientInfo)->didSameDocumentNavigationForFrame(qUrl); 158 toQtWebPageLoadClient(clientInfo)->didSameDocumentNavigationForFrame(); 165 159 } 166 160 … … 169 163 if (!WKFrameIsMainFrame(frame)) 170 164 return; 171 QString qTitle = WKStringCopyQString(title); 172 toQtWebPageLoadClient(clientInfo)->didReceiveTitleForFrame(qTitle); 165 toQtWebPageLoadClient(clientInfo)->didReceiveTitleForFrame(); 173 166 } 174 167 -
trunk/Source/WebKit2/UIProcess/qt/QtWebPageLoadClient.h
r108889 r109130 36 36 37 37 private: 38 void didCommitLoadForFrame(const QUrl&);39 void didSameDocumentNavigationForFrame(const QUrl&);40 void didReceiveTitleForFrame(const QString&);41 38 void didStartProvisionalLoadForFrame(const QUrl&); 39 void didCommitLoadForFrame(); 40 void didSameDocumentNavigationForFrame(); 41 void didReceiveTitleForFrame(); 42 42 void didFirstVisuallyNonEmptyLayoutForFrame(); 43 43 void didChangeBackForwardList();
Note: See TracChangeset
for help on using the changeset viewer.