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

Side by Side Diff: chrome/browser/ssl/chrome_error_classification.h

Issue 1355413003: Move error classification into the ssl_errors component (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_SSL_CHROME_ERROR_CLASSIFICATION_H_
6 #define CHROME_BROWSER_SSL_CHROME_ERROR_CLASSIFICATION_H_
7
8 #include "components/ssl_errors/error_classification.h"
9 #include "content/public/browser/notification_observer.h"
10 #include "content/public/browser/notification_registrar.h"
11
12 namespace base {
13 class Time;
14 }
15
16 namespace content {
17 class WebContents;
18 }
19
20 class GURL;
21
22 namespace net {
23 class X509Certificate;
24 }
25
26 // This class adds captive portal metrics to ssl_errors::ErrorClassification.
27 // Together, they record all of Chrome's UMA metrics for SSL classification.
28 //
29 // This class should only be used on the UI thread because its
30 // implementation uses captive_portal::CaptivePortalService which can only be
31 // accessed on the UI thread.
32 class ChromeErrorClassification : public ssl_errors::ErrorClassification,
33 public content::NotificationObserver {
34 public:
35 ChromeErrorClassification(content::WebContents* web_contents,
36 const base::Time& current_time,
37 const GURL& url,
38 int cert_error,
39 const net::X509Certificate& cert);
40 ~ChromeErrorClassification() override;
41
42 void RecordCaptivePortalUMAStatistics(bool overridable) const;
43
44 private:
45 // content::NotificationObserver:
46 void Observe(int type,
47 const content::NotificationSource& source,
48 const content::NotificationDetails& details) override;
49
50 // Is captive portal detection enabled?
51 bool captive_portal_detection_enabled_;
52 // Did the probe complete before the interstitial was closed?
53 bool captive_portal_probe_completed_;
54 // Did the captive portal probe receive an error or get a non-HTTP response?
55 bool captive_portal_no_response_;
56 // Was a captive portal detected?
57 bool captive_portal_detected_;
58
59 content::NotificationRegistrar registrar_;
60 };
61
62 #endif // CHROME_BROWSER_SSL_CHROME_ERROR_CLASSIFICATION_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698