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

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

Issue 2178213003: Update RequestTrigger to GestureType in permission report (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Resolve nits 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/safe_browsing/permission_reporter.h » ('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 371 matching lines...) Expand 10 before | Expand all | Expand 10 after
382 PermissionSourceUI source_ui, 382 PermissionSourceUI source_ui,
383 const GURL& requesting_origin, 383 const GURL& requesting_origin,
384 Profile* profile) { 384 Profile* profile) {
385 if (IsOptedIntoPermissionActionReporting(profile)) { 385 if (IsOptedIntoPermissionActionReporting(profile)) {
386 // TODO(stefanocs): Add browsertests to make sure the reports are being 386 // TODO(stefanocs): Add browsertests to make sure the reports are being
387 // sent. 387 // sent.
388 // TODO(stefanocs): Get the actual |user_gesture| from permission layer. 388 // TODO(stefanocs): Get the actual |user_gesture| from permission layer.
389 g_browser_process->safe_browsing_service() 389 g_browser_process->safe_browsing_service()
390 ->ui_manager() 390 ->ui_manager()
391 ->ReportPermissionAction(requesting_origin, permission, action, 391 ->ReportPermissionAction(requesting_origin, permission, action,
392 source_ui, false /* user_gesture */); 392 source_ui,
393 PermissionRequestGestureType::UNKNOWN);
393 } 394 }
394 395
395 bool secure_origin = content::IsOriginSecure(requesting_origin); 396 bool secure_origin = content::IsOriginSecure(requesting_origin);
396 397
397 switch (permission) { 398 switch (permission) {
398 case PermissionType::GEOLOCATION: 399 case PermissionType::GEOLOCATION:
399 PERMISSION_ACTION_UMA(secure_origin, "Permissions.Action.Geolocation", 400 PERMISSION_ACTION_UMA(secure_origin, "Permissions.Action.Geolocation",
400 "Permissions.Action.SecureOrigin.Geolocation", 401 "Permissions.Action.SecureOrigin.Geolocation",
401 "Permissions.Action.InsecureOrigin.Geolocation", 402 "Permissions.Action.InsecureOrigin.Geolocation",
402 action); 403 action);
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
462 if (!deprecated_metric.empty() && rappor_service) { 463 if (!deprecated_metric.empty() && rappor_service) {
463 rappor::SampleDomainAndRegistryFromGURL(rappor_service, deprecated_metric, 464 rappor::SampleDomainAndRegistryFromGURL(rappor_service, deprecated_metric,
464 requesting_origin); 465 requesting_origin);
465 466
466 std::string rappor_metric = deprecated_metric + "2"; 467 std::string rappor_metric = deprecated_metric + "2";
467 rappor_service->RecordSample( 468 rappor_service->RecordSample(
468 rappor_metric, rappor::LOW_FREQUENCY_ETLD_PLUS_ONE_RAPPOR_TYPE, 469 rappor_metric, rappor::LOW_FREQUENCY_ETLD_PLUS_ONE_RAPPOR_TYPE,
469 rappor::GetDomainAndRegistrySampleFromGURL(requesting_origin)); 470 rappor::GetDomainAndRegistrySampleFromGURL(requesting_origin));
470 } 471 }
471 } 472 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/safe_browsing/permission_reporter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698