| Index: chrome/browser/ssl/chrome_error_classification.h
|
| diff --git a/chrome/browser/ssl/chrome_error_classification.h b/chrome/browser/ssl/chrome_error_classification.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..304616a60fff6c24f7fead45093338ed3fe5e172
|
| --- /dev/null
|
| +++ b/chrome/browser/ssl/chrome_error_classification.h
|
| @@ -0,0 +1,62 @@
|
| +// Copyright 2015 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#ifndef CHROME_BROWSER_SSL_CHROME_ERROR_CLASSIFICATION_H_
|
| +#define CHROME_BROWSER_SSL_CHROME_ERROR_CLASSIFICATION_H_
|
| +
|
| +#include "components/ssl_errors/error_classification.h"
|
| +#include "content/public/browser/notification_observer.h"
|
| +#include "content/public/browser/notification_registrar.h"
|
| +
|
| +namespace base {
|
| +class Time;
|
| +}
|
| +
|
| +namespace content {
|
| +class WebContents;
|
| +}
|
| +
|
| +class GURL;
|
| +
|
| +namespace net {
|
| +class X509Certificate;
|
| +}
|
| +
|
| +// This class adds captive portal metrics to ssl_errors::ErrorClassification.
|
| +// Together, they record all of Chrome's UMA metrics for SSL classification.
|
| +//
|
| +// This class should only be used on the UI thread because its
|
| +// implementation uses captive_portal::CaptivePortalService which can only be
|
| +// accessed on the UI thread.
|
| +class ChromeErrorClassification : public ssl_errors::ErrorClassification,
|
| + public content::NotificationObserver {
|
| + public:
|
| + ChromeErrorClassification(content::WebContents* web_contents,
|
| + const base::Time& current_time,
|
| + const GURL& url,
|
| + int cert_error,
|
| + const net::X509Certificate& cert);
|
| + ~ChromeErrorClassification() override;
|
| +
|
| + void RecordCaptivePortalUMAStatistics(bool overridable) const;
|
| +
|
| + private:
|
| + // content::NotificationObserver:
|
| + void Observe(int type,
|
| + const content::NotificationSource& source,
|
| + const content::NotificationDetails& details) override;
|
| +
|
| + // 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_CHROME_ERROR_CLASSIFICATION_H_
|
|
|