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

Unified Diff: chrome/browser/ui/website_settings/website_settings.cc

Issue 476513002: Add UMA histogram to count hard revokes of user certificate error decisions. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Got rid of extraneous #include Created 6 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
Index: chrome/browser/ui/website_settings/website_settings.cc
diff --git a/chrome/browser/ui/website_settings/website_settings.cc b/chrome/browser/ui/website_settings/website_settings.cc
index bdb6dd098c6757e2b0cdea4f3ba38ca1e977880f..78379256c88cd211e87cab6da0d060d69c06d9ec 100644
--- a/chrome/browser/ui/website_settings/website_settings.cc
+++ b/chrome/browser/ui/website_settings/website_settings.cc
@@ -61,6 +61,13 @@ using content::BrowserThread;
namespace {
+// Events for UMA. Do not reorder or change!
+enum SSLCertificateDecisionsDidRevoke {
+ USER_CERT_DECISIONS_NOT_REVOKED = 0,
+ USER_CERT_DECISIONS_REVOKED,
+ END_OF_SSL_CERTIFICATE_DECISIONS_DID_REVOKE_ENUM
+};
+
// The list of content settings types to display on the Website Settings UI.
ContentSettingsType kPermissionType[] = {
CONTENT_SETTINGS_TYPE_IMAGES,
@@ -174,7 +181,8 @@ WebsiteSettings::WebsiteSettings(
cert_store_(cert_store),
content_settings_(profile->GetHostContentSettingsMap()),
chrome_ssl_host_state_delegate_(
- ChromeSSLHostStateDelegateFactory::GetForProfile(profile)) {
+ ChromeSSLHostStateDelegateFactory::GetForProfile(profile)),
+ did_revoke_user_ssl_decisions_(false) {
Init(profile, url, ssl);
HistoryService* history_service = HistoryServiceFactory::GetForProfile(
@@ -321,6 +329,24 @@ void WebsiteSettings::OnSiteDataAccessed() {
void WebsiteSettings::OnUIClosing() {
if (show_info_bar_)
WebsiteSettingsInfoBarDelegate::Create(infobar_service_);
+
+ if (did_revoke_user_ssl_decisions_) {
+ UMA_HISTOGRAM_ENUMERATION(
Alexei Svitkine (slow) 2014/08/21 19:36:11 Nit: Can you avoid having two separate macro block
jww 2014/08/21 20:26:36 Done.
+ "interstitial.ssl.did_user_revoke_decisions",
+ USER_CERT_DECISIONS_REVOKED,
+ END_OF_SSL_CERTIFICATE_DECISIONS_DID_REVOKE_ENUM);
+ } else {
+ UMA_HISTOGRAM_ENUMERATION(
+ "interstitial.ssl.did_user_revoke_decisions",
+ USER_CERT_DECISIONS_NOT_REVOKED,
+ END_OF_SSL_CERTIFICATE_DECISIONS_DID_REVOKE_ENUM);
+ }
+}
+
+void WebsiteSettings::OnSSLDecisionsRevokeButtonPressed() {
+ DCHECK(chrome_ssl_host_state_delegate_);
+ chrome_ssl_host_state_delegate_->RevokeUserDecisionsHard(site_url().host());
+ did_revoke_user_ssl_decisions_ = true;
}
void WebsiteSettings::Init(Profile* profile,

Powered by Google App Engine
This is Rietveld 408576698