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

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

Issue 2269863002: Turn on Permission Action Reporting by default. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: re-disable test Created 4 years, 4 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 | « no previous file | chrome/browser/permissions/permission_uma_util_unittest.cc » ('j') | 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 550 matching lines...) Expand 10 before | Expand all | Expand 10 after
561 case PermissionType::MIDI: 561 case PermissionType::MIDI:
562 case PermissionType::BACKGROUND_SYNC: 562 case PermissionType::BACKGROUND_SYNC:
563 case PermissionType::NUM: 563 case PermissionType::NUM:
564 NOTREACHED() << "PERMISSION " 564 NOTREACHED() << "PERMISSION "
565 << PermissionUtil::GetPermissionString(permission) 565 << PermissionUtil::GetPermissionString(permission)
566 << " not accounted for"; 566 << " not accounted for";
567 } 567 }
568 } 568 }
569 569
570 bool PermissionUmaUtil::IsOptedIntoPermissionActionReporting(Profile* profile) { 570 bool PermissionUmaUtil::IsOptedIntoPermissionActionReporting(Profile* profile) {
571 if (!base::CommandLine::ForCurrentProcess()->HasSwitch( 571 if (base::CommandLine::ForCurrentProcess()->HasSwitch(
572 switches::kEnablePermissionActionReporting)) 572 switches::kDisablePermissionActionReporting))
raymes 2016/08/23 08:18:35 nit: add {}
kcarattini 2016/08/24 03:23:36 Done.
573 return false; 573 return false;
574 574
575 DCHECK(profile); 575 DCHECK(profile);
576 if (profile->GetProfileType() == Profile::INCOGNITO_PROFILE) 576 if (profile->GetProfileType() == Profile::INCOGNITO_PROFILE)
577 return false; 577 return false;
578 if (!profile->GetPrefs()->GetBoolean(prefs::kSafeBrowsingEnabled)) 578 if (!profile->GetPrefs()->GetBoolean(prefs::kSafeBrowsingEnabled))
579 return false; 579 return false;
580 580
581 ProfileSyncService* profile_sync_service = 581 ProfileSyncService* profile_sync_service =
582 ProfileSyncServiceFactory::GetForProfile(profile); 582 ProfileSyncServiceFactory::GetForProfile(profile);
(...skipping 112 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 | « no previous file | chrome/browser/permissions/permission_uma_util_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698