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

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

Issue 1365733005: Split captive portal metrics out of SSLErrorClassification (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Clean up before review 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_CAPTIVE_PORTAL_METRICS_HELPER_H_
6 #define CHROME_BROWSER_SSL_CAPTIVE_PORTAL_METRICS_HELPER_H_
7
8 #include <string>
9 #include <vector>
10
11 #include "base/time/time.h"
12 #include "content/public/browser/notification_observer.h"
13 #include "content/public/browser/notification_registrar.h"
14 #include "net/cert/x509_certificate.h"
15 #include "url/gurl.h"
16
17 namespace content {
18 class WebContents;
19 }
20
21 // This class helps the SSL interstitial record captive portal-specific
22 // metrics. It should only be used on the UI thread because its implementation
23 // uses captive_portal::CaptivePortalService which can only be accessed on the
24 // UI thread.
25 class CaptivePortalMetricsHelper : public content::NotificationObserver {
estark 2015/09/25 23:53:35 nit: What do you think about naming it CaptivePort
felt 2015/09/27 20:08:15 Sure.
26 public:
27 CaptivePortalMetricsHelper(content::WebContents* web_contents,
28 bool overridable);
29 ~CaptivePortalMetricsHelper() override;
30
31 // Should be called when the interstitial is closing.
32 void RecordCaptivePortalUMAStatistics() const;
33
34 private:
35 typedef std::vector<std::string> Tokens;
36
37 // content::NotificationObserver:
38 void Observe(int type,
39 const content::NotificationSource& source,
40 const content::NotificationDetails& details) override;
41
42 bool overridable_;
43 bool captive_portal_detection_enabled_;
44 // Did the probe complete before the interstitial was closed?
45 bool captive_portal_probe_completed_;
46 // Did the captive portal probe receive an error or get a non-HTTP response?
47 bool captive_portal_no_response_;
48 bool captive_portal_detected_;
49
50 content::NotificationRegistrar registrar_;
51 };
52
53 #endif // CHROME_BROWSER_SSL_CAPTIVE_PORTAL_METRICS_HELPER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698