| 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_PUBLIC_WEB_STATE_NAVIGATION_CONTEXT_H_ |
| 6 #define IOS_WEB_PUBLIC_WEB_STATE_NAVIGATION_CONTEXT_H_ |
| 7 |
| 8 class GURL; |
| 9 |
| 10 namespace web { |
| 11 |
| 12 class WebState; |
| 13 |
| 14 // Tracks information related to a single navigation. A NavigationContext is |
| 15 // provided to WebStateObserver methods to allow observers to track specific |
| 16 // navigations and their details. Observers should clear any references to a |
| 17 // NavigationContext at the time of WebStateObserver::DidFinishNavigation, just |
| 18 // before the handle is destroyed. |
| 19 class NavigationContext { |
| 20 public: |
| 21 // The WebState the navigation is taking place in. |
| 22 virtual WebState* GetWebState() = 0; |
| 23 |
| 24 // The URL the WebState is navigating to. |
| 25 virtual const GURL& GetUrl() const = 0; |
| 26 |
| 27 // Whether the navigation happened in the same page. Examples of same page |
| 28 // navigations are: |
| 29 // * reference fragment navigations |
| 30 // * pushState/replaceState |
| 31 // * same page history navigation |
| 32 virtual bool IsSamePage() const = 0; |
| 33 |
| 34 // Whether the navigation resulted in an error page. |
| 35 virtual bool IsErrorPage() const = 0; |
| 36 |
| 37 virtual ~NavigationContext() {} |
| 38 }; |
| 39 |
| 40 } // namespace web |
| 41 |
| 42 #endif // IOS_WEB_PUBLIC_WEB_STATE_NAVIGATION_CONTEXT_H_ |
| OLD | NEW |