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

Unified Diff: chrome/browser/ssl/bad_clock_blocking_page.cc

Issue 1317593002: Have SSLErrorHandler decide which type of interstitial to display (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: typo Created 5 years, 4 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
« no previous file with comments | « no previous file | chrome/browser/ssl/ssl_blocking_page.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ssl/bad_clock_blocking_page.cc
diff --git a/chrome/browser/ssl/bad_clock_blocking_page.cc b/chrome/browser/ssl/bad_clock_blocking_page.cc
index 6d7075398810e6ad4e007815400da910a97c5aeb..106eb8e984d043cc055dba82548cd527315f0182 100644
--- a/chrome/browser/ssl/bad_clock_blocking_page.cc
+++ b/chrome/browser/ssl/bad_clock_blocking_page.cc
@@ -20,6 +20,7 @@
#include "base/time/time.h"
#include "base/values.h"
#include "chrome/browser/browser_process.h"
+#include "chrome/browser/interstitials/chrome_metrics_helper.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/renderer_preferences_util.h"
#include "chrome/browser/ssl/ssl_error_classification.h"
@@ -70,6 +71,8 @@ using content::NavigationEntry;
namespace {
+const char kMetricsName[] = "bad_clock";
+
void LaunchDateAndTimeSettings() {
DCHECK_CURRENTLY_ON(content::BrowserThread::FILE);
// The code for each OS is completely separate, in order to avoid bugs like
@@ -177,7 +180,20 @@ BadClockBlockingPage::BadClockBlockingPage(
callback_(callback),
cert_error_(cert_error),
ssl_info_(ssl_info),
- time_triggered_(time_triggered) {}
+ time_triggered_(time_triggered) {
+ security_interstitials::MetricsHelper::ReportDetails reporting_info;
+ reporting_info.metric_prefix = kMetricsName;
+ set_metrics_helper(new ChromeMetricsHelper(web_contents, request_url,
+ reporting_info, kMetricsName));
+ metrics_helper()->RecordUserInteraction(
+ security_interstitials::MetricsHelper::TOTAL_VISITS);
+
+ // TODO(felt): Separate the clock statistics from the main ssl statistics.
+ scoped_ptr<SSLErrorClassification> classifier(
+ new SSLErrorClassification(web_contents, time_triggered_, request_url,
+ cert_error_, *ssl_info_.cert.get()));
+ classifier->RecordUMAStatistics(false);
+}
bool BadClockBlockingPage::ShouldCreateNewNavigation() const {
return true;
@@ -294,8 +310,12 @@ void BadClockBlockingPage::CommandReceived(const std::string& command) {
SetReportingPreference(false);
break;
case CMD_SHOW_MORE_SECTION:
+ metrics_helper()->RecordUserInteraction(
+ security_interstitials::MetricsHelper::SHOW_ADVANCED);
break;
case CMD_OPEN_DATE_SETTINGS:
+ metrics_helper()->RecordUserInteraction(
+ security_interstitials::MetricsHelper::OPEN_TIME_SETTINGS);
content::BrowserThread::PostTask(content::BrowserThread::FILE, FROM_HERE,
base::Bind(&LaunchDateAndTimeSettings));
break;
« no previous file with comments | « no previous file | chrome/browser/ssl/ssl_blocking_page.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698