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 <string> | 8 #include <string> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 | 71 |
72 error_page::DnsProbeStatus dns_probe_status() const { | 72 error_page::DnsProbeStatus dns_probe_status() const { |
73 return dns_probe_status_; | 73 return dns_probe_status_; |
74 } | 74 } |
75 | 75 |
76 content::WebContentsFrameBindingSet<chrome::mojom::NetworkDiagnostics>& | 76 content::WebContentsFrameBindingSet<chrome::mojom::NetworkDiagnostics>& |
77 network_diagnostics_bindings_for_testing() { | 77 network_diagnostics_bindings_for_testing() { |
78 return network_diagnostics_bindings_; | 78 return network_diagnostics_bindings_; |
79 } | 79 } |
80 | 80 |
81 #if BUILDFLAG(ANDROID_JAVA_UI) | 81 #if defined(OS_ANDROID) |
82 void DownloadPageLater(); | 82 void DownloadPageLater(); |
83 #endif // BUILDFLAG(ANDROID_JAVA_UI) | 83 #endif // defined(OS_ANDROID) |
84 | 84 |
85 private: | 85 private: |
86 friend class content::WebContentsUserData<NetErrorTabHelper>; | 86 friend class content::WebContentsUserData<NetErrorTabHelper>; |
87 | 87 |
88 void OnMainFrameDnsError(); | 88 void OnMainFrameDnsError(); |
89 | 89 |
90 void InitializePref(content::WebContents* contents); | 90 void InitializePref(content::WebContents* contents); |
91 bool ProbesAllowed() const; | 91 bool ProbesAllowed() const; |
92 | 92 |
93 // chrome::mojom::NetworkDiagnostics: | 93 // chrome::mojom::NetworkDiagnostics: |
94 void RunNetworkDiagnostics(const GURL& url) override; | 94 void RunNetworkDiagnostics(const GURL& url) override; |
95 | 95 |
96 // Shows the diagnostics dialog after its been sanitized, virtual for | 96 // Shows the diagnostics dialog after its been sanitized, virtual for |
97 // testing. | 97 // testing. |
98 virtual void RunNetworkDiagnosticsHelper(const std::string& sanitized_url); | 98 virtual void RunNetworkDiagnosticsHelper(const std::string& sanitized_url); |
99 | 99 |
100 #if BUILDFLAG(ANDROID_JAVA_UI) | 100 #if defined(OS_ANDROID) |
101 // Virtual for testing. | 101 // Virtual for testing. |
102 virtual void DownloadPageLaterHelper(const GURL& url); | 102 virtual void DownloadPageLaterHelper(const GURL& url); |
103 #endif // BUILDFLAG(ANDROID_JAVA_UI) | 103 #endif // defined(OS_ANDROID) |
104 | 104 |
105 content::WebContentsFrameBindingSet<chrome::mojom::NetworkDiagnostics> | 105 content::WebContentsFrameBindingSet<chrome::mojom::NetworkDiagnostics> |
106 network_diagnostics_bindings_; | 106 network_diagnostics_bindings_; |
107 | 107 |
108 // True if the last provisional load that started was for an error page. | 108 // True if the last provisional load that started was for an error page. |
109 bool is_error_page_; | 109 bool is_error_page_; |
110 | 110 |
111 // True if the helper has seen a main frame page load fail with a DNS error, | 111 // True if the helper has seen a main frame page load fail with a DNS error, |
112 // but has not yet seen a new page commit successfully afterwards. | 112 // but has not yet seen a new page commit successfully afterwards. |
113 bool dns_error_active_; | 113 bool dns_error_active_; |
(...skipping 15 matching lines...) Expand all Loading... |
129 BooleanPrefMember resolve_errors_with_web_service_; | 129 BooleanPrefMember resolve_errors_with_web_service_; |
130 | 130 |
131 base::WeakPtrFactory<NetErrorTabHelper> weak_factory_; | 131 base::WeakPtrFactory<NetErrorTabHelper> weak_factory_; |
132 | 132 |
133 DISALLOW_COPY_AND_ASSIGN(NetErrorTabHelper); | 133 DISALLOW_COPY_AND_ASSIGN(NetErrorTabHelper); |
134 }; | 134 }; |
135 | 135 |
136 } // namespace chrome_browser_net | 136 } // namespace chrome_browser_net |
137 | 137 |
138 #endif // CHROME_BROWSER_NET_NET_ERROR_TAB_HELPER_H_ | 138 #endif // CHROME_BROWSER_NET_NET_ERROR_TAB_HELPER_H_ |
OLD | NEW |