OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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_H_ | 5 #ifndef CHROME_RENDERER_NET_NET_ERROR_HELPER_H_ |
6 #define CHROME_RENDERER_NET_NET_ERROR_HELPER_H_ | 6 #define CHROME_RENDERER_NET_NET_ERROR_HELPER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "chrome/common/net/net_error_info.h" | 10 #include "chrome/common/net/net_error_info.h" |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 // Examines |frame| and |error| to see if this is an error worthy of a DNS | 43 // Examines |frame| and |error| to see if this is an error worthy of a DNS |
44 // probe. If it is, initializes |error_strings| based on |error|, | 44 // probe. If it is, initializes |error_strings| based on |error|, |
45 // |is_failed_post|, and |locale| with suitable strings and returns true. | 45 // |is_failed_post|, and |locale| with suitable strings and returns true. |
46 // If not, returns false, in which case the caller should look up error | 46 // If not, returns false, in which case the caller should look up error |
47 // strings directly using LocalizedError::GetNavigationErrorStrings. | 47 // strings directly using LocalizedError::GetNavigationErrorStrings. |
48 static bool GetErrorStringsForDnsProbe( | 48 static bool GetErrorStringsForDnsProbe( |
49 WebKit::WebFrame* frame, | 49 WebKit::WebFrame* frame, |
50 const WebKit::WebURLError& error, | 50 const WebKit::WebURLError& error, |
51 bool is_failed_post, | 51 bool is_failed_post, |
52 const std::string& locale, | 52 const std::string& locale, |
| 53 const std::string& accept_languages, |
53 base::DictionaryValue* error_strings); | 54 base::DictionaryValue* error_strings); |
54 | 55 |
55 protected: | 56 protected: |
56 // These methods handle tracking the actual state of the page; this allows | 57 // These methods handle tracking the actual state of the page; this allows |
57 // unit-testing of the state tracking without having to mock out WebFrames | 58 // unit-testing of the state tracking without having to mock out WebFrames |
58 // and such. | 59 // and such. |
59 void OnStartLoad(bool is_main_frame, bool is_error_page); | 60 void OnStartLoad(bool is_main_frame, bool is_error_page); |
60 void OnFailLoad(bool is_main_frame, bool is_dns_error); | 61 void OnFailLoad(bool is_main_frame, bool is_dns_error); |
61 void OnCommitLoad(bool is_main_frame); | 62 void OnCommitLoad(bool is_main_frame); |
62 void OnFinishLoad(bool is_main_frame); | 63 void OnFinishLoad(bool is_main_frame); |
(...skipping 29 matching lines...) Expand all Loading... |
92 // described above. | 93 // described above. |
93 bool forwarding_probe_results_; | 94 bool forwarding_probe_results_; |
94 | 95 |
95 // The last main frame error seen by the helper. | 96 // The last main frame error seen by the helper. |
96 WebKit::WebURLError last_error_; | 97 WebKit::WebURLError last_error_; |
97 | 98 |
98 bool is_failed_post_; | 99 bool is_failed_post_; |
99 }; | 100 }; |
100 | 101 |
101 #endif // CHROME_RENDERER_NET_NET_ERROR_HELPER_H_ | 102 #endif // CHROME_RENDERER_NET_NET_ERROR_HELPER_H_ |
OLD | NEW |