Chromium Code Reviews| Index: ios/web/web_state/navigation_handle_impl.h |
| diff --git a/ios/web/web_state/navigation_handle_impl.h b/ios/web/web_state/navigation_handle_impl.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..6a2aff1df9e6744d902f5dd8b2c6165e240f2028 |
| --- /dev/null |
| +++ b/ios/web/web_state/navigation_handle_impl.h |
| @@ -0,0 +1,57 @@ |
| +// 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. |
| + |
| +#ifndef IOS_WEB_WEB_STATE_NAVIGATION_HANDLE_IMPL_H_ |
| +#define IOS_WEB_WEB_STATE_NAVIGATION_HANDLE_IMPL_H_ |
| + |
| +#include <memory> |
| + |
| +#include "base/macros.h" |
| +#include "ios/web/public/web_state/navigation_handle.h" |
| +#include "url/gurl.h" |
| + |
| +namespace web { |
| + |
| +// Tracks information related to a single navigation. |
| +class NavigationHandleImpl : public NavigationHandle { |
| + public: |
| + // Creates navigation handle for sucessful navigation to a different page. |
| + static std::unique_ptr<NavigationHandle> CreateNavigationHandle( |
| + WebState* web_state, |
| + const GURL& url); |
| + |
| + // Creates navigation handle for sucessful same page navigation. |
| + static std::unique_ptr<NavigationHandle> CreateSamePageNavigationHandle( |
| + WebState* web_state, |
| + const GURL& url); |
| + |
| + // Creates navigation handle for the error page navigation. |
| + static std::unique_ptr<NavigationHandle> CreateErrorPageNavigationHandle( |
| + WebState* web_state, |
| + const GURL& url); |
| + |
| + NavigationHandleImpl(WebState* web_state, |
| + const GURL& url, |
| + bool is_same_page, |
| + bool is_error_page); |
|
kkhorimoto
2017/02/22 01:42:38
Do we want to enforce the use of the static factor
Eugene But (OOO till 7-30)
2017/02/22 17:54:33
I've actually tried that but base::MakeUnique need
kkhorimoto
2017/02/22 18:38:05
I'm not sure. I haven't been using MakeUnique to
Eugene But (OOO till 7-30)
2017/02/22 21:44:56
Done.
|
| + ~NavigationHandleImpl() override; |
| + |
| + // NavigationHandle overrides: |
| + WebState* GetWebState() override; |
| + const GURL& GetUrl() const override; |
| + bool IsSamePage() const override; |
| + bool IsErrorPage() const override; |
| + |
| + private: |
| + WebState* web_state_ = nullptr; |
| + GURL url_; |
| + bool is_same_page_ = false; |
| + bool is_error_page_ = false; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(NavigationHandleImpl); |
| +}; |
| + |
| +} // namespace web |
| + |
| +#endif // IOS_WEB_WEB_STATE_NAVIGATION_HANDLE_IMPL_H_ |