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 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 // | 123 // |
124 // Updates the NetErrorHelper with the assumption the page will be loaded | 124 // Updates the NetErrorHelper with the assumption the page will be loaded |
125 // immediately. | 125 // immediately. |
126 void GetErrorHTML(FrameType frame_type, | 126 void GetErrorHTML(FrameType frame_type, |
127 const blink::WebURLError& error, | 127 const blink::WebURLError& error, |
128 bool is_failed_post, | 128 bool is_failed_post, |
129 std::string* error_html); | 129 std::string* error_html); |
130 | 130 |
131 // These methods handle tracking the actual state of the page. | 131 // These methods handle tracking the actual state of the page. |
132 void OnStartLoad(FrameType frame_type, PageType page_type); | 132 void OnStartLoad(FrameType frame_type, PageType page_type); |
133 void OnCommitLoad(FrameType frame_type); | 133 void OnCommitLoad(FrameType frame_type, const GURL& url); |
134 void OnFinishLoad(FrameType frame_type); | 134 void OnFinishLoad(FrameType frame_type); |
135 void OnStop(); | 135 void OnStop(); |
136 | 136 |
137 void CancelPendingFetches(); | 137 void CancelPendingFetches(); |
138 | 138 |
139 // Called when an error page have has been retrieved over the network. |html| | 139 // Called when an error page have has been retrieved over the network. |html| |
140 // must be an empty string on error. | 140 // must be an empty string on error. |
141 void OnNavigationCorrectionsFetched(const std::string& corrections, | 141 void OnNavigationCorrectionsFetched(const std::string& corrections, |
142 const std::string& accept_languages, | 142 const std::string& accept_languages, |
143 bool is_rtl); | 143 bool is_rtl); |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
218 // Information for the provisional / "pre-provisional" error page. NULL when | 218 // Information for the provisional / "pre-provisional" error page. NULL when |
219 // there's no page pending, or the pending page is not an error page. | 219 // there's no page pending, or the pending page is not an error page. |
220 scoped_ptr<ErrorPageInfo> pending_error_page_info_; | 220 scoped_ptr<ErrorPageInfo> pending_error_page_info_; |
221 | 221 |
222 // Information for the committed error page. NULL when the committed page is | 222 // Information for the committed error page. NULL when the committed page is |
223 // not an error page. | 223 // not an error page. |
224 scoped_ptr<ErrorPageInfo> committed_error_page_info_; | 224 scoped_ptr<ErrorPageInfo> committed_error_page_info_; |
225 | 225 |
226 NavigationCorrectionParams navigation_correction_params_; | 226 NavigationCorrectionParams navigation_correction_params_; |
227 | 227 |
| 228 // True if auto-reload is enabled at all. |
228 bool auto_reload_enabled_; | 229 bool auto_reload_enabled_; |
| 230 |
| 231 // Timer used to wait for auto-reload attempts. |
229 scoped_ptr<base::Timer> auto_reload_timer_; | 232 scoped_ptr<base::Timer> auto_reload_timer_; |
230 | 233 |
| 234 // True if the auto-reload timer would be running but is waiting for an |
| 235 // offline->online network transition. |
| 236 bool auto_reload_paused_; |
| 237 |
| 238 // True if there is an uncommitted-but-started load, error page or not. This |
| 239 // is used to inhibit starting auto-reload when an error page finishes, in |
| 240 // case this happens: |
| 241 // Error page starts |
| 242 // Error page commits |
| 243 // Non-error page starts |
| 244 // Error page finishes |
| 245 bool uncommitted_load_started_; |
| 246 |
231 // Is the browser online? | 247 // Is the browser online? |
232 bool online_; | 248 bool online_; |
233 | 249 |
234 int auto_reload_count_; | 250 int auto_reload_count_; |
235 bool can_auto_reload_page_; | |
236 | 251 |
237 // This value is set only when a navigation has been initiated from | 252 // This value is set only when a navigation has been initiated from |
238 // the error page. It is used to detect when such navigations result | 253 // the error page. It is used to detect when such navigations result |
239 // in errors. | 254 // in errors. |
240 Button navigation_from_button_; | 255 Button navigation_from_button_; |
241 }; | 256 }; |
242 | 257 |
243 #endif // CHROME_RENDERER_NET_NET_ERROR_HELPER_CORE_H_ | 258 #endif // CHROME_RENDERER_NET_NET_ERROR_HELPER_CORE_H_ |
OLD | NEW |