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

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

Issue 2651163002: Add UMA for autoblocking and embargoing. (Closed)
Patch Set: Sync branch, add test Created 3 years, 10 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 8
9 #include <string> 9 #include <string>
10 #include <utility> 10 #include <utility>
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after
282 } 282 }
283 283
284 void PermissionContextBase::PermissionDecided( 284 void PermissionContextBase::PermissionDecided(
285 const PermissionRequestID& id, 285 const PermissionRequestID& id,
286 const GURL& requesting_origin, 286 const GURL& requesting_origin,
287 const GURL& embedding_origin, 287 const GURL& embedding_origin,
288 bool user_gesture, 288 bool user_gesture,
289 const BrowserPermissionCallback& callback, 289 const BrowserPermissionCallback& callback,
290 bool persist, 290 bool persist,
291 ContentSetting content_setting) { 291 ContentSetting content_setting) {
292 PermissionUmaUtil::RecordPermissionEmbargoReason(
dominickn 2017/01/30 02:41:36 Nit: add a comment saying: // If a decision was m
meredithl 2017/01/30 03:52:17 Done.
293 PermissionEmbargoReason::NOT_EMBARGOED);
dominickn 2017/01/30 02:41:36 You need to move this into an else case on line 32
meredithl 2017/01/30 03:52:17 Done.
292 if (PermissionRequestManager::IsEnabled()) { 294 if (PermissionRequestManager::IsEnabled()) {
293 // Infobar persistence and its related UMA is tracked on the infobar 295 // Infobar persistence and its related UMA is tracked on the infobar
294 // controller directly. 296 // controller directly.
295 PermissionRequestGestureType gesture_type = 297 PermissionRequestGestureType gesture_type =
296 user_gesture ? PermissionRequestGestureType::GESTURE 298 user_gesture ? PermissionRequestGestureType::GESTURE
297 : PermissionRequestGestureType::NO_GESTURE; 299 : PermissionRequestGestureType::NO_GESTURE;
298 DCHECK(content_setting == CONTENT_SETTING_ALLOW || 300 DCHECK(content_setting == CONTENT_SETTING_ALLOW ||
299 content_setting == CONTENT_SETTING_BLOCK || 301 content_setting == CONTENT_SETTING_BLOCK ||
300 content_setting == CONTENT_SETTING_DEFAULT); 302 content_setting == CONTENT_SETTING_DEFAULT);
301 if (content_setting == CONTENT_SETTING_ALLOW) { 303 if (content_setting == CONTENT_SETTING_ALLOW) {
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
367 DCHECK(content_setting == CONTENT_SETTING_ALLOW || 369 DCHECK(content_setting == CONTENT_SETTING_ALLOW ||
368 content_setting == CONTENT_SETTING_BLOCK); 370 content_setting == CONTENT_SETTING_BLOCK);
369 DCHECK(!requesting_origin.SchemeIsFile()); 371 DCHECK(!requesting_origin.SchemeIsFile());
370 DCHECK(!embedding_origin.SchemeIsFile()); 372 DCHECK(!embedding_origin.SchemeIsFile());
371 373
372 HostContentSettingsMapFactory::GetForProfile(profile_) 374 HostContentSettingsMapFactory::GetForProfile(profile_)
373 ->SetContentSettingDefaultScope(requesting_origin, embedding_origin, 375 ->SetContentSettingDefaultScope(requesting_origin, embedding_origin,
374 content_settings_type_, std::string(), 376 content_settings_type_, std::string(),
375 content_setting); 377 content_setting);
376 } 378 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698