OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 CONTENT_PUBLIC_BROWSER_NAVIGATION_HANDLE_H_ | 5 #ifndef CONTENT_PUBLIC_BROWSER_NAVIGATION_HANDLE_H_ |
6 #define CONTENT_PUBLIC_BROWSER_NAVIGATION_HANDLE_H_ | 6 #define CONTENT_PUBLIC_BROWSER_NAVIGATION_HANDLE_H_ |
7 | 7 |
8 #include "content/common/content_export.h" | 8 #include "content/common/content_export.h" |
9 #include "content/public/browser/navigation_throttle.h" | 9 #include "content/public/browser/navigation_throttle.h" |
10 #include "content/public/common/referrer.h" | 10 #include "content/public/common/referrer.h" |
11 #include "net/base/net_errors.h" | 11 #include "net/base/net_errors.h" |
12 #include "ui/base/page_transition_types.h" | 12 #include "ui/base/page_transition_types.h" |
13 | 13 |
14 class GURL; | 14 class GURL; |
15 | 15 |
| 16 namespace net { |
| 17 class HttpResponseHeaders; |
| 18 } |
| 19 |
16 namespace content { | 20 namespace content { |
17 class NavigationThrottle; | 21 class NavigationThrottle; |
18 class RenderFrameHost; | 22 class RenderFrameHost; |
19 class WebContents; | 23 class WebContents; |
20 | 24 |
21 // A NavigationHandle tracks information related to a single navigation. | 25 // A NavigationHandle tracks information related to a single navigation. |
22 class CONTENT_EXPORT NavigationHandle { | 26 class CONTENT_EXPORT NavigationHandle { |
23 public: | 27 public: |
24 virtual ~NavigationHandle() {} | 28 virtual ~NavigationHandle() {} |
25 | 29 |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 // browser-initiated navigations. | 67 // browser-initiated navigations. |
64 virtual bool HasUserGesture() = 0; | 68 virtual bool HasUserGesture() = 0; |
65 | 69 |
66 // Returns the page transition type. | 70 // Returns the page transition type. |
67 virtual ui::PageTransition GetPageTransition() = 0; | 71 virtual ui::PageTransition GetPageTransition() = 0; |
68 | 72 |
69 // Whether the target URL cannot be handled by the browser's internal protocol | 73 // Whether the target URL cannot be handled by the browser's internal protocol |
70 // handlers. | 74 // handlers. |
71 virtual bool IsExternalProtocol() = 0; | 75 virtual bool IsExternalProtocol() = 0; |
72 | 76 |
| 77 // Parameters available at network response start time ---------------------- |
| 78 // |
| 79 // The following parameters are only available when the network response is |
| 80 // made for the navigation (or at commit time if no network request was made). |
| 81 // This corresponds to NavigationThrottle::WillProcessResponse. They should |
| 82 // not be queried before that. |
| 83 |
| 84 // Returns the response headers for the request. This can only be accessed |
| 85 // after a redirect was encountered or after the the navigation is ready to |
| 86 // commit. It should not be modified, as modifications will not be reflected |
| 87 // in the network stack. |
| 88 virtual const net::HttpResponseHeaders* GetResponseHeaders() = 0; |
| 89 |
73 // Navigation control flow -------------------------------------------------- | 90 // Navigation control flow -------------------------------------------------- |
74 | 91 |
75 // The net error code if an error happened prior to commit. Otherwise it will | 92 // The net error code if an error happened prior to commit. Otherwise it will |
76 // be net::OK. | 93 // be net::OK. |
77 virtual net::Error GetNetErrorCode() = 0; | 94 virtual net::Error GetNetErrorCode() = 0; |
78 | 95 |
79 // Returns the RenderFrameHost this navigation is taking place in. This can | 96 // Returns the RenderFrameHost this navigation is taking place in. This can |
80 // only be accessed after the navigation is ready to commit. | 97 // only be accessed after the navigation is ready to commit. |
81 virtual RenderFrameHost* GetRenderFrameHost() = 0; | 98 virtual RenderFrameHost* GetRenderFrameHost() = 0; |
82 | 99 |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 virtual NavigationThrottle::ThrottleCheckResult | 150 virtual NavigationThrottle::ThrottleCheckResult |
134 CallWillRedirectRequestForTesting(const GURL& new_url, | 151 CallWillRedirectRequestForTesting(const GURL& new_url, |
135 bool new_method_is_post, | 152 bool new_method_is_post, |
136 const GURL& new_referrer_url, | 153 const GURL& new_referrer_url, |
137 bool new_is_external_protocol) = 0; | 154 bool new_is_external_protocol) = 0; |
138 }; | 155 }; |
139 | 156 |
140 } // namespace content | 157 } // namespace content |
141 | 158 |
142 #endif // CONTENT_PUBLIC_BROWSER_NAVIGATION_HANDLE_H_ | 159 #endif // CONTENT_PUBLIC_BROWSER_NAVIGATION_HANDLE_H_ |
OLD | NEW |