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

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

Issue 2386193004: Make all PermissionDecisionAutoBlocker methods static. (Closed)
Patch Set: Address comments Created 4 years, 2 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
« no previous file with comments | « chrome/browser/permissions/permission_request_impl.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_uma_util.h" 5 #include "chrome/browser/permissions/permission_uma_util.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/metrics/histogram_macros.h" 10 #include "base/metrics/histogram_macros.h"
(...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after
324 PermissionDecisionAutoBlocker::GetDismissCount(requesting_origin, 324 PermissionDecisionAutoBlocker::GetDismissCount(requesting_origin,
325 permission, profile)); 325 permission, profile));
326 RecordPermissionPromptPriorCount( 326 RecordPermissionPromptPriorCount(
327 permission, kPermissionsPromptIgnoredPriorIgnoreCountPrefix, 327 permission, kPermissionsPromptIgnoredPriorIgnoreCountPrefix,
328 PermissionDecisionAutoBlocker::GetIgnoreCount(requesting_origin, 328 PermissionDecisionAutoBlocker::GetIgnoreCount(requesting_origin,
329 permission, profile)); 329 permission, profile));
330 330
331 // RecordPermission* methods need to be called before RecordIgnore in the 331 // RecordPermission* methods need to be called before RecordIgnore in the
332 // blocker because they record the number of prior ignore and dismiss values, 332 // blocker because they record the number of prior ignore and dismiss values,
333 // and we don't want to include the current ignore. 333 // and we don't want to include the current ignore.
334 PermissionDecisionAutoBlocker(profile).RecordIgnore(requesting_origin, 334 PermissionDecisionAutoBlocker::RecordIgnore(requesting_origin, permission,
335 permission); 335 profile);
336 } 336 }
337 337
338 void PermissionUmaUtil::PermissionRevoked(PermissionType permission, 338 void PermissionUmaUtil::PermissionRevoked(PermissionType permission,
339 PermissionSourceUI source_ui, 339 PermissionSourceUI source_ui,
340 const GURL& revoked_origin, 340 const GURL& revoked_origin,
341 Profile* profile) { 341 Profile* profile) {
342 // TODO(tsergeant): Expand metrics definitions for revocation to include all 342 // TODO(tsergeant): Expand metrics definitions for revocation to include all
343 // permissions. 343 // permissions.
344 if (permission == PermissionType::NOTIFICATIONS || 344 if (permission == PermissionType::NOTIFICATIONS ||
345 permission == PermissionType::GEOLOCATION || 345 permission == PermissionType::GEOLOCATION ||
(...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after
695 if (!deprecated_metric.empty() && rappor_service) { 695 if (!deprecated_metric.empty() && rappor_service) {
696 rappor::SampleDomainAndRegistryFromGURL(rappor_service, deprecated_metric, 696 rappor::SampleDomainAndRegistryFromGURL(rappor_service, deprecated_metric,
697 requesting_origin); 697 requesting_origin);
698 698
699 std::string rappor_metric = deprecated_metric + "2"; 699 std::string rappor_metric = deprecated_metric + "2";
700 rappor_service->RecordSample( 700 rappor_service->RecordSample(
701 rappor_metric, rappor::LOW_FREQUENCY_ETLD_PLUS_ONE_RAPPOR_TYPE, 701 rappor_metric, rappor::LOW_FREQUENCY_ETLD_PLUS_ONE_RAPPOR_TYPE,
702 rappor::GetDomainAndRegistrySampleFromGURL(requesting_origin)); 702 rappor::GetDomainAndRegistrySampleFromGURL(requesting_origin));
703 } 703 }
704 } 704 }
OLDNEW
« no previous file with comments | « chrome/browser/permissions/permission_request_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698