Chromium Code Reviews

Side by Side Diff: chrome/renderer/net/net_error_helper.h

Issue 137623011: Switch to using the new Link Doctor API. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Really fix ChromeOS Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | | Annotate | Revision Log
OLDNEW
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"
10 #include "chrome/common/net/net_error_info.h" 12 #include "chrome/common/net/net_error_info.h"
11 #include "chrome/renderer/net/net_error_helper_core.h" 13 #include "chrome/renderer/net/net_error_helper_core.h"
12 #include "content/public/renderer/render_frame_observer.h" 14 #include "content/public/renderer/render_frame_observer.h"
13 #include "content/public/renderer/render_frame_observer_tracker.h" 15 #include "content/public/renderer/render_frame_observer_tracker.h"
14 16
15 class GURL; 17 class GURL;
16 18
17 namespace content { 19 namespace content {
18 class ResourceFetcher; 20 class ResourceFetcher;
19 } 21 }
(...skipping 32 matching lines...)
52 // 54 //
53 // Updates the NetErrorHelper with the assumption the page will be loaded 55 // Updates the NetErrorHelper with the assumption the page will be loaded
54 // immediately. 56 // immediately.
55 void GetErrorHTML(blink::WebFrame* frame, 57 void GetErrorHTML(blink::WebFrame* frame,
56 const blink::WebURLError& error, 58 const blink::WebURLError& error,
57 bool is_failed_post, 59 bool is_failed_post,
58 std::string* error_html); 60 std::string* error_html);
59 61
60 private: 62 private:
61 // NetErrorHelperCore::Delegate implementation: 63 // NetErrorHelperCore::Delegate implementation:
62 virtual void GenerateLocalizedErrorPage(const blink::WebURLError& error, 64 virtual void GenerateLocalizedErrorPage(
63 bool is_failed_post, 65 const blink::WebURLError& error,
64 std::string* html) const OVERRIDE; 66 bool is_failed_post,
67 scoped_ptr<LocalizedError::ErrorPageParams> params,
68 std::string* html) const OVERRIDE;
65 virtual void LoadErrorPageInMainFrame(const std::string& html, 69 virtual void LoadErrorPageInMainFrame(const std::string& html,
66 const GURL& failed_url) OVERRIDE; 70 const GURL& failed_url) OVERRIDE;
67 virtual void UpdateErrorPage(const blink::WebURLError& error, 71 virtual void UpdateErrorPage(const blink::WebURLError& error,
68 bool is_failed_post) OVERRIDE; 72 bool is_failed_post) OVERRIDE;
69 virtual void FetchErrorPage(const GURL& url) OVERRIDE; 73 virtual void FetchErrorPage(const GURL& fix_url,
74 const std::string& fix_url_request_body) OVERRIDE;
70 virtual void CancelFetchErrorPage() OVERRIDE; 75 virtual void CancelFetchErrorPage() OVERRIDE;
71 76
72 void OnNetErrorInfo(int status); 77 void OnNetErrorInfo(int status);
73 void OnSetAltErrorPageURL(const GURL& alternate_error_page_url); 78 void OnSetLinkDoctorInfo(const GURL& alternate_error_page_url,
79 const std::string& language,
80 const std::string& country_code,
81 const std::string& api_key,
82 const GURL& search_url);
74 83
75 void OnAlternateErrorPageRetrieved(const blink::WebURLResponse& response, 84 void OnAlternateErrorPageRetrieved(const blink::WebURLResponse& response,
76 const std::string& data); 85 const std::string& data);
77 86
78 scoped_ptr<content::ResourceFetcher> alt_error_page_fetcher_; 87 scoped_ptr<content::ResourceFetcher> alt_error_page_fetcher_;
79 88
80 NetErrorHelperCore core_; 89 NetErrorHelperCore core_;
81 }; 90 };
82 91
83 #endif // CHROME_RENDERER_NET_NET_ERROR_HELPER_H_ 92 #endif // CHROME_RENDERER_NET_NET_ERROR_HELPER_H_
OLDNEW

Powered by Google App Engine