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

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

Issue 2047253002: Add hooks to permission layer for permission action reporting (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@permission-reporter-implementation
Patch Set: Refactor tests Created 4 years, 6 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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_context_base.h" 5 #include "chrome/browser/permissions/permission_context_base.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 const BrowserPermissionCallback& callback, 207 const BrowserPermissionCallback& callback,
208 bool persist, 208 bool persist,
209 ContentSetting content_setting) { 209 ContentSetting content_setting) {
210 #if !defined(OS_ANDROID) 210 #if !defined(OS_ANDROID)
211 // Infobar persistence and its related UMA is tracked on the infobar 211 // Infobar persistence and its related UMA is tracked on the infobar
212 // controller directly. 212 // controller directly.
213 if (persist) { 213 if (persist) {
214 DCHECK(content_setting == CONTENT_SETTING_ALLOW || 214 DCHECK(content_setting == CONTENT_SETTING_ALLOW ||
215 content_setting == CONTENT_SETTING_BLOCK); 215 content_setting == CONTENT_SETTING_BLOCK);
216 if (content_setting == CONTENT_SETTING_ALLOW) 216 if (content_setting == CONTENT_SETTING_ALLOW)
217 PermissionUmaUtil::PermissionGranted(permission_type_, requesting_origin); 217 PermissionUmaUtil::PermissionGranted(permission_type_, requesting_origin,
218 profile_);
218 else 219 else
219 PermissionUmaUtil::PermissionDenied(permission_type_, requesting_origin); 220 PermissionUmaUtil::PermissionDenied(permission_type_, requesting_origin,
221 profile_);
220 } else { 222 } else {
221 DCHECK_EQ(content_setting, CONTENT_SETTING_DEFAULT); 223 DCHECK_EQ(content_setting, CONTENT_SETTING_DEFAULT);
222 PermissionUmaUtil::PermissionDismissed(permission_type_, requesting_origin); 224 PermissionUmaUtil::PermissionDismissed(permission_type_, requesting_origin,
225 profile_);
223 } 226 }
224 #endif 227 #endif
225 228
226 NotifyPermissionSet(id, requesting_origin, embedding_origin, callback, 229 NotifyPermissionSet(id, requesting_origin, embedding_origin, callback,
227 persist, content_setting); 230 persist, content_setting);
228 } 231 }
229 232
230 #if defined(OS_ANDROID) 233 #if defined(OS_ANDROID)
231 PermissionQueueController* PermissionContextBase::GetQueueController() { 234 PermissionQueueController* PermissionContextBase::GetQueueController() {
232 return permission_queue_controller_.get(); 235 return permission_queue_controller_.get();
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
282 content_setting); 285 content_setting);
283 } 286 }
284 287
285 bool PermissionContextBase::IsPermissionKillSwitchOn() const { 288 bool PermissionContextBase::IsPermissionKillSwitchOn() const {
286 const std::string param = variations::GetVariationParamValue( 289 const std::string param = variations::GetVariationParamValue(
287 kPermissionsKillSwitchFieldStudy, 290 kPermissionsKillSwitchFieldStudy,
288 PermissionUtil::GetPermissionString(permission_type_)); 291 PermissionUtil::GetPermissionString(permission_type_));
289 292
290 return param == kPermissionsKillSwitchBlockedValue; 293 return param == kPermissionsKillSwitchBlockedValue;
291 } 294 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698