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

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

Issue 400323002: Refactor the captive portal code to move from the ssl_blocking_page class to the ssl_error_classific (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed Comments Created 6 years, 5 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_classification.h
diff --git a/chrome/browser/ssl/ssl_error_classification.h b/chrome/browser/ssl/ssl_error_classification.h
index c37ce2e007b820ec55483a50b8fd7de5bda821ad..bf7a76c25038e748f205e7b2de0bf67fd995e427 100644
--- a/chrome/browser/ssl/ssl_error_classification.h
+++ b/chrome/browser/ssl/ssl_error_classification.h
@@ -6,17 +6,24 @@
#define CHROME_BROWSER_SSL_SSL_ERROR_CLASSIFICATION_H_
#include "base/time/time.h"
+#include "content/public/browser/notification_observer.h"
+#include "content/public/browser/notification_registrar.h"
#include "net/cert/x509_certificate.h"
+namespace content {
+class WebContents;
+}
+
// This class calculates the severity scores for the different type of SSL
// errors.
-class SSLErrorClassification {
+class SSLErrorClassification : public content::NotificationObserver {
public:
- SSLErrorClassification(base::Time current_time,
+ SSLErrorClassification(content::WebContents* web_contents,
+ base::Time current_time,
const net::X509Certificate& cert);
- ~SSLErrorClassification();
+ virtual ~SSLErrorClassification();
- // This method checks whether the user clock is in the past or not.
+ // This method checks whether the system time is in the past.
static bool IsUserClockInThePast(base::Time time_now);
// This method checks whether the system time is too far in the future or
@@ -27,19 +34,37 @@ class SSLErrorClassification {
// CERT_DATE_INVALID.
float InvalidDateSeverityScore() const;
- static void RecordUMAStatistics(bool overridable);
+ void RecordUMAStatistics(bool overridable) const;
+ void RecordCaptivePortalUMAStatistics(bool overridable) const;
base::TimeDelta TimePassedSinceExpiry() const;
private:
- FRIEND_TEST_ALL_PREFIXES(SSLErrorClassification, TestDateInvalidScore);
+ FRIEND_TEST_ALL_PREFIXES(SSLErrorClassificationTest, TestDateInvalidScore);
float CalculateScoreTimePassedSinceExpiry() const;
+ float CalculateScoreEnvironments() const;
+
+ // content::NotificationObserver:
+ virtual void Observe(
+ int type,
+ const content::NotificationSource& source,
+ const content::NotificationDetails& details) OVERRIDE;
+ content::WebContents* web_contents_;
// This stores the current time.
base::Time current_time_;
-
// This stores the certificate.
const net::X509Certificate& cert_;
+ // Is captive portal detection enabled?
+ bool captive_portal_detection_enabled_;
+ // Did the probe complete before the interstitial was closed?
+ bool captive_portal_probe_completed_;
+ // Did the captive portal probe receive an error or get a non-HTTP response?
+ bool captive_portal_no_response_;
+ // Was a captive portal detected?
+ bool captive_portal_detected_;
+
+ content::NotificationRegistrar registrar_;
};
#endif // CHROME_BROWSER_SSL_SSL_ERROR_CLASSIFICATION_H_

Powered by Google App Engine
This is Rietveld 408576698