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 "base/memory/scoped_ptr.h" | |
11 #include "chrome/common/localized_error.h" | |
12 #include "chrome/common/net/net_error_info.h" | 10 #include "chrome/common/net/net_error_info.h" |
13 #include "chrome/renderer/net/net_error_helper_core.h" | 11 #include "chrome/renderer/net/net_error_helper_core.h" |
14 #include "content/public/renderer/render_frame_observer.h" | 12 #include "content/public/renderer/render_frame_observer.h" |
15 #include "content/public/renderer/render_frame_observer_tracker.h" | 13 #include "content/public/renderer/render_frame_observer_tracker.h" |
16 | 14 |
17 class GURL; | 15 class GURL; |
18 | 16 |
19 namespace content { | 17 namespace content { |
20 class ResourceFetcher; | 18 class ResourceFetcher; |
21 } | 19 } |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 // | 52 // |
55 // Updates the NetErrorHelper with the assumption the page will be loaded | 53 // Updates the NetErrorHelper with the assumption the page will be loaded |
56 // immediately. | 54 // immediately. |
57 void GetErrorHTML(blink::WebFrame* frame, | 55 void GetErrorHTML(blink::WebFrame* frame, |
58 const blink::WebURLError& error, | 56 const blink::WebURLError& error, |
59 bool is_failed_post, | 57 bool is_failed_post, |
60 std::string* error_html); | 58 std::string* error_html); |
61 | 59 |
62 private: | 60 private: |
63 // NetErrorHelperCore::Delegate implementation: | 61 // NetErrorHelperCore::Delegate implementation: |
64 virtual void GenerateLocalizedErrorPage( | 62 virtual void GenerateLocalizedErrorPage(const blink::WebURLError& error, |
65 const blink::WebURLError& error, | 63 bool is_failed_post, |
66 bool is_failed_post, | 64 std::string* html) const OVERRIDE; |
67 scoped_ptr<LocalizedError::ErrorPageParams> params, | |
68 std::string* html) const OVERRIDE; | |
69 virtual void LoadErrorPageInMainFrame(const std::string& html, | 65 virtual void LoadErrorPageInMainFrame(const std::string& html, |
70 const GURL& failed_url) OVERRIDE; | 66 const GURL& failed_url) OVERRIDE; |
71 virtual void UpdateErrorPage(const blink::WebURLError& error, | 67 virtual void UpdateErrorPage(const blink::WebURLError& error, |
72 bool is_failed_post) OVERRIDE; | 68 bool is_failed_post) OVERRIDE; |
73 virtual void FetchNavigationCorrections( | 69 virtual void FetchErrorPage(const GURL& url) OVERRIDE; |
74 const GURL& navigation_correction_url, | 70 virtual void CancelFetchErrorPage() OVERRIDE; |
75 const std::string& navigation_correction_request_body) OVERRIDE; | |
76 virtual void CancelFetchNavigationCorrections() OVERRIDE; | |
77 | 71 |
78 void OnNetErrorInfo(int status); | 72 void OnNetErrorInfo(int status); |
79 void OnSetNavigationCorrectionInfo(const GURL& navigation_correction_url, | 73 void OnSetAltErrorPageURL(const GURL& alternate_error_page_url); |
80 const std::string& language, | |
81 const std::string& country_code, | |
82 const std::string& api_key, | |
83 const GURL& search_url); | |
84 | 74 |
85 void OnNavigationCorrectionsFetched(const blink::WebURLResponse& response, | 75 void OnAlternateErrorPageRetrieved(const blink::WebURLResponse& response, |
86 const std::string& data); | 76 const std::string& data); |
87 | 77 |
88 scoped_ptr<content::ResourceFetcher> correction_fetcher_; | 78 scoped_ptr<content::ResourceFetcher> alt_error_page_fetcher_; |
89 | 79 |
90 NetErrorHelperCore core_; | 80 NetErrorHelperCore core_; |
91 }; | 81 }; |
92 | 82 |
93 #endif // CHROME_RENDERER_NET_NET_ERROR_HELPER_H_ | 83 #endif // CHROME_RENDERER_NET_NET_ERROR_HELPER_H_ |
OLD | NEW |