| OLD | NEW |
| 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/page_info/page_info.h" | 5 #include "chrome/browser/ui/page_info/page_info.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <string> | 10 #include <string> |
| (...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 308 action, PAGE_INFO_COUNT); | 308 action, PAGE_INFO_COUNT); |
| 309 } | 309 } |
| 310 } | 310 } |
| 311 | 311 |
| 312 void PageInfo::OnSitePermissionChanged(ContentSettingsType type, | 312 void PageInfo::OnSitePermissionChanged(ContentSettingsType type, |
| 313 ContentSetting setting) { | 313 ContentSetting setting) { |
| 314 // Count how often a permission for a specific content type is changed using | 314 // Count how often a permission for a specific content type is changed using |
| 315 // the Page Info UI. | 315 // the Page Info UI. |
| 316 size_t num_values; | 316 size_t num_values; |
| 317 int histogram_value = ContentSettingTypeToHistogramValue(type, &num_values); | 317 int histogram_value = ContentSettingTypeToHistogramValue(type, &num_values); |
| 318 UMA_HISTOGRAM_ENUMERATION("WebsiteSettings.OriginInfo.PermissionChanged", | 318 UMA_HISTOGRAM_EXACT_LINEAR("WebsiteSettings.OriginInfo.PermissionChanged", |
| 319 histogram_value, num_values); | 319 histogram_value, num_values); |
| 320 | 320 |
| 321 if (setting == ContentSetting::CONTENT_SETTING_ALLOW) { | 321 if (setting == ContentSetting::CONTENT_SETTING_ALLOW) { |
| 322 UMA_HISTOGRAM_ENUMERATION( | 322 UMA_HISTOGRAM_EXACT_LINEAR( |
| 323 "WebsiteSettings.OriginInfo.PermissionChanged.Allowed", histogram_value, | 323 "WebsiteSettings.OriginInfo.PermissionChanged.Allowed", histogram_value, |
| 324 num_values); | 324 num_values); |
| 325 | 325 |
| 326 if (type == CONTENT_SETTINGS_TYPE_PLUGINS) { | 326 if (type == CONTENT_SETTINGS_TYPE_PLUGINS) { |
| 327 rappor::SampleDomainAndRegistryFromGURL( | 327 rappor::SampleDomainAndRegistryFromGURL( |
| 328 g_browser_process->rappor_service(), | 328 g_browser_process->rappor_service(), |
| 329 "ContentSettings.Plugins.AddedAllowException", site_url_); | 329 "ContentSettings.Plugins.AddedAllowException", site_url_); |
| 330 } | 330 } |
| 331 } else if (setting == ContentSetting::CONTENT_SETTING_BLOCK) { | 331 } else if (setting == ContentSetting::CONTENT_SETTING_BLOCK) { |
| 332 UMA_HISTOGRAM_ENUMERATION( | 332 UMA_HISTOGRAM_EXACT_LINEAR( |
| 333 "WebsiteSettings.OriginInfo.PermissionChanged.Blocked", histogram_value, | 333 "WebsiteSettings.OriginInfo.PermissionChanged.Blocked", histogram_value, |
| 334 num_values); | 334 num_values); |
| 335 } | 335 } |
| 336 | 336 |
| 337 // This is technically redundant given the histogram above, but putting the | 337 // This is technically redundant given the histogram above, but putting the |
| 338 // total count of permission changes in another histogram makes it easier to | 338 // total count of permission changes in another histogram makes it easier to |
| 339 // compare it against other kinds of actions in PageInfo[PopupView]. | 339 // compare it against other kinds of actions in PageInfo[PopupView]. |
| 340 RecordPageInfoAction(PAGE_INFO_CHANGED_PERMISSION); | 340 RecordPageInfoAction(PAGE_INFO_CHANGED_PERMISSION); |
| 341 | 341 |
| 342 PermissionUtil::ScopedRevocationReporter scoped_revocation_reporter( | 342 PermissionUtil::ScopedRevocationReporter scoped_revocation_reporter( |
| (...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 763 info.site_identity = UTF16ToUTF8(GetSimpleSiteName(site_url_)); | 763 info.site_identity = UTF16ToUTF8(GetSimpleSiteName(site_url_)); |
| 764 | 764 |
| 765 info.connection_status = site_connection_status_; | 765 info.connection_status = site_connection_status_; |
| 766 info.connection_status_description = UTF16ToUTF8(site_connection_details_); | 766 info.connection_status_description = UTF16ToUTF8(site_connection_details_); |
| 767 info.identity_status = site_identity_status_; | 767 info.identity_status = site_identity_status_; |
| 768 info.identity_status_description = UTF16ToUTF8(site_identity_details_); | 768 info.identity_status_description = UTF16ToUTF8(site_identity_details_); |
| 769 info.certificate = certificate_; | 769 info.certificate = certificate_; |
| 770 info.show_ssl_decision_revoke_button = show_ssl_decision_revoke_button_; | 770 info.show_ssl_decision_revoke_button = show_ssl_decision_revoke_button_; |
| 771 ui_->SetIdentityInfo(info); | 771 ui_->SetIdentityInfo(info); |
| 772 } | 772 } |
| OLD | NEW |