Chromium Code Reviews| 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 92e884d2e473cf7fca140c1e4a2ad106c042dfd7..f7ac19dec65cc779f3e25501b38a488cbdeb644c 100644 |
| --- a/chrome/browser/ui/website_settings/website_settings.cc |
| +++ b/chrome/browser/ui/website_settings/website_settings.cc |
| @@ -289,19 +289,29 @@ void WebsiteSettings::RecordWebsiteSettingsAction( |
| action, |
| WEBSITE_SETTINGS_COUNT); |
| - // Use a separate histogram to record actions if they are done on a page with |
| - // an HTTPS URL. Note that this *disregards* security status. |
| - // |
| - |
| - // TODO(palmer): Consider adding a new histogram for |
| - // GURL::SchemeIsCryptographic. (We don't want to replace this call with a |
| - // call to that function because we don't want to change the meanings of |
| - // existing metrics.) This would inform the decision to mark non-secure |
| - // origins as Dubious or Non-Secure; the overall bug for that is |
| - // crbug.com/454579. |
| - if (site_url_.SchemeIs(url::kHttpsScheme)) { |
| - UMA_HISTOGRAM_ENUMERATION("WebsiteSettings.Action.HttpsUrl", |
| - action, |
| + std::string histogram_name; |
| + |
| + if (site_url_.SchemeIsCryptographic()) { |
| + if (security_level_ == security_state::SecurityStateModel::SECURE) { |
| + UMA_HISTOGRAM_ENUMERATION("WebsiteSettings.Action.HttpsUrl2", action, |
| + WEBSITE_SETTINGS_COUNT); |
| + } else if (security_level_ == security_state::SecurityStateModel::NONE) { |
| + UMA_HISTOGRAM_ENUMERATION("WebsiteSettings.Action.HttpsUrlDowngraded", |
| + action, WEBSITE_SETTINGS_COUNT); |
| + } else if (security_level_ == |
| + security_state::SecurityStateModel::DANGEROUS) { |
| + UMA_HISTOGRAM_ENUMERATION("WebsiteSettings.Action.HttpsUrlDangerous", |
| + action, WEBSITE_SETTINGS_COUNT); |
| + } |
| + return; |
| + } |
| + |
| + if (security_level_ == |
| + security_state::SecurityStateModel::HTTP_SHOW_WARNING) { |
| + UMA_HISTOGRAM_ENUMERATION("WebsiteSettings.Action.HttpWarning", action, |
| + WEBSITE_SETTINGS_COUNT); |
| + } else if (security_level_ == security_state::SecurityStateModel::DANGEROUS) { |
| + UMA_HISTOGRAM_ENUMERATION("WebsiteSettings.Action.HttpUrlDangerous", action, |
| WEBSITE_SETTINGS_COUNT); |
| } |
| } |
| @@ -412,6 +422,8 @@ void WebsiteSettings::Init( |
| isChromeUINativeScheme = url.SchemeIs(chrome::kChromeUINativeScheme); |
| #endif |
| + security_level_ = security_info.security_level; |
|
lgarron
2016/10/21 01:04:57
I wanted to avoid introducing this before we get r
|
| + |
| if (url.SchemeIs(url::kAboutScheme)) { |
| // All about: URLs except about:blank are redirected. |
| DCHECK_EQ(url::kAboutBlankURL, url.spec()); |