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

Unified Diff: chrome/browser/ssl/ssl_error_handler.h

Issue 2620203003: Add initial version of captive portal list checking. (Closed)
Patch Set: estark comments Created 3 years, 11 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
Index: chrome/browser/ssl/ssl_error_handler.h
diff --git a/chrome/browser/ssl/ssl_error_handler.h b/chrome/browser/ssl/ssl_error_handler.h
index c213c47f4db9517ed1ee3901392f58e61cbf92fe..970ac15798062edc87ee71e3d33e589fe13d3e87 100644
--- a/chrome/browser/ssl/ssl_error_handler.h
+++ b/chrome/browser/ssl/ssl_error_handler.h
@@ -15,6 +15,7 @@
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ssl/common_name_mismatch_handler.h"
#include "chrome/browser/ssl/ssl_cert_reporter.h"
+#include "chrome/browser/ssl/tls_error_assistant.pb.h"
#include "components/ssl_errors/error_classification.h"
#include "content/public/browser/notification_observer.h"
#include "content/public/browser/notification_registrar.h"
@@ -43,10 +44,13 @@ class NetworkTimeTracker;
// This class is responsible for deciding what type of interstitial to show for
// an SSL validation error. The display of the interstitial might be delayed by
estark 2017/01/20 23:31:18 optional clarification request while you're here:
meacer 2017/01/31 00:22:47 Done.
// a few seconds while trying to determine the cause of the error. During this
-// window, the class will: check for a clock error, wait for a name-mismatch
-// suggested URL, or wait for a captive portal result to arrive. If there is a
-// name mismatch error and a corresponding suggested URL result arrives in this
-// window, the user is redirected to the suggested URL.
+// window, the class will:
+// - Check for a clock error
+// - Check for a known captive portal certificate SPKI
+// - Wait for a name-mismatch suggested URL
+// - or Wait for a captive portal result to arrive.
+// If there is a name mismatch error and a corresponding suggested URL result
estark 2017/01/20 23:31:18 Hmm, these lines 52-56 have rotted a bit; for exam
meacer 2017/01/31 00:22:47 Done, thanks for the suggestion.
+// arrives in this window, the user is redirected to the suggested URL.
// Failing that, if a captive portal detected result arrives in the time window,
// a captive portal error page is shown. If none of these potential error
// causes match, an SSL interstitial is shown.
@@ -60,6 +64,21 @@ class SSLErrorHandler : public content::WebContentsUserData<SSLErrorHandler>,
public:
typedef base::Callback<void(content::WebContents*)> TimerStartedCallback;
+ // Events for UMA. Public for testing.
estark 2017/01/20 23:31:18 Since these are histogrammed, they should have an
meacer 2017/01/31 00:22:47 Done.
+ enum UMAEvent {
+ HANDLE_ALL,
+ SHOW_CAPTIVE_PORTAL_INTERSTITIAL_NONOVERRIDABLE,
+ SHOW_CAPTIVE_PORTAL_INTERSTITIAL_OVERRIDABLE,
+ SHOW_SSL_INTERSTITIAL_NONOVERRIDABLE,
+ SHOW_SSL_INTERSTITIAL_OVERRIDABLE,
+ WWW_MISMATCH_FOUND,
+ WWW_MISMATCH_URL_AVAILABLE,
+ WWW_MISMATCH_URL_NOT_AVAILABLE,
+ SHOW_BAD_CLOCK,
+ CAPTIVE_PORTAL_CERT_FOUND,
+ SSL_ERROR_HANDLER_EVENT_COUNT
+ };
+
// Entry point for the class. The parameters are the same as SSLBlockingPage
// constructor.
static void HandleSSLError(
@@ -80,6 +99,10 @@ class SSLErrorHandler : public content::WebContentsUserData<SSLErrorHandler>,
static void SetClockForTesting(base::Clock* testing_clock);
static void SetNetworkTimeTrackerForTesting(
network_time::NetworkTimeTracker* tracker);
+ static void SetErrorAssistantProtoForTesting(
+ const chrome_browser_ssl::TLSErrorAssistantConfig& config_proto);
+
estark 2017/01/20 23:31:18 nit: no blank line here so that GetHistogramName i
meacer 2017/01/31 00:22:47 Done.
+ static std::string GetHistogramNameForTesting();
protected:
// The parameters are the same as SSLBlockingPage's constructor.

Powered by Google App Engine
This is Rietveld 408576698