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

Unified Diff: ios/web/web_state/navigation_context_impl.mm

Issue 2698413004: Implemented WebStateObserver::DidFinishNavigation(NavigationHandle*). (Closed)
Patch Set: Addressed review comments Created 3 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ios/web/web_state/navigation_context_impl.h ('k') | ios/web/web_state/navigation_context_impl_unittest.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/web/web_state/navigation_context_impl.mm
diff --git a/ios/web/web_state/navigation_context_impl.mm b/ios/web/web_state/navigation_context_impl.mm
new file mode 100644
index 0000000000000000000000000000000000000000..fdbe1fb8142de62c20d8b716b61e4523cd4865dc
--- /dev/null
+++ b/ios/web/web_state/navigation_context_impl.mm
@@ -0,0 +1,65 @@
+// 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_context_impl.h"
+
+#include "base/memory/ptr_util.h"
+
+namespace web {
+
+// static
+std::unique_ptr<NavigationContext>
+NavigationContextImpl::CreateNavigationContext(WebState* web_state,
+ const GURL& url) {
+ std::unique_ptr<NavigationContext> resut(new NavigationContextImpl(
+ web_state, url, false /* is_same_page */, false /* is_error_page */));
+ return resut;
+}
+
+// static
+std::unique_ptr<NavigationContext>
+NavigationContextImpl::CreateSamePageNavigationContext(WebState* web_state,
+ const GURL& url) {
+ std::unique_ptr<NavigationContext> result(new NavigationContextImpl(
+ web_state, url, true /* is_same_page */, false /* is_error_page */));
+ return result;
+}
+
+// static
+std::unique_ptr<NavigationContext>
+NavigationContextImpl::CreateErrorPageNavigationContext(WebState* web_state,
+ const GURL& url) {
+ std::unique_ptr<NavigationContext> result(new NavigationContextImpl(
+ web_state, url, false /* is_same_page */, true /* is_error_page */));
+ return result;
+}
+
+WebState* NavigationContextImpl::GetWebState() {
+ return web_state_;
+}
+
+const GURL& NavigationContextImpl::GetUrl() const {
+ return url_;
+}
+
+bool NavigationContextImpl::IsSamePage() const {
+ return is_same_page_;
+}
+
+bool NavigationContextImpl::IsErrorPage() const {
+ return is_error_page_;
+}
+
+NavigationContextImpl::NavigationContextImpl(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) {}
+
+NavigationContextImpl::~NavigationContextImpl() = default;
+
+} // namespace web
« no previous file with comments | « ios/web/web_state/navigation_context_impl.h ('k') | ios/web/web_state/navigation_context_impl_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698