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 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
271 action, PAGE_INFO_COUNT); | 271 action, PAGE_INFO_COUNT); |
272 } | 272 } |
273 } | 273 } |
274 | 274 |
275 void PageInfo::OnSitePermissionChanged(ContentSettingsType type, | 275 void PageInfo::OnSitePermissionChanged(ContentSettingsType type, |
276 ContentSetting setting) { | 276 ContentSetting setting) { |
277 // Count how often a permission for a specific content type is changed using | 277 // Count how often a permission for a specific content type is changed using |
278 // the Page Info UI. | 278 // the Page Info UI. |
279 size_t num_values; | 279 size_t num_values; |
280 int histogram_value = ContentSettingTypeToHistogramValue(type, &num_values); | 280 int histogram_value = ContentSettingTypeToHistogramValue(type, &num_values); |
281 UMA_HISTOGRAM_ENUMERATION("WebsiteSettings.OriginInfo.PermissionChanged", | 281 UMA_HISTOGRAM_EXACT_LINEAR("WebsiteSettings.OriginInfo.PermissionChanged", |
282 histogram_value, num_values); | 282 histogram_value, num_values); |
283 | 283 |
284 if (setting == ContentSetting::CONTENT_SETTING_ALLOW) { | 284 if (setting == ContentSetting::CONTENT_SETTING_ALLOW) { |
285 UMA_HISTOGRAM_ENUMERATION( | 285 UMA_HISTOGRAM_EXACT_LINEAR( |
286 "WebsiteSettings.OriginInfo.PermissionChanged.Allowed", histogram_value, | 286 "WebsiteSettings.OriginInfo.PermissionChanged.Allowed", histogram_value, |
287 num_values); | 287 num_values); |
288 | 288 |
289 if (type == CONTENT_SETTINGS_TYPE_PLUGINS) { | 289 if (type == CONTENT_SETTINGS_TYPE_PLUGINS) { |
290 rappor::SampleDomainAndRegistryFromGURL( | 290 rappor::SampleDomainAndRegistryFromGURL( |
291 g_browser_process->rappor_service(), | 291 g_browser_process->rappor_service(), |
292 "ContentSettings.Plugins.AddedAllowException", site_url_); | 292 "ContentSettings.Plugins.AddedAllowException", site_url_); |
293 } | 293 } |
294 } else if (setting == ContentSetting::CONTENT_SETTING_BLOCK) { | 294 } else if (setting == ContentSetting::CONTENT_SETTING_BLOCK) { |
295 UMA_HISTOGRAM_ENUMERATION( | 295 UMA_HISTOGRAM_EXACT_LINEAR( |
296 "WebsiteSettings.OriginInfo.PermissionChanged.Blocked", histogram_value, | 296 "WebsiteSettings.OriginInfo.PermissionChanged.Blocked", histogram_value, |
297 num_values); | 297 num_values); |
298 } | 298 } |
299 | 299 |
300 // This is technically redundant given the histogram above, but putting the | 300 // This is technically redundant given the histogram above, but putting the |
301 // total count of permission changes in another histogram makes it easier to | 301 // total count of permission changes in another histogram makes it easier to |
302 // compare it against other kinds of actions in PageInfo[PopupView]. | 302 // compare it against other kinds of actions in PageInfo[PopupView]. |
303 RecordPageInfoAction(PAGE_INFO_CHANGED_PERMISSION); | 303 RecordPageInfoAction(PAGE_INFO_CHANGED_PERMISSION); |
304 | 304 |
305 PermissionUtil::ScopedRevocationReporter scoped_revocation_reporter( | 305 PermissionUtil::ScopedRevocationReporter scoped_revocation_reporter( |
(...skipping 435 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
741 info.site_identity = UTF16ToUTF8(GetSimpleSiteName(site_url_)); | 741 info.site_identity = UTF16ToUTF8(GetSimpleSiteName(site_url_)); |
742 | 742 |
743 info.connection_status = site_connection_status_; | 743 info.connection_status = site_connection_status_; |
744 info.connection_status_description = UTF16ToUTF8(site_connection_details_); | 744 info.connection_status_description = UTF16ToUTF8(site_connection_details_); |
745 info.identity_status = site_identity_status_; | 745 info.identity_status = site_identity_status_; |
746 info.identity_status_description = UTF16ToUTF8(site_identity_details_); | 746 info.identity_status_description = UTF16ToUTF8(site_identity_details_); |
747 info.certificate = certificate_; | 747 info.certificate = certificate_; |
748 info.show_ssl_decision_revoke_button = show_ssl_decision_revoke_button_; | 748 info.show_ssl_decision_revoke_button = show_ssl_decision_revoke_button_; |
749 ui_->SetIdentityInfo(info); | 749 ui_->SetIdentityInfo(info); |
750 } | 750 } |
OLD | NEW |