| 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..e7b739e6cf2e335399107559aa951987b0745a0c 100644
|
| --- a/chrome/browser/net/net_error_tab_helper.h
|
| +++ b/chrome/browser/net/net_error_tab_helper.h
|
| @@ -13,11 +13,17 @@
|
| #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_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 +31,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,6 +82,9 @@ class NetErrorTabHelper
|
| bool OnMessageReceived(const IPC::Message& message,
|
| content::RenderFrameHost* render_frame_host) override;
|
|
|
| + content::WebContentsInterfaceRegistry* interfaces_for_testing() {
|
| + return interfaces_.get();
|
| + }
|
|
|
| protected:
|
| // |contents| is the WebContents of the tab this NetErrorTabHelper is
|
| @@ -96,8 +106,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 +121,10 @@ class NetErrorTabHelper
|
| bool IsFromErrorPage() const;
|
| #endif // BUILDFLAG(ANDROID_JAVA_UI)
|
|
|
| + std::unique_ptr<content::WebContentsInterfaceRegistry> interfaces_;
|
| + 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_;
|
|
|
|
|