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

Unified Diff: ios/web/public/web_state/navigation_context.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/public/test/fakes/test_web_client.mm ('k') | ios/web/public/web_state/ui/crw_web_delegate.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/web/public/web_state/navigation_context.h
diff --git a/ios/web/public/web_state/navigation_context.h b/ios/web/public/web_state/navigation_context.h
new file mode 100644
index 0000000000000000000000000000000000000000..44b48eb220c1fbfbf45d7ac15d07c50a041005fa
--- /dev/null
+++ b/ios/web/public/web_state/navigation_context.h
@@ -0,0 +1,42 @@
+// 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_PUBLIC_WEB_STATE_NAVIGATION_CONTEXT_H_
+#define IOS_WEB_PUBLIC_WEB_STATE_NAVIGATION_CONTEXT_H_
+
+class GURL;
+
+namespace web {
+
+class WebState;
+
+// Tracks information related to a single navigation. A NavigationContext is
+// provided to WebStateObserver methods to allow observers to track specific
+// navigations and their details. Observers should clear any references to a
+// NavigationContext at the time of WebStateObserver::DidFinishNavigation, just
+// before the handle is destroyed.
+class NavigationContext {
+ public:
+ // The WebState the navigation is taking place in.
+ virtual WebState* GetWebState() = 0;
+
+ // The URL the WebState is navigating to.
+ virtual const GURL& GetUrl() const = 0;
+
+ // Whether the navigation happened in the same page. Examples of same page
+ // navigations are:
+ // * reference fragment navigations
+ // * pushState/replaceState
+ // * same page history navigation
+ virtual bool IsSamePage() const = 0;
+
+ // Whether the navigation resulted in an error page.
+ virtual bool IsErrorPage() const = 0;
+
+ virtual ~NavigationContext() {}
+};
+
+} // namespace web
+
+#endif // IOS_WEB_PUBLIC_WEB_STATE_NAVIGATION_CONTEXT_H_
« no previous file with comments | « ios/web/public/test/fakes/test_web_client.mm ('k') | ios/web/public/web_state/ui/crw_web_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698