| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef IOS_WEB_PUBLIC_WEB_STATE_NAVIGATION_CONTEXT_H_ | 5 #ifndef IOS_WEB_PUBLIC_WEB_STATE_NAVIGATION_CONTEXT_H_ |
| 6 #define IOS_WEB_PUBLIC_WEB_STATE_NAVIGATION_CONTEXT_H_ | 6 #define IOS_WEB_PUBLIC_WEB_STATE_NAVIGATION_CONTEXT_H_ |
| 7 | 7 |
| 8 #import <Foundation/Foundation.h> |
| 9 |
| 8 class GURL; | 10 class GURL; |
| 9 | 11 |
| 10 namespace net { | 12 namespace net { |
| 11 class HttpResponseHeaders; | 13 class HttpResponseHeaders; |
| 12 } | 14 } |
| 13 | 15 |
| 14 namespace web { | 16 namespace web { |
| 15 | 17 |
| 16 class WebState; | 18 class WebState; |
| 17 | 19 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 28 // The URL the WebState is navigating to. | 30 // The URL the WebState is navigating to. |
| 29 virtual const GURL& GetUrl() const = 0; | 31 virtual const GURL& GetUrl() const = 0; |
| 30 | 32 |
| 31 // Whether the navigation happened within the same document. Examples of same | 33 // Whether the navigation happened within the same document. Examples of same |
| 32 // document navigations are: | 34 // document navigations are: |
| 33 // * reference fragment navigations | 35 // * reference fragment navigations |
| 34 // * pushState/replaceState | 36 // * pushState/replaceState |
| 35 // * same document history navigation | 37 // * same document history navigation |
| 36 virtual bool IsSameDocument() const = 0; | 38 virtual bool IsSameDocument() const = 0; |
| 37 | 39 |
| 38 // Whether the navigation resulted in an error page. | 40 // Returns error if the navigation has failed. |
| 39 virtual bool IsErrorPage() const = 0; | 41 virtual NSError* GetError() const = 0; |
| 40 | 42 |
| 41 // Returns the response headers for the request, or null if there aren't any | 43 // Returns the response headers for the request, or null if there aren't any |
| 42 // response headers or they have not been received yet. The response headers | 44 // response headers or they have not been received yet. The response headers |
| 43 // returned should not be modified, as modifications will not be reflected. | 45 // returned should not be modified, as modifications will not be reflected. |
| 44 virtual net::HttpResponseHeaders* GetResponseHeaders() const = 0; | 46 virtual net::HttpResponseHeaders* GetResponseHeaders() const = 0; |
| 45 | 47 |
| 46 virtual ~NavigationContext() {} | 48 virtual ~NavigationContext() {} |
| 47 }; | 49 }; |
| 48 | 50 |
| 49 } // namespace web | 51 } // namespace web |
| 50 | 52 |
| 51 #endif // IOS_WEB_PUBLIC_WEB_STATE_NAVIGATION_CONTEXT_H_ | 53 #endif // IOS_WEB_PUBLIC_WEB_STATE_NAVIGATION_CONTEXT_H_ |
| OLD | NEW |