Chromium Code Reviews| OLD | NEW |
|---|---|
| (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 #ifndef IOS_WEB_WEB_STATE_NAVIGATION_HANDLE_IMPL_H_ | |
| 6 #define IOS_WEB_WEB_STATE_NAVIGATION_HANDLE_IMPL_H_ | |
| 7 | |
| 8 #include <memory> | |
| 9 | |
| 10 #include "base/macros.h" | |
| 11 #include "ios/web/public/web_state/navigation_handle.h" | |
| 12 #include "url/gurl.h" | |
| 13 | |
| 14 namespace web { | |
| 15 | |
| 16 // Tracks information related to a single navigation. | |
| 17 class NavigationHandleImpl : public NavigationHandle { | |
| 18 public: | |
| 19 // Creates navigation handle for sucessful navigation to a different page. | |
| 20 static std::unique_ptr<NavigationHandle> CreateNavigationHandle( | |
| 21 WebState* web_state, | |
| 22 const GURL& url); | |
| 23 | |
| 24 // Creates navigation handle for sucessful same page navigation. | |
| 25 static std::unique_ptr<NavigationHandle> CreateSamePageNavigationHandle( | |
| 26 WebState* web_state, | |
| 27 const GURL& url); | |
| 28 | |
| 29 // Creates navigation handle for the error page navigation. | |
| 30 static std::unique_ptr<NavigationHandle> CreateErrorPageNavigationHandle( | |
| 31 WebState* web_state, | |
| 32 const GURL& url); | |
| 33 | |
| 34 NavigationHandleImpl(WebState* web_state, | |
| 35 const GURL& url, | |
| 36 bool is_same_page, | |
| 37 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.
| |
| 38 ~NavigationHandleImpl() override; | |
| 39 | |
| 40 // NavigationHandle overrides: | |
| 41 WebState* GetWebState() override; | |
| 42 const GURL& GetUrl() const override; | |
| 43 bool IsSamePage() const override; | |
| 44 bool IsErrorPage() const override; | |
| 45 | |
| 46 private: | |
| 47 WebState* web_state_ = nullptr; | |
| 48 GURL url_; | |
| 49 bool is_same_page_ = false; | |
| 50 bool is_error_page_ = false; | |
| 51 | |
| 52 DISALLOW_COPY_AND_ASSIGN(NavigationHandleImpl); | |
| 53 }; | |
| 54 | |
| 55 } // namespace web | |
| 56 | |
| 57 #endif // IOS_WEB_WEB_STATE_NAVIGATION_HANDLE_IMPL_H_ | |
| OLD | NEW |