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

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

Issue 2714603002: Make PermissionManager use ContentSettingsType internally more (Closed)
Patch Set: address comments 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 22 matching lines...) Expand all
33 33
34 // Always keep this at the end. 34 // Always keep this at the end.
35 PERMISSION_ACTION_NUM, 35 PERMISSION_ACTION_NUM,
36 }; 36 };
37 37
38 // A utility class for permissions. 38 // A utility class for permissions.
39 class PermissionUtil { 39 class PermissionUtil {
40 public: 40 public:
41 // Returns the permission string for the given permission. 41 // Returns the permission string for the given permission.
42 static std::string GetPermissionString(ContentSettingsType); 42 static std::string GetPermissionString(ContentSettingsType);
43 // TODO(timloh): Remove this content::PermissionType overload when we add MIDI
44 // to ContentSettingsType.
45 static std::string GetPermissionString(content::PermissionType);
46 43
47 // Return the stringified version of the ContentSettingsType enum that 44 // Return the stringified version of the ContentSettingsType enum that
48 // Safe Browsing uses for the API Blacklist. 45 // Safe Browsing uses for the API Blacklist.
49 static std::string ConvertContentSettingsTypeToSafeBrowsingName( 46 static std::string ConvertContentSettingsTypeToSafeBrowsingName(
50 ContentSettingsType permission); 47 ContentSettingsType permission);
51 48
52 // Returns the request type corresponding to a permission type. 49 // Returns the request type corresponding to a permission type.
53 static PermissionRequestType GetRequestType(ContentSettingsType permission); 50 static PermissionRequestType GetRequestType(ContentSettingsType permission);
54 51
55 // Returns the gesture type corresponding to whether a permission request is 52 // Returns the gesture type corresponding to whether a permission request is
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 ContentSettingsType content_type_; 89 ContentSettingsType content_type_;
93 PermissionSourceUI source_ui_; 90 PermissionSourceUI source_ui_;
94 bool is_initially_allowed_; 91 bool is_initially_allowed_;
95 }; 92 };
96 93
97 private: 94 private:
98 DISALLOW_IMPLICIT_CONSTRUCTORS(PermissionUtil); 95 DISALLOW_IMPLICIT_CONSTRUCTORS(PermissionUtil);
99 }; 96 };
100 97
101 #endif // CHROME_BROWSER_PERMISSIONS_PERMISSION_UTIL_H_ 98 #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