Chromium Code Reviews| 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..67e9785c593b31d4f94e112ff66f9efce906141a 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); |
|
meacer
2014/07/21 18:45:15
void RecordUMAStatistics(bool overridable) const ?
radhikabhar
2014/07/23 21:41:29
Done.
|
| + void RecordCaptivePortalUMAStatistics(bool overridable); |
|
meacer
2014/07/21 18:45:15
const here too.
radhikabhar
2014/07/23 21:41:29
Done.
|
| 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_ |