Changeset 171045 in webkit
- Timestamp:
- Jul 12, 2014, 10:51:20 PM (11 years ago)
- Location:
- trunk/Source/WebKit2
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r171042 r171045 1 2014-07-12 Dan Bernstein <mitz@apple.com> 2 3 [Cocoa] Notify the client when a navigation snapshot is taken 4 https://bugs.webkit.org/show_bug.cgi?id=134865 5 6 Reviewed by Sam Weinig. 7 8 * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h: Declared new delegate method. 9 10 * UIProcess/Cocoa/NavigationState.h: 11 * UIProcess/Cocoa/NavigationState.mm: 12 (WebKit::NavigationState::setNavigationDelegate): Initialize new flag in 13 m_navigationDelegateMethods. 14 (WebKit::NavigationState::willRecordNavigationSnapshot): Added. Calls the new 15 WKNavigationDelegate method. 16 17 * UIProcess/PageClient.h: Declared new client function. 18 19 * UIProcess/WebPageProxy.cpp: 20 (WebKit::WebPageProxy::willRecordNavigationSnapshot): Added. Calls the new client function. 21 * UIProcess/WebPageProxy.h: 22 23 * UIProcess/ios/PageClientImplIOS.h: 24 * UIProcess/ios/PageClientImplIOS.mm: 25 (WebKit::PageClientImpl::willRecordNavigationSnapshot): Override that calls 26 NavigationState::willRecordNavigationSnapshot. 27 28 * UIProcess/mac/PageClientImpl.h: 29 * UIProcess/mac/PageClientImpl.mm: 30 (WebKit::PageClientImpl::willRecordNavigationSnapshot): Ditto. 31 32 * UIProcess/mac/ViewSnapshotStore.mm: 33 (WebKit::ViewSnapshotStore::recordSnapshot): Added a call to 34 WebPageProxy::willRecordNavigationSnapshot. 35 1 36 2014-07-12 Gyuyoung Kim <gyuyoung.kim@samsung.com> 2 37 -
trunk/Source/WebKit2/UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h
r171034 r171045 65 65 // Only called if how the gesture will end (with or without navigation) is known before it ends. 66 66 - (void)_webViewWillEndNavigationGesture:(WKWebView *)webView withNavigationToBackForwardListItem:(WKBackForwardListItem *)item; 67 67 - (void)_webView:(WKWebView *)webView willSnapshotBackForwardListItem:(WKBackForwardListItem *)item; 68 68 69 69 #if TARGET_OS_IPHONE -
trunk/Source/WebKit2/UIProcess/Cocoa/NavigationState.h
r171034 r171045 79 79 void navigationGestureWillEnd(bool willNavigate, WebBackForwardListItem&); 80 80 void navigationGestureDidEnd(bool willNavigate, WebBackForwardListItem&); 81 void willRecordNavigationSnapshot(WebBackForwardListItem&); 81 82 82 83 private: … … 167 168 bool webViewWillEndNavigationGestureWithNavigationToBackForwardListItem : 1; 168 169 bool webViewDidEndNavigationGestureWithNavigationToBackForwardListItem : 1; 170 bool webViewWillSnapshotBackForwardListItem : 1; 169 171 #if USE(QUICK_LOOK) 170 172 bool webViewDidStartLoadForQuickLookDocumentInMainFrame : 1; -
trunk/Source/WebKit2/UIProcess/Cocoa/NavigationState.mm
r171034 r171045 141 141 m_navigationDelegateMethods.webViewWillEndNavigationGestureWithNavigationToBackForwardListItem = [delegate respondsToSelector:@selector(_webViewWillEndNavigationGesture:withNavigationToBackForwardListItem:)]; 142 142 m_navigationDelegateMethods.webViewDidEndNavigationGestureWithNavigationToBackForwardListItem = [delegate respondsToSelector:@selector(_webViewDidEndNavigationGesture:withNavigationToBackForwardListItem:)]; 143 m_navigationDelegateMethods.webViewWillSnapshotBackForwardListItem = [delegate respondsToSelector:@selector(_webView:willSnapshotBackForwardListItem:)]; 143 144 #if USE(QUICK_LOOK) 144 145 m_navigationDelegateMethods.webViewDidStartLoadForQuickLookDocumentInMainFrame = [delegate respondsToSelector:@selector(_webView:didStartLoadForQuickLookDocumentInMainFrameWithFileName:uti:)]; … … 289 290 290 291 [static_cast<id <WKNavigationDelegatePrivate>>(navigationDelegate) _webViewDidEndNavigationGesture:m_webView withNavigationToBackForwardListItem:willNavigate ? wrapper(item) : nil]; 292 } 293 294 void NavigationState::willRecordNavigationSnapshot(WebBackForwardListItem& item) 295 { 296 if (!m_navigationDelegateMethods.webViewWillSnapshotBackForwardListItem) 297 return; 298 299 auto navigationDelegate = m_navigationDelegate.get(); 300 if (!navigationDelegate) 301 return; 302 303 [static_cast<id <WKNavigationDelegatePrivate>>(navigationDelegate) _webView:m_webView willSnapshotBackForwardListItem:wrapper(item)]; 291 304 } 292 305 -
trunk/Source/WebKit2/UIProcess/PageClient.h
r171034 r171045 299 299 virtual void navigationGestureWillEnd(bool willNavigate, WebBackForwardListItem&) = 0; 300 300 virtual void navigationGestureDidEnd(bool willNavigate, WebBackForwardListItem&) = 0; 301 virtual void willRecordNavigationSnapshot(WebBackForwardListItem&) = 0; 301 302 }; 302 303 -
trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp
r171034 r171045 5144 5144 } 5145 5145 5146 void WebPageProxy::willRecordNavigationSnapshot(WebBackForwardListItem& item) 5147 { 5148 m_pageClient.willRecordNavigationSnapshot(item); 5149 } 5150 5146 5151 void WebPageProxy::navigationGestureSnapshotWasRemoved() 5147 5152 { -
trunk/Source/WebKit2/UIProcess/WebPageProxy.h
r171034 r171045 902 902 void navigationGestureDidEnd(bool willNavigate, WebBackForwardListItem&); 903 903 void navigationGestureSnapshotWasRemoved(); 904 void willRecordNavigationSnapshot(WebBackForwardListItem&); 904 905 905 906 bool isShowingNavigationGestureSnapshot() const { return m_isShowingNavigationGestureSnapshot; } -
trunk/Source/WebKit2/UIProcess/ios/PageClientImplIOS.h
r171034 r171045 171 171 virtual void navigationGestureWillEnd(bool willNavigate, WebBackForwardListItem&) override; 172 172 virtual void navigationGestureDidEnd(bool willNavigate, WebBackForwardListItem&) override; 173 virtual void willRecordNavigationSnapshot(WebBackForwardListItem&) override; 173 174 174 175 WKContentView *m_contentView; -
trunk/Source/WebKit2/UIProcess/ios/PageClientImplIOS.mm
r171034 r171045 668 668 } 669 669 670 void PageClientImpl::willRecordNavigationSnapshot(WebBackForwardListItem& item) 671 { 672 NavigationState::fromWebPage(*m_webView->_page).willRecordNavigationSnapshot(item); 673 } 674 670 675 } // namespace WebKit 671 676 -
trunk/Source/WebKit2/UIProcess/mac/PageClientImpl.h
r171034 r171045 177 177 virtual void navigationGestureWillEnd(bool willNavigate, WebBackForwardListItem&) override; 178 178 virtual void navigationGestureDidEnd(bool willNavigate, WebBackForwardListItem&) override; 179 virtual void willRecordNavigationSnapshot(WebBackForwardListItem&) override; 179 180 180 181 NSView *activeView() const; -
trunk/Source/WebKit2/UIProcess/mac/PageClientImpl.mm
r171041 r171045 715 715 } 716 716 717 void PageClientImpl::willRecordNavigationSnapshot(WebBackForwardListItem& item) 718 { 719 #if WK_API_ENABLED 720 NavigationState::fromWebPage(*m_webView->_page).willRecordNavigationSnapshot(item); 721 #else 722 UNUSED_PARAM(item); 723 #endif 724 } 725 717 726 } // namespace WebKit 718 727 -
trunk/Source/WebKit2/UIProcess/mac/ViewSnapshotStore.mm
r170974 r171045 120 120 pruneSnapshots(webPageProxy); 121 121 122 webPageProxy.willRecordNavigationSnapshot(*item); 123 122 124 RefPtr<ViewSnapshot> snapshot = webPageProxy.takeViewSnapshot(); 123 125 if (!snapshot || !snapshot->hasImage())
Note:
See TracChangeset
for help on using the changeset viewer.