| Index: ios/web/web_state/ui/web_view_navigation_proxy_impl.mm
|
| diff --git a/ios/web/web_state/ui/web_view_navigation_proxy_impl.mm b/ios/web/web_state/ui/web_view_navigation_proxy_impl.mm
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..7ce27f8e27c13652ef2b79b8230ed9ba4c324aa8
|
| --- /dev/null
|
| +++ b/ios/web/web_state/ui/web_view_navigation_proxy_impl.mm
|
| @@ -0,0 +1,56 @@
|
| +// Copyright 2017 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#import <WebKit/WebKit.h>
|
| +
|
| +#include "ios/web/web_state/ui/web_view_navigation_proxy_impl.h"
|
| +
|
| +namespace web {
|
| +
|
| +WebViewNavigationProxyImpl::WebViewNavigationProxyImpl(WKWebView* web_view)
|
| + : web_view_(web_view) {}
|
| +
|
| +bool WebViewNavigationProxyImpl::CanGoBack() const {
|
| + return web_view_ && [web_view_ canGoBack];
|
| +}
|
| +
|
| +bool WebViewNavigationProxyImpl::CanGoForward() const {
|
| + return web_view_ && [web_view_ canGoForward];
|
| +}
|
| +
|
| +void WebViewNavigationProxyImpl::GoBack() const {
|
| + [web_view_ goBack];
|
| +}
|
| +
|
| +void WebViewNavigationProxyImpl::GoForward() const {
|
| + [web_view_ goForward];
|
| +}
|
| +
|
| +void WebViewNavigationProxyImpl::GoToBackForwardListItem(
|
| + WKBackForwardListItem* item) const {
|
| + [web_view_ goToBackForwardListItem:item];
|
| +}
|
| +
|
| +WKBackForwardListItem* WebViewNavigationProxyImpl::GetCurrentItem() const {
|
| + return web_view_.backForwardList.currentItem;
|
| +}
|
| +
|
| +NSArray* WebViewNavigationProxyImpl::GetBackList() const {
|
| + return web_view_.backForwardList.backList;
|
| +}
|
| +
|
| +NSArray* WebViewNavigationProxyImpl::GetForwardList() const {
|
| + return web_view_.backForwardList.forwardList;
|
| +}
|
| +
|
| +WKBackForwardListItem* WebViewNavigationProxyImpl::GetItemAtOffset(
|
| + int offset) const {
|
| + return [web_view_.backForwardList itemAtIndex:offset];
|
| +}
|
| +
|
| +void WebViewNavigationProxyImpl::SetWebView(WKWebView* web_view) {
|
| + web_view_ = web_view;
|
| +}
|
| +
|
| +} // namespace web
|
|
|