Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(130)

Side by Side Diff: ios/web/web_state/ui/web_view_navigation_proxy_impl.mm

Issue 2957163002: [Navigation Experiment] Add WKBasedNavigationManagerImpl. (Closed)
Patch Set: Patch for review Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #import <WebKit/WebKit.h>
6
7 #include "ios/web/web_state/ui/web_view_navigation_proxy_impl.h"
8
9 namespace web {
10
11 WebViewNavigationProxyImpl::WebViewNavigationProxyImpl(WKWebView* web_view)
12 : web_view_(web_view) {}
13
14 bool WebViewNavigationProxyImpl::CanGoBack() const {
15 return web_view_ && [web_view_ canGoBack];
16 }
17
18 bool WebViewNavigationProxyImpl::CanGoForward() const {
19 return web_view_ && [web_view_ canGoForward];
20 }
21
22 void WebViewNavigationProxyImpl::GoBack() const {
23 [web_view_ goBack];
24 }
25
26 void WebViewNavigationProxyImpl::GoForward() const {
27 [web_view_ goForward];
28 }
29
30 void WebViewNavigationProxyImpl::GoToBackForwardListItem(
31 WKBackForwardListItem* item) const {
32 [web_view_ goToBackForwardListItem:item];
33 }
34
35 WKBackForwardListItem* WebViewNavigationProxyImpl::GetCurrentItem() const {
36 return web_view_.backForwardList.currentItem;
37 }
38
39 NSArray* WebViewNavigationProxyImpl::GetBackList() const {
40 return web_view_.backForwardList.backList;
41 }
42
43 NSArray* WebViewNavigationProxyImpl::GetForwardList() const {
44 return web_view_.backForwardList.forwardList;
45 }
46
47 WKBackForwardListItem* WebViewNavigationProxyImpl::GetItemAtOffset(
48 int offset) const {
49 return [web_view_.backForwardList itemAtIndex:offset];
50 }
51
52 void WebViewNavigationProxyImpl::SetWebView(WKWebView* web_view) {
53 web_view_ = web_view;
54 }
55
56 } // namespace web
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698