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

Side by Side Diff: chrome/browser/permissions/permission_util.cc

Issue 2075523002: Add SourceUI field to permission report (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: merge Created 4 years, 5 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/permissions/permission_util.h" 5 #include "chrome/browser/permissions/permission_util.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "chrome/browser/content_settings/host_content_settings_map_factory.h" 8 #include "chrome/browser/content_settings/host_content_settings_map_factory.h"
9 #include "chrome/browser/permissions/permission_uma_util.h" 9 #include "chrome/browser/permissions/permission_uma_util.h"
10 #include "components/content_settings/core/browser/host_content_settings_map.h" 10 #include "components/content_settings/core/browser/host_content_settings_map.h"
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 map->SetContentSettingDefaultScope(primary_url, secondary_url, content_type, 93 map->SetContentSettingDefaultScope(primary_url, secondary_url, content_type,
94 resource_identifier, setting); 94 resource_identifier, setting);
95 95
96 ContentSetting final_value = map->GetContentSetting( 96 ContentSetting final_value = map->GetContentSetting(
97 primary_url, secondary_url, content_type, resource_identifier); 97 primary_url, secondary_url, content_type, resource_identifier);
98 98
99 if (previous_value == CONTENT_SETTING_ALLOW && 99 if (previous_value == CONTENT_SETTING_ALLOW &&
100 final_value != CONTENT_SETTING_ALLOW) { 100 final_value != CONTENT_SETTING_ALLOW) {
101 PermissionType permission_type; 101 PermissionType permission_type;
102 if (PermissionUtil::GetPermissionType(content_type, &permission_type)) { 102 if (PermissionUtil::GetPermissionType(content_type, &permission_type)) {
103 PermissionUmaUtil::PermissionRevoked(permission_type, primary_url, 103 // TODO(stefanocs): Report revocations from page action as PAGE_ACTION
104 profile); 104 // source UI instead of SITE_SETTINGS source UI.
105 PermissionUmaUtil::PermissionRevoked(permission_type,
106 PermissionSourceUI::SITE_SETTINGS,
107 primary_url, profile);
105 } 108 }
106 } 109 }
107 } 110 }
OLDNEW
« no previous file with comments | « chrome/browser/permissions/permission_uma_util.cc ('k') | chrome/browser/safe_browsing/permission_reporter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698