OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 CHROME_RENDERER_NET_NET_ERROR_HELPER_CORE_H_ | 5 #ifndef CHROME_RENDERER_NET_NET_ERROR_HELPER_CORE_H_ |
6 #define CHROME_RENDERER_NET_NET_ERROR_HELPER_CORE_H_ | 6 #define CHROME_RENDERER_NET_NET_ERROR_HELPER_CORE_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 // | 104 // |
105 // Updates the NetErrorHelper with the assumption the page will be loaded | 105 // Updates the NetErrorHelper with the assumption the page will be loaded |
106 // immediately. | 106 // immediately. |
107 void GetErrorHTML(FrameType frame_type, | 107 void GetErrorHTML(FrameType frame_type, |
108 const blink::WebURLError& error, | 108 const blink::WebURLError& error, |
109 bool is_failed_post, | 109 bool is_failed_post, |
110 std::string* error_html); | 110 std::string* error_html); |
111 | 111 |
112 // These methods handle tracking the actual state of the page. | 112 // These methods handle tracking the actual state of the page. |
113 void OnStartLoad(FrameType frame_type, PageType page_type); | 113 void OnStartLoad(FrameType frame_type, PageType page_type); |
114 void OnCommitLoad(FrameType frame_type); | 114 void OnCommitLoad(FrameType frame_type, const GURL& url); |
115 void OnFinishLoad(FrameType frame_type); | 115 void OnFinishLoad(FrameType frame_type); |
116 void OnStop(); | 116 void OnStop(); |
117 | 117 |
118 void CancelPendingFetches(); | 118 void CancelPendingFetches(); |
119 | 119 |
120 // Called when an error page have has been retrieved over the network. |html| | 120 // Called when an error page have has been retrieved over the network. |html| |
121 // must be an empty string on error. | 121 // must be an empty string on error. |
122 void OnNavigationCorrectionsFetched(const std::string& corrections, | 122 void OnNavigationCorrectionsFetched(const std::string& corrections, |
123 const std::string& accept_languages, | 123 const std::string& accept_languages, |
124 bool is_rtl); | 124 bool is_rtl); |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
175 const blink::WebURLError& error, | 175 const blink::WebURLError& error, |
176 bool is_failed_post, | 176 bool is_failed_post, |
177 scoped_ptr<LocalizedError::ErrorPageParams> params, | 177 scoped_ptr<LocalizedError::ErrorPageParams> params, |
178 std::string* error_html); | 178 std::string* error_html); |
179 | 179 |
180 blink::WebURLError GetUpdatedError(const blink::WebURLError& error) const; | 180 blink::WebURLError GetUpdatedError(const blink::WebURLError& error) const; |
181 | 181 |
182 void Reload(); | 182 void Reload(); |
183 bool MaybeStartAutoReloadTimer(); | 183 bool MaybeStartAutoReloadTimer(); |
184 void StartAutoReloadTimer(); | 184 void StartAutoReloadTimer(); |
| 185 void AutoReloadTimerFired(); |
| 186 void ReportAutoReloadSuccess(int error, size_t count); |
| 187 void ReportAutoReloadFailure(int error, size_t count); |
185 | 188 |
186 static bool IsReloadableError(const ErrorPageInfo& info); | 189 static bool IsReloadableError(const ErrorPageInfo& info); |
187 | 190 |
188 Delegate* delegate_; | 191 Delegate* delegate_; |
189 | 192 |
190 // The last DnsProbeStatus received from the browser. | 193 // The last DnsProbeStatus received from the browser. |
191 chrome_common_net::DnsProbeStatus last_probe_status_; | 194 chrome_common_net::DnsProbeStatus last_probe_status_; |
192 | 195 |
193 // Information for the provisional / "pre-provisional" error page. NULL when | 196 // Information for the provisional / "pre-provisional" error page. NULL when |
194 // there's no page pending, or the pending page is not an error page. | 197 // there's no page pending, or the pending page is not an error page. |
(...skipping 17 matching lines...) Expand all Loading... |
212 | 215 |
213 int auto_reload_count_; | 216 int auto_reload_count_; |
214 bool can_auto_reload_page_; | 217 bool can_auto_reload_page_; |
215 | 218 |
216 // Non-NO_BUTTON only when a navigation has been initiated from the error | 219 // Non-NO_BUTTON only when a navigation has been initiated from the error |
217 // page. Used to detect when such navigations result in errors. | 220 // page. Used to detect when such navigations result in errors. |
218 Button navigation_from_button_; | 221 Button navigation_from_button_; |
219 }; | 222 }; |
220 | 223 |
221 #endif // CHROME_RENDERER_NET_NET_ERROR_HELPER_CORE_H_ | 224 #endif // CHROME_RENDERER_NET_NET_ERROR_HELPER_CORE_H_ |
OLD | NEW |