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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 DNS_PROBE_STARTED, | 73 DNS_PROBE_STARTED, |
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::DnsProbeStatus result); |
84 void MaybeSendInfo(); | 84 void MaybeSendStatus(); |
| 85 void SendInfo(chrome_common_net::DnsProbeStatus status); |
85 | 86 |
86 void InitializePref(content::WebContents* contents); | 87 void InitializePref(content::WebContents* contents); |
87 bool ProbesAllowed() const; | 88 bool ProbesAllowed() const; |
88 | 89 |
89 base::WeakPtrFactory<NetErrorTabHelper> weak_factory_; | 90 base::WeakPtrFactory<NetErrorTabHelper> weak_factory_; |
90 | 91 |
91 NetErrorTracker tracker_; | 92 NetErrorTracker tracker_; |
92 NetErrorTracker::DnsErrorPageState dns_error_page_state_; | 93 NetErrorTracker::DnsErrorPageState dns_error_page_state_; |
93 | 94 |
94 DnsProbeState dns_probe_state_; | 95 DnsProbeState dns_probe_state_; |
95 chrome_common_net::DnsProbeResult dns_probe_result_; | 96 chrome_common_net::DnsProbeStatus dns_probe_result_; |
96 | 97 |
97 // Whether we are enabled to run by the DnsProbe-Enable field trial. | 98 // Whether we are enabled to run by the DnsProbe-Enable field trial. |
98 const bool enabled_by_trial_; | 99 const bool enabled_by_trial_; |
99 // "Use a web service to resolve navigation errors" preference is required | 100 // "Use a web service to resolve navigation errors" preference is required |
100 // to allow probes. | 101 // to allow probes. |
101 BooleanPrefMember resolve_errors_with_web_service_; | 102 BooleanPrefMember resolve_errors_with_web_service_; |
102 | 103 |
103 DISALLOW_COPY_AND_ASSIGN(NetErrorTabHelper); | 104 DISALLOW_COPY_AND_ASSIGN(NetErrorTabHelper); |
104 }; | 105 }; |
105 | 106 |
106 } // namespace chrome_browser_net | 107 } // namespace chrome_browser_net |
107 | 108 |
108 #endif // CHROME_BROWSER_NET_NET_ERROR_TAB_HELPER_H_ | 109 #endif // CHROME_BROWSER_NET_NET_ERROR_TAB_HELPER_H_ |
OLD | NEW |