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

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

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_callbacks_inttest.mm ('k') | ios/web/web_state/navigation_context_impl.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.h
diff --git a/ios/web/web_state/navigation_context_impl.h b/ios/web/web_state/navigation_context_impl.h
new file mode 100644
index 0000000000000000000000000000000000000000..11b86c1e990ea724fc5314f9ebd5b1a297feffd2
--- /dev/null
+++ b/ios/web/web_state/navigation_context_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_CONTEXT_IMPL_H_
+#define IOS_WEB_WEB_STATE_NAVIGATION_CONTEXT_IMPL_H_
+
+#include <memory>
+
+#include "base/macros.h"
+#include "ios/web/public/web_state/navigation_context.h"
+#include "url/gurl.h"
+
+namespace web {
+
+// Tracks information related to a single navigation.
+class NavigationContextImpl : public NavigationContext {
+ public:
+ // Creates navigation context for sucessful navigation to a different page.
+ static std::unique_ptr<NavigationContext> CreateNavigationContext(
+ WebState* web_state,
+ const GURL& url);
+
+ // Creates navigation context for sucessful same page navigation.
+ static std::unique_ptr<NavigationContext> CreateSamePageNavigationContext(
+ WebState* web_state,
+ const GURL& url);
+
+ // Creates navigation context for the error page navigation.
+ static std::unique_ptr<NavigationContext> CreateErrorPageNavigationContext(
+ WebState* web_state,
+ const GURL& url);
+
+ // NavigationContext overrides:
+ WebState* GetWebState() override;
+ const GURL& GetUrl() const override;
+ bool IsSamePage() const override;
+ bool IsErrorPage() const override;
+
+ private:
+ NavigationContextImpl(WebState* web_state,
+ const GURL& url,
+ bool is_same_page,
+ bool is_error_page);
+ ~NavigationContextImpl() override;
+
+ WebState* web_state_ = nullptr;
+ GURL url_;
+ bool is_same_page_ = false;
+ bool is_error_page_ = false;
+
+ DISALLOW_COPY_AND_ASSIGN(NavigationContextImpl);
+};
+
+} // namespace web
+
+#endif // IOS_WEB_WEB_STATE_NAVIGATION_CONTEXT_IMPL_H_
« no previous file with comments | « ios/web/web_state/navigation_callbacks_inttest.mm ('k') | ios/web/web_state/navigation_context_impl.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698