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

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

Issue 2153763002: Add user gesture field to permission report (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@add-source-ui-to-permission-report
Patch Set: Add user gesture mark Created 4 years, 5 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_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 321 matching lines...) Expand 10 before | Expand all | Expand 10 after
332 } 332 }
333 333
334 void PermissionUmaUtil::RecordPermissionAction(PermissionType permission, 334 void PermissionUmaUtil::RecordPermissionAction(PermissionType permission,
335 PermissionAction action, 335 PermissionAction action,
336 PermissionSourceUI source_ui, 336 PermissionSourceUI source_ui,
337 const GURL& requesting_origin, 337 const GURL& requesting_origin,
338 Profile* profile) { 338 Profile* profile) {
339 if (IsOptedIntoPermissionActionReporting(profile)) { 339 if (IsOptedIntoPermissionActionReporting(profile)) {
340 // TODO(stefanocs): Add browsertests to make sure the reports are being 340 // TODO(stefanocs): Add browsertests to make sure the reports are being
341 // sent. 341 // sent.
342 // TODO(stefanocs): Get the actual |user_gesture| from permission layer.
342 g_browser_process->safe_browsing_service() 343 g_browser_process->safe_browsing_service()
343 ->ui_manager() 344 ->ui_manager()
344 ->ReportPermissionAction(requesting_origin, permission, action, 345 ->ReportPermissionAction(requesting_origin, permission, action,
345 source_ui); 346 source_ui, false /* user_gesture */);
346 } 347 }
347 348
348 bool secure_origin = content::IsOriginSecure(requesting_origin); 349 bool secure_origin = content::IsOriginSecure(requesting_origin);
349 350
350 switch (permission) { 351 switch (permission) {
351 case PermissionType::GEOLOCATION: 352 case PermissionType::GEOLOCATION:
352 PERMISSION_ACTION_UMA(secure_origin, "Permissions.Action.Geolocation", 353 PERMISSION_ACTION_UMA(secure_origin, "Permissions.Action.Geolocation",
353 "Permissions.Action.SecureOrigin.Geolocation", 354 "Permissions.Action.SecureOrigin.Geolocation",
354 "Permissions.Action.InsecureOrigin.Geolocation", 355 "Permissions.Action.InsecureOrigin.Geolocation",
355 action); 356 action);
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
415 if (!deprecated_metric.empty() && rappor_service) { 416 if (!deprecated_metric.empty() && rappor_service) {
416 rappor::SampleDomainAndRegistryFromGURL(rappor_service, deprecated_metric, 417 rappor::SampleDomainAndRegistryFromGURL(rappor_service, deprecated_metric,
417 requesting_origin); 418 requesting_origin);
418 419
419 std::string rappor_metric = deprecated_metric + "2"; 420 std::string rappor_metric = deprecated_metric + "2";
420 rappor_service->RecordSample( 421 rappor_service->RecordSample(
421 rappor_metric, rappor::LOW_FREQUENCY_ETLD_PLUS_ONE_RAPPOR_TYPE, 422 rappor_metric, rappor::LOW_FREQUENCY_ETLD_PLUS_ONE_RAPPOR_TYPE,
422 rappor::GetDomainAndRegistrySampleFromGURL(requesting_origin)); 423 rappor::GetDomainAndRegistrySampleFromGURL(requesting_origin));
423 } 424 }
424 } 425 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/safe_browsing/permission_reporter.h » ('j') | chrome/browser/safe_browsing/permission_reporter.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698