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

Side by Side Diff: chrome/browser/permissions/permission_util.h

Issue 2640033006: Convert AutoBlocker static class to KeyedService. (Closed)
Patch Set: Git surgery. Created 3 years, 10 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 #ifndef CHROME_BROWSER_PERMISSIONS_PERMISSION_UTIL_H_ 5 #ifndef CHROME_BROWSER_PERMISSIONS_PERMISSION_UTIL_H_
6 #define CHROME_BROWSER_PERMISSIONS_PERMISSION_UTIL_H_ 6 #define CHROME_BROWSER_PERMISSIONS_PERMISSION_UTIL_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 27 matching lines...) Expand all
38 struct PermissionTypeHash { 38 struct PermissionTypeHash {
39 std::size_t operator()(const content::PermissionType& type) const; 39 std::size_t operator()(const content::PermissionType& type) const;
40 }; 40 };
41 41
42 // A utility class for permissions. 42 // A utility class for permissions.
43 class PermissionUtil { 43 class PermissionUtil {
44 public: 44 public:
45 // Returns the permission string for the given PermissionType. 45 // Returns the permission string for the given PermissionType.
46 static std::string GetPermissionString(content::PermissionType permission); 46 static std::string GetPermissionString(content::PermissionType permission);
47 47
48 // Return the stringified version of the PermissionType enum that Safe
49 // Browsing uses for the API Blacklist.
50 static std::string ConvertPermissionTypeToSafeBrowsingName(
51 const content::PermissionType& permission_type);
52
48 // Returns the request type corresponding to a permission type. 53 // Returns the request type corresponding to a permission type.
49 static PermissionRequestType GetRequestType(content::PermissionType type); 54 static PermissionRequestType GetRequestType(content::PermissionType type);
50 55
51 // Returns the gesture type corresponding to whether a permission request is 56 // Returns the gesture type corresponding to whether a permission request is
52 // made with or without a user gesture. 57 // made with or without a user gesture.
53 static PermissionRequestGestureType GetGestureType(bool user_gesture); 58 static PermissionRequestGestureType GetGestureType(bool user_gesture);
54 59
55 // Limited conversion of ContentSettingsType to PermissionType. Intended for 60 // Limited conversion of ContentSettingsType to PermissionType. Intended for
56 // recording Permission UMA metrics from areas of the codebase which have not 61 // recording Permission UMA metrics from areas of the codebase which have not
57 // yet been converted to PermissionType. Returns true if the conversion was 62 // yet been converted to PermissionType. Returns true if the conversion was
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 ContentSettingsType content_type_; 94 ContentSettingsType content_type_;
90 PermissionSourceUI source_ui_; 95 PermissionSourceUI source_ui_;
91 bool is_initially_allowed_; 96 bool is_initially_allowed_;
92 }; 97 };
93 98
94 private: 99 private:
95 DISALLOW_IMPLICIT_CONSTRUCTORS(PermissionUtil); 100 DISALLOW_IMPLICIT_CONSTRUCTORS(PermissionUtil);
96 }; 101 };
97 102
98 #endif // CHROME_BROWSER_PERMISSIONS_PERMISSION_UTIL_H_ 103 #endif // CHROME_BROWSER_PERMISSIONS_PERMISSION_UTIL_H_
OLDNEW
« no previous file with comments | « chrome/browser/permissions/permission_uma_util.cc ('k') | chrome/browser/permissions/permission_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698