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

Side by Side Diff: chrome/browser/ui/website_settings/website_settings.cc

Issue 2180723002: Add revocation metrics from OIB and content setting (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@revocation-reporter
Patch Set: Remove set custom host map Created 4 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 unified diff | Download patch
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 <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <string> 10 #include <string>
(...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after
281 histogram_value, num_values); 281 histogram_value, num_values);
282 282
283 if (setting == ContentSetting::CONTENT_SETTING_ALLOW) { 283 if (setting == ContentSetting::CONTENT_SETTING_ALLOW) {
284 UMA_HISTOGRAM_ENUMERATION( 284 UMA_HISTOGRAM_ENUMERATION(
285 "WebsiteSettings.OriginInfo.PermissionChanged.Allowed", histogram_value, 285 "WebsiteSettings.OriginInfo.PermissionChanged.Allowed", histogram_value,
286 num_values); 286 num_values);
287 } else if (setting == ContentSetting::CONTENT_SETTING_BLOCK) { 287 } else if (setting == ContentSetting::CONTENT_SETTING_BLOCK) {
288 UMA_HISTOGRAM_ENUMERATION( 288 UMA_HISTOGRAM_ENUMERATION(
289 "WebsiteSettings.OriginInfo.PermissionChanged.Blocked", histogram_value, 289 "WebsiteSettings.OriginInfo.PermissionChanged.Blocked", histogram_value,
290 num_values); 290 num_values);
291 // Trigger Rappor sampling if it is a permission revoke action.
292 // TODO(tsergeant): Integrate this with the revocation recording performed
kcarattini 2016/07/26 03:54:20 Tim, is this TODO completed now? I'm not really su
tsergeant 2016/07/26 04:09:30 Yup, it's also done. It's referring to using the s
293 // in the permissions layer. See crbug.com/469221.
294 content::PermissionType permission_type;
295 if (PermissionUtil::GetPermissionType(type, &permission_type)) {
296 PermissionUmaUtil::PermissionRevoked(permission_type,
297 PermissionSourceUI::OIB,
298 this->site_url_, this->profile_);
299 }
300 } 291 }
301 292
302 // This is technically redundant given the histogram above, but putting the 293 // This is technically redundant given the histogram above, but putting the
303 // total count of permission changes in another histogram makes it easier to 294 // total count of permission changes in another histogram makes it easier to
304 // compare it against other kinds of actions in WebsiteSettings[PopupView]. 295 // compare it against other kinds of actions in WebsiteSettings[PopupView].
305 RecordWebsiteSettingsAction(WEBSITE_SETTINGS_CHANGED_PERMISSION); 296 RecordWebsiteSettingsAction(WEBSITE_SETTINGS_CHANGED_PERMISSION);
306 297
298 PermissionUtil::ScopedRevocationReporter scoped_revocation_reporter(
299 this->profile_, this->site_url_, this->site_url_, type,
300 PermissionSourceUI::OIB);
301
307 content_settings_->SetNarrowestContentSetting(site_url_, site_url_, type, 302 content_settings_->SetNarrowestContentSetting(site_url_, site_url_, type,
308 setting); 303 setting);
309 304
310 show_info_bar_ = true; 305 show_info_bar_ = true;
311 306
312 // Refresh the UI to reflect the new setting. 307 // Refresh the UI to reflect the new setting.
313 PresentSitePermissions(); 308 PresentSitePermissions();
314 } 309 }
315 310
316 void WebsiteSettings::OnSiteChosenObjectDeleted( 311 void WebsiteSettings::OnSiteChosenObjectDeleted(
(...skipping 446 matching lines...) Expand 10 before | Expand all | Expand 10 after
763 info.connection_status = site_connection_status_; 758 info.connection_status = site_connection_status_;
764 info.connection_status_description = 759 info.connection_status_description =
765 UTF16ToUTF8(site_connection_details_); 760 UTF16ToUTF8(site_connection_details_);
766 info.identity_status = site_identity_status_; 761 info.identity_status = site_identity_status_;
767 info.identity_status_description = 762 info.identity_status_description =
768 UTF16ToUTF8(site_identity_details_); 763 UTF16ToUTF8(site_identity_details_);
769 info.cert_id = cert_id_; 764 info.cert_id = cert_id_;
770 info.show_ssl_decision_revoke_button = show_ssl_decision_revoke_button_; 765 info.show_ssl_decision_revoke_button = show_ssl_decision_revoke_button_;
771 ui_->SetIdentityInfo(info); 766 ui_->SetIdentityInfo(info);
772 } 767 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698