| 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" |
| 11 #include "chrome/renderer/net/net_error_helper_core.h" | 11 #include "chrome/renderer/net/net_error_helper_core.h" |
| 12 #include "content/public/renderer/render_view_observer.h" | 12 #include "content/public/renderer/render_frame_observer.h" |
| 13 #include "content/public/renderer/render_view_observer_tracker.h" | 13 #include "content/public/renderer/render_frame_observer_tracker.h" |
| 14 | 14 |
| 15 class GURL; | 15 class GURL; |
| 16 | 16 |
| 17 namespace content { | 17 namespace content { |
| 18 class ResourceFetcher; | 18 class ResourceFetcher; |
| 19 } | 19 } |
| 20 | 20 |
| 21 namespace blink { | 21 namespace blink { |
| 22 class WebFrame; | 22 class WebFrame; |
| 23 class WebURLResponse; | 23 class WebURLResponse; |
| 24 struct WebURLError; | 24 struct WebURLError; |
| 25 } | 25 } |
| 26 | 26 |
| 27 // Listens for NetErrorInfo messages from the NetErrorTabHelper on the | 27 // Listens for NetErrorInfo messages from the NetErrorTabHelper on the |
| 28 // browser side and updates the error page with more details (currently, just | 28 // browser side and updates the error page with more details (currently, just |
| 29 // DNS probe results) if/when available. | 29 // DNS probe results) if/when available. |
| 30 class NetErrorHelper | 30 class NetErrorHelper |
| 31 : public content::RenderViewObserver, | 31 : public content::RenderFrameObserver, |
| 32 public content::RenderViewObserverTracker<NetErrorHelper>, | 32 public content::RenderFrameObserverTracker<NetErrorHelper>, |
| 33 public NetErrorHelperCore::Delegate { | 33 public NetErrorHelperCore::Delegate { |
| 34 public: | 34 public: |
| 35 explicit NetErrorHelper(content::RenderView* render_view); | 35 explicit NetErrorHelper(content::RenderFrame* render_view); |
| 36 virtual ~NetErrorHelper(); | 36 virtual ~NetErrorHelper(); |
| 37 | 37 |
| 38 // RenderViewObserver implementation. | 38 // RenderFrameObserver implementation. |
| 39 virtual void DidStartProvisionalLoad(blink::WebFrame* frame) OVERRIDE; | 39 virtual void DidStartProvisionalLoad(blink::WebFrame* frame) OVERRIDE; |
| 40 virtual void DidCommitProvisionalLoad(blink::WebFrame* frame, | 40 virtual void DidCommitProvisionalLoad(blink::WebFrame* frame, |
| 41 bool is_new_navigation) OVERRIDE; | 41 bool is_new_navigation) OVERRIDE; |
| 42 virtual void DidFinishLoad(blink::WebFrame* frame) OVERRIDE; | 42 virtual void DidFinishLoad(blink::WebFrame* frame) OVERRIDE; |
| 43 virtual void OnStop() OVERRIDE; | 43 virtual void OnStop() OVERRIDE; |
| 44 | 44 |
| 45 // IPC::Listener implementation. | 45 // IPC::Listener implementation. |
| 46 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; | 46 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; |
| 47 | 47 |
| 48 // Examines |frame| and |error| to see if this is an error worthy of a DNS | 48 // Examines |frame| and |error| to see if this is an error worthy of a DNS |
| (...skipping 26 matching lines...) Expand all Loading... |
| 75 | 75 |
| 76 void OnAlternateErrorPageRetrieved(const blink::WebURLResponse& response, | 76 void OnAlternateErrorPageRetrieved(const blink::WebURLResponse& response, |
| 77 const std::string& data); | 77 const std::string& data); |
| 78 | 78 |
| 79 scoped_ptr<content::ResourceFetcher> alt_error_page_fetcher_; | 79 scoped_ptr<content::ResourceFetcher> alt_error_page_fetcher_; |
| 80 | 80 |
| 81 NetErrorHelperCore core_; | 81 NetErrorHelperCore core_; |
| 82 }; | 82 }; |
| 83 | 83 |
| 84 #endif // CHROME_RENDERER_NET_NET_ERROR_HELPER_H_ | 84 #endif // CHROME_RENDERER_NET_NET_ERROR_HELPER_H_ |
| OLD | NEW |