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

Side by Side 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: Rebase on ToT Created 6 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/website_settings/website_settings.h" 5 #include "chrome/browser/ui/website_settings/website_settings.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 #include "chrome/browser/chromeos/policy/policy_cert_service_factory.h" 54 #include "chrome/browser/chromeos/policy/policy_cert_service_factory.h"
55 #endif 55 #endif
56 56
57 using base::ASCIIToUTF16; 57 using base::ASCIIToUTF16;
58 using base::UTF8ToUTF16; 58 using base::UTF8ToUTF16;
59 using base::UTF16ToUTF8; 59 using base::UTF16ToUTF8;
60 using content::BrowserThread; 60 using content::BrowserThread;
61 61
62 namespace { 62 namespace {
63 63
64 // Events for UMA. Do not reorder or change!
65 enum SSLCertificateDecisionsDidRevoke {
66 USER_CERT_DECISIONS_NOT_REVOKED = 0,
67 USER_CERT_DECISIONS_REVOKED,
68 END_OF_SSL_CERTIFICATE_DECISIONS_DID_REVOKE_ENUM
69 };
70
64 // The list of content settings types to display on the Website Settings UI. 71 // The list of content settings types to display on the Website Settings UI.
65 ContentSettingsType kPermissionType[] = { 72 ContentSettingsType kPermissionType[] = {
66 CONTENT_SETTINGS_TYPE_IMAGES, 73 CONTENT_SETTINGS_TYPE_IMAGES,
67 CONTENT_SETTINGS_TYPE_JAVASCRIPT, 74 CONTENT_SETTINGS_TYPE_JAVASCRIPT,
68 CONTENT_SETTINGS_TYPE_PLUGINS, 75 CONTENT_SETTINGS_TYPE_PLUGINS,
69 CONTENT_SETTINGS_TYPE_POPUPS, 76 CONTENT_SETTINGS_TYPE_POPUPS,
70 CONTENT_SETTINGS_TYPE_GEOLOCATION, 77 CONTENT_SETTINGS_TYPE_GEOLOCATION,
71 CONTENT_SETTINGS_TYPE_NOTIFICATIONS, 78 CONTENT_SETTINGS_TYPE_NOTIFICATIONS,
72 CONTENT_SETTINGS_TYPE_FULLSCREEN, 79 CONTENT_SETTINGS_TYPE_FULLSCREEN,
73 CONTENT_SETTINGS_TYPE_MOUSELOCK, 80 CONTENT_SETTINGS_TYPE_MOUSELOCK,
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 ui_(ui), 174 ui_(ui),
168 infobar_service_(infobar_service), 175 infobar_service_(infobar_service),
169 show_info_bar_(false), 176 show_info_bar_(false),
170 site_url_(url), 177 site_url_(url),
171 site_identity_status_(SITE_IDENTITY_STATUS_UNKNOWN), 178 site_identity_status_(SITE_IDENTITY_STATUS_UNKNOWN),
172 cert_id_(0), 179 cert_id_(0),
173 site_connection_status_(SITE_CONNECTION_STATUS_UNKNOWN), 180 site_connection_status_(SITE_CONNECTION_STATUS_UNKNOWN),
174 cert_store_(cert_store), 181 cert_store_(cert_store),
175 content_settings_(profile->GetHostContentSettingsMap()), 182 content_settings_(profile->GetHostContentSettingsMap()),
176 chrome_ssl_host_state_delegate_( 183 chrome_ssl_host_state_delegate_(
177 ChromeSSLHostStateDelegateFactory::GetForProfile(profile)) { 184 ChromeSSLHostStateDelegateFactory::GetForProfile(profile)),
185 did_revoke_user_ssl_decisions_(false) {
178 Init(profile, url, ssl); 186 Init(profile, url, ssl);
179 187
180 HistoryService* history_service = HistoryServiceFactory::GetForProfile( 188 HistoryService* history_service = HistoryServiceFactory::GetForProfile(
181 profile, Profile::EXPLICIT_ACCESS); 189 profile, Profile::EXPLICIT_ACCESS);
182 if (history_service) { 190 if (history_service) {
183 history_service->GetVisibleVisitCountToHost( 191 history_service->GetVisibleVisitCountToHost(
184 site_url_, 192 site_url_,
185 base::Bind(&WebsiteSettings::OnGotVisitCountToHost, 193 base::Bind(&WebsiteSettings::OnGotVisitCountToHost,
186 base::Unretained(this)), 194 base::Unretained(this)),
187 &visit_count_task_tracker_); 195 &visit_count_task_tracker_);
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
301 PresentHistoryInfo(first_visit); 309 PresentHistoryInfo(first_visit);
302 } 310 }
303 311
304 void WebsiteSettings::OnSiteDataAccessed() { 312 void WebsiteSettings::OnSiteDataAccessed() {
305 PresentSiteData(); 313 PresentSiteData();
306 } 314 }
307 315
308 void WebsiteSettings::OnUIClosing() { 316 void WebsiteSettings::OnUIClosing() {
309 if (show_info_bar_) 317 if (show_info_bar_)
310 WebsiteSettingsInfoBarDelegate::Create(infobar_service_); 318 WebsiteSettingsInfoBarDelegate::Create(infobar_service_);
319
320 SSLCertificateDecisionsDidRevoke user_decision =
321 did_revoke_user_ssl_decisions_ ? USER_CERT_DECISIONS_REVOKED
322 : USER_CERT_DECISIONS_NOT_REVOKED;
323
324 UMA_HISTOGRAM_ENUMERATION("interstitial.ssl.did_user_revoke_decisions",
325 user_decision,
326 END_OF_SSL_CERTIFICATE_DECISIONS_DID_REVOKE_ENUM);
327 }
328
329 void WebsiteSettings::OnRevokeSSLErrorBypassButtonPressed() {
330 DCHECK(chrome_ssl_host_state_delegate_);
331 chrome_ssl_host_state_delegate_->RevokeUserDecisionsHard(site_url().host());
332 did_revoke_user_ssl_decisions_ = true;
311 } 333 }
312 334
313 void WebsiteSettings::Init(Profile* profile, 335 void WebsiteSettings::Init(Profile* profile,
314 const GURL& url, 336 const GURL& url,
315 const content::SSLStatus& ssl) { 337 const content::SSLStatus& ssl) {
316 if (url.SchemeIs(content::kChromeUIScheme)) { 338 if (url.SchemeIs(content::kChromeUIScheme)) {
317 site_identity_status_ = SITE_IDENTITY_STATUS_INTERNAL_PAGE; 339 site_identity_status_ = SITE_IDENTITY_STATUS_INTERNAL_PAGE;
318 site_identity_details_ = 340 site_identity_details_ =
319 l10n_util::GetStringUTF16(IDS_PAGE_INFO_INTERNAL_PAGE); 341 l10n_util::GetStringUTF16(IDS_PAGE_INFO_INTERNAL_PAGE);
320 site_connection_status_ = SITE_CONNECTION_STATUS_INTERNAL_PAGE; 342 site_connection_status_ = SITE_CONNECTION_STATUS_INTERNAL_PAGE;
(...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after
715 if (visited_before_today) { 737 if (visited_before_today) {
716 first_visit_text = l10n_util::GetStringFUTF16( 738 first_visit_text = l10n_util::GetStringFUTF16(
717 IDS_PAGE_INFO_SECURITY_TAB_VISITED_BEFORE_TODAY, 739 IDS_PAGE_INFO_SECURITY_TAB_VISITED_BEFORE_TODAY,
718 base::TimeFormatShortDate(first_visit)); 740 base::TimeFormatShortDate(first_visit));
719 } else { 741 } else {
720 first_visit_text = l10n_util::GetStringUTF16( 742 first_visit_text = l10n_util::GetStringUTF16(
721 IDS_PAGE_INFO_SECURITY_TAB_FIRST_VISITED_TODAY); 743 IDS_PAGE_INFO_SECURITY_TAB_FIRST_VISITED_TODAY);
722 } 744 }
723 ui_->SetFirstVisit(first_visit_text); 745 ui_->SetFirstVisit(first_visit_text);
724 } 746 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/website_settings/website_settings.h ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698