Index: chrome/browser/net/net_error_tab_helper.h |
diff --git a/chrome/browser/net/net_error_tab_helper.h b/chrome/browser/net/net_error_tab_helper.h |
index 45b71843de333833f8e500ee3d841145206a72ef..66cfcf5946db7f3b80a6ff92a1a7d178979ee502 100644 |
--- a/chrome/browser/net/net_error_tab_helper.h |
+++ b/chrome/browser/net/net_error_tab_helper.h |
@@ -13,11 +13,18 @@ |
#include "base/memory/weak_ptr.h" |
#include "chrome/browser/net/dns_probe_service.h" |
#include "chrome/common/features.h" |
+#include "chrome/common/network_diagnostics.mojom.h" |
#include "components/error_page/common/net_error_info.h" |
#include "components/prefs/pref_member.h" |
+#include "content/public/browser/remote_frame_interface.h" |
+#include "content/public/browser/web_contents_frame_interface_binding.h" |
#include "content/public/browser/web_contents_observer.h" |
#include "content/public/browser/web_contents_user_data.h" |
+namespace content { |
+class WebContentsInterfaceRegistry; |
+} |
+ |
namespace chrome_browser_net { |
// A TabHelper that monitors loads for certain types of network errors and |
@@ -25,7 +32,8 @@ namespace chrome_browser_net { |
// DnsProbeService whenever a page fails to load with a DNS-related error. |
class NetErrorTabHelper |
: public content::WebContentsObserver, |
- public content::WebContentsUserData<NetErrorTabHelper> { |
+ public content::WebContentsUserData<NetErrorTabHelper>, |
+ public mojom::NetworkDiagnostics { |
public: |
enum TestingState { |
TESTING_DEFAULT, |
@@ -75,7 +83,6 @@ class NetErrorTabHelper |
bool OnMessageReceived(const IPC::Message& message, |
content::RenderFrameHost* render_frame_host) override; |
- |
protected: |
// |contents| is the WebContents of the tab this NetErrorTabHelper is |
// attached to. |
@@ -96,8 +103,8 @@ class NetErrorTabHelper |
void InitializePref(content::WebContents* contents); |
bool ProbesAllowed() const; |
- // Sanitizes |url| and shows a dialog for it. |
- void RunNetworkDiagnostics(const GURL& url); |
+ // mojom::NetworkDiagnostics: |
+ void RunNetworkDiagnostics(const GURL& url) override; |
// Shows the diagnostics dialog after its been sanitized, virtual for |
// testing. |
@@ -111,6 +118,11 @@ class NetErrorTabHelper |
bool IsFromErrorPage() const; |
#endif // BUILDFLAG(ANDROID_JAVA_UI) |
+ content::WebContentsFrameInterfaceBinding<mojom::NetworkDiagnostics> |
+ network_diagnostics_binding_; |
+ content::RemoteFrameInterface<mojom::NetworkDiagnosticsClient> |
+ remote_network_diagnostics_client_; |
+ |
// True if the last provisional load that started was for an error page. |
bool is_error_page_; |