| Index: ios/web/web_state/navigation_handle_impl.mm
|
| diff --git a/ios/web/web_state/navigation_handle_impl.mm b/ios/web/web_state/navigation_handle_impl.mm
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..4bb51b894b8151580181b4533041721bd2cde0b6
|
| --- /dev/null
|
| +++ b/ios/web/web_state/navigation_handle_impl.mm
|
| @@ -0,0 +1,62 @@
|
| +// 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.
|
| +
|
| +#include "ios/web/web_state/navigation_handle_impl.h"
|
| +
|
| +#include "base/memory/ptr_util.h"
|
| +
|
| +namespace web {
|
| +
|
| +// static
|
| +std::unique_ptr<NavigationHandle> NavigationHandleImpl::CreateNavigationHandle(
|
| + WebState* web_state,
|
| + const GURL& url) {
|
| + return base::MakeUnique<NavigationHandleImpl>(
|
| + web_state, url, false /* is_same_page */, false /* is_error_page */);
|
| +}
|
| +
|
| +// static
|
| +std::unique_ptr<NavigationHandle>
|
| +NavigationHandleImpl::CreateSamePageNavigationHandle(WebState* web_state,
|
| + const GURL& url) {
|
| + return base::MakeUnique<NavigationHandleImpl>(
|
| + web_state, url, true /* is_same_page */, false /* is_error_page */);
|
| +}
|
| +
|
| +// static
|
| +std::unique_ptr<NavigationHandle>
|
| +NavigationHandleImpl::CreateErrorPageNavigationHandle(WebState* web_state,
|
| + const GURL& url) {
|
| + return base::MakeUnique<NavigationHandleImpl>(
|
| + web_state, url, false /* is_same_page */, true /* is_error_page */);
|
| +}
|
| +
|
| +NavigationHandleImpl::NavigationHandleImpl(WebState* web_state,
|
| + const GURL& url,
|
| + bool is_same_page,
|
| + bool is_error_page)
|
| + : web_state_(web_state),
|
| + url_(url),
|
| + is_same_page_(is_same_page),
|
| + is_error_page_(is_error_page) {}
|
| +
|
| +NavigationHandleImpl::~NavigationHandleImpl() = default;
|
| +
|
| +WebState* NavigationHandleImpl::GetWebState() {
|
| + return web_state_;
|
| +}
|
| +
|
| +const GURL& NavigationHandleImpl::GetUrl() const {
|
| + return url_;
|
| +}
|
| +
|
| +bool NavigationHandleImpl::IsSamePage() const {
|
| + return is_same_page_;
|
| +}
|
| +
|
| +bool NavigationHandleImpl::IsErrorPage() const {
|
| + return is_error_page_;
|
| +}
|
| +
|
| +} // namespace web
|
|
|