OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_BROWSER_NET_NET_ERROR_TAB_HELPER_H_ | 5 #ifndef CHROME_BROWSER_NET_NET_ERROR_TAB_HELPER_H_ |
6 #define CHROME_BROWSER_NET_NET_ERROR_TAB_HELPER_H_ | 6 #define CHROME_BROWSER_NET_NET_ERROR_TAB_HELPER_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 DNS_PROBE_FINISHED | 74 DNS_PROBE_FINISHED |
75 }; | 75 }; |
76 | 76 |
77 // |contents| is the WebContents of the tab this NetErrorTabHelper is | 77 // |contents| is the WebContents of the tab this NetErrorTabHelper is |
78 // attached to. | 78 // attached to. |
79 explicit NetErrorTabHelper(content::WebContents* contents); | 79 explicit NetErrorTabHelper(content::WebContents* contents); |
80 | 80 |
81 void TrackerCallback(NetErrorTracker::DnsErrorPageState state); | 81 void TrackerCallback(NetErrorTracker::DnsErrorPageState state); |
82 void MaybePostStartDnsProbeTask(); | 82 void MaybePostStartDnsProbeTask(); |
83 void OnDnsProbeFinished(chrome_common_net::DnsProbeResult result); | 83 void OnDnsProbeFinished(chrome_common_net::DnsProbeResult result); |
84 void MaybeSendInfo(); | 84 void MaybeSendStatus(); |
| 85 void SendInfo( |
| 86 chrome_common_net::DnsProbeStatus status, |
| 87 chrome_common_net::DnsProbeResult result); |
85 | 88 |
86 void InitializePref(content::WebContents* contents); | 89 void InitializePref(content::WebContents* contents); |
87 bool ProbesAllowed() const; | 90 bool ProbesAllowed() const; |
88 | 91 |
89 base::WeakPtrFactory<NetErrorTabHelper> weak_factory_; | 92 base::WeakPtrFactory<NetErrorTabHelper> weak_factory_; |
90 | 93 |
91 NetErrorTracker tracker_; | 94 NetErrorTracker tracker_; |
92 NetErrorTracker::DnsErrorPageState dns_error_page_state_; | 95 NetErrorTracker::DnsErrorPageState dns_error_page_state_; |
93 | 96 |
94 DnsProbeState dns_probe_state_; | 97 DnsProbeState dns_probe_state_; |
95 chrome_common_net::DnsProbeResult dns_probe_result_; | 98 chrome_common_net::DnsProbeResult dns_probe_result_; |
96 | 99 |
97 // Whether we are enabled to run by the DnsProbe-Enable field trial. | 100 // Whether we are enabled to run by the DnsProbe-Enable field trial. |
98 const bool enabled_by_trial_; | 101 const bool enabled_by_trial_; |
99 // "Use a web service to resolve navigation errors" preference is required | 102 // "Use a web service to resolve navigation errors" preference is required |
100 // to allow probes. | 103 // to allow probes. |
101 BooleanPrefMember resolve_errors_with_web_service_; | 104 BooleanPrefMember resolve_errors_with_web_service_; |
102 | 105 |
103 DISALLOW_COPY_AND_ASSIGN(NetErrorTabHelper); | 106 DISALLOW_COPY_AND_ASSIGN(NetErrorTabHelper); |
104 }; | 107 }; |
105 | 108 |
106 } // namespace chrome_browser_net | 109 } // namespace chrome_browser_net |
107 | 110 |
108 #endif // CHROME_BROWSER_NET_NET_ERROR_TAB_HELPER_H_ | 111 #endif // CHROME_BROWSER_NET_NET_ERROR_TAB_HELPER_H_ |
OLD | NEW |