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

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

Issue 2651163002: Add UMA for autoblocking and embargoing. (Closed)
Patch Set: Review comments, add histogram checks 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 298 matching lines...) Expand 10 before | Expand all | Expand 10 after
309 requesting_origin, profile_); 309 requesting_origin, profile_);
310 } 310 }
311 } 311 }
312 312
313 if (content_setting == CONTENT_SETTING_DEFAULT && 313 if (content_setting == CONTENT_SETTING_DEFAULT &&
314 PermissionDecisionAutoBlocker::GetForProfile(profile_) 314 PermissionDecisionAutoBlocker::GetForProfile(profile_)
315 ->RecordDismissAndEmbargo(requesting_origin, permission_type_)) { 315 ->RecordDismissAndEmbargo(requesting_origin, permission_type_)) {
316 // The permission has been embargoed, so it is blocked for this permission 316 // The permission has been embargoed, so it is blocked for this permission
317 // request, but not persisted. 317 // request, but not persisted.
318 content_setting = CONTENT_SETTING_BLOCK; 318 content_setting = CONTENT_SETTING_BLOCK;
319 } else {
320 // If a decision was made, and it did not exceed the number of allowable
321 // dismissals, then it cannot have been embargoed.
322 PermissionUmaUtil::RecordPermissionEmbargoReason(
323 PermissionEmbargoReason::NOT_EMBARGOED);
319 } 324 }
320 325
321 NotifyPermissionSet(id, requesting_origin, embedding_origin, callback, 326 NotifyPermissionSet(id, requesting_origin, embedding_origin, callback,
322 persist, content_setting); 327 persist, content_setting);
323 } 328 }
324 329
325 #if defined(OS_ANDROID) 330 #if defined(OS_ANDROID)
326 PermissionQueueController* PermissionContextBase::GetQueueController() { 331 PermissionQueueController* PermissionContextBase::GetQueueController() {
327 return permission_queue_controller_.get(); 332 return permission_queue_controller_.get();
328 } 333 }
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
367 DCHECK(content_setting == CONTENT_SETTING_ALLOW || 372 DCHECK(content_setting == CONTENT_SETTING_ALLOW ||
368 content_setting == CONTENT_SETTING_BLOCK); 373 content_setting == CONTENT_SETTING_BLOCK);
369 DCHECK(!requesting_origin.SchemeIsFile()); 374 DCHECK(!requesting_origin.SchemeIsFile());
370 DCHECK(!embedding_origin.SchemeIsFile()); 375 DCHECK(!embedding_origin.SchemeIsFile());
371 376
372 HostContentSettingsMapFactory::GetForProfile(profile_) 377 HostContentSettingsMapFactory::GetForProfile(profile_)
373 ->SetContentSettingDefaultScope(requesting_origin, embedding_origin, 378 ->SetContentSettingDefaultScope(requesting_origin, embedding_origin,
374 content_settings_type_, std::string(), 379 content_settings_type_, std::string(),
375 content_setting); 380 content_setting);
376 } 381 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698