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

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

Issue 1365733005: Split captive portal metrics out of SSLErrorClassification (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Compiler error fix possibly for realsies Created 5 years, 3 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/captive_portal_metrics_recorder.h
diff --git a/chrome/browser/ssl/captive_portal_metrics_recorder.h b/chrome/browser/ssl/captive_portal_metrics_recorder.h
new file mode 100644
index 0000000000000000000000000000000000000000..46932cbbc13a76cc175008799f7d03085c435c17
--- /dev/null
+++ b/chrome/browser/ssl/captive_portal_metrics_recorder.h
@@ -0,0 +1,55 @@
+// 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_CAPTIVE_PORTAL_METRICS_RECORDER_H_
+#define CHROME_BROWSER_SSL_CAPTIVE_PORTAL_METRICS_RECORDER_H_
+
+#include <string>
+#include <vector>
+
+#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"
+#include "url/gurl.h"
+
+namespace content {
+class WebContents;
+}
+
+// This class helps the SSL interstitial record captive portal-specific
+// metrics. It 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 CaptivePortalMetricsRecorder : public content::NotificationObserver {
+ public:
+ CaptivePortalMetricsRecorder(content::WebContents* web_contents,
+ bool overridable);
+ ~CaptivePortalMetricsRecorder() override;
+
+ // Should be called when the interstitial is closing.
+ void RecordCaptivePortalUMAStatistics() const;
+
+ private:
+ typedef std::vector<std::string> Tokens;
+
+ // content::NotificationObserver:
+ void Observe(int type,
+ const content::NotificationSource& source,
+ const content::NotificationDetails& details) override;
+
+#if defined(ENABLE_CAPTIVE_PORTAL_DETECTION)
+ bool overridable_;
+#endif
+ 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_;
+ bool captive_portal_detected_;
+
+ content::NotificationRegistrar registrar_;
+};
+
+#endif // CHROME_BROWSER_SSL_CAPTIVE_PORTAL_METRICS_RECORDER_H_
« no previous file with comments | « chrome/browser/ssl/bad_clock_blocking_page.cc ('k') | chrome/browser/ssl/captive_portal_metrics_recorder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698