Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(335)

Unified Diff: chrome/browser/net/net_error_tab_helper.h

Issue 2310583002: Convert some NetError[Tab]Helper messages to mojom (Closed)
Patch Set: rebase Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/net/net_error_tab_helper.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 9b4155b50d34b5654b2531003ae22e000766375a..975ddf9722292ea215d15aa899ad98cd8df46c38 100644
--- a/chrome/browser/net/net_error_tab_helper.h
+++ b/chrome/browser/net/net_error_tab_helper.h
@@ -13,9 +13,11 @@
#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/reload_type.h"
+#include "content/public/browser/web_contents_binding_set.h"
#include "content/public/browser/web_contents_observer.h"
#include "content/public/browser/web_contents_user_data.h"
@@ -26,7 +28,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,
@@ -76,7 +79,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.
@@ -89,6 +91,11 @@ class NetErrorTabHelper
return dns_probe_status_;
}
+ content::WebContentsFrameBindingSet<mojom::NetworkDiagnostics>&
+ network_diagnostics_bindings_for_testing() {
+ return network_diagnostics_bindings_;
+ }
+
private:
friend class content::WebContentsUserData<NetErrorTabHelper>;
@@ -97,8 +104,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.
@@ -112,6 +119,9 @@ class NetErrorTabHelper
bool IsFromErrorPage() const;
#endif // BUILDFLAG(ANDROID_JAVA_UI)
+ content::WebContentsFrameBindingSet<mojom::NetworkDiagnostics>
+ network_diagnostics_bindings_;
+
// True if the last provisional load that started was for an error page.
bool is_error_page_;
« no previous file with comments | « no previous file | chrome/browser/net/net_error_tab_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698