summaryrefslogtreecommitdiffstats
path: root/chrome/browser/permissions/permission_uma_util.h
blob: 254f3c1b447e0ed830a89fe2cbd38fd0f30be493 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef CHROME_BROWSER_PERMISSIONS_PERMISSION_UMA_UTIL_H_
#define CHROME_BROWSER_PERMISSIONS_PERMISSION_UMA_UTIL_H_

#include "base/logging.h"
#include "base/macros.h"

class GURL;
class Profile;

namespace content {
enum class PermissionType;
}  // namespace content

// Provides a convenient way of logging UMA for permission related operations.
class PermissionUmaUtil {
 public:
  static void PermissionRequested(content::PermissionType permission,
                                  const GURL& requesting_origin,
                                  const GURL& embedding_origin,
                                  Profile* profile);
  static void PermissionGranted(content::PermissionType permission,
                                const GURL& requesting_origin);
  static void PermissionDenied(content::PermissionType permission,
                               const GURL& requesting_origin);
  static void PermissionDismissed(content::PermissionType permission,
                                  const GURL& requesting_origin);
  static void PermissionIgnored(content::PermissionType permission,
                                const GURL& requesting_origin);

 private:
  DISALLOW_IMPLICIT_CONSTRUCTORS(PermissionUmaUtil);
};

#endif  // CHROME_BROWSER_PERMISSIONS_PERMISSION_UMA_UTIL_H_