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

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

Issue 2909453002: Support persist toggle in PermissionRequestManager path on Android (Closed)
Patch Set: rebase Created 3 years, 6 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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 // to remove the usage in PermissionUmaUtil, which uses PermissionType as a 59 // to remove the usage in PermissionUmaUtil, which uses PermissionType as a
60 // histogram value to count permission request metrics. 60 // histogram value to count permission request metrics.
61 static bool GetPermissionType(ContentSettingsType type, 61 static bool GetPermissionType(ContentSettingsType type,
62 content::PermissionType* out); 62 content::PermissionType* out);
63 63
64 // Checks whether the given ContentSettingsType is a permission. Use this 64 // Checks whether the given ContentSettingsType is a permission. Use this
65 // to determine whether a specific ContentSettingsType is supported by the 65 // to determine whether a specific ContentSettingsType is supported by the
66 // PermissionManager. 66 // PermissionManager.
67 static bool IsPermission(ContentSettingsType type); 67 static bool IsPermission(ContentSettingsType type);
68 68
69 static bool ShouldShowPersistenceToggle(); 69 static bool ShouldShowPersistenceToggle(ContentSettingsType type);
70 70
71 // A scoped class that will check the current resolved content setting on 71 // A scoped class that will check the current resolved content setting on
72 // construction and report a revocation metric accordingly if the revocation 72 // construction and report a revocation metric accordingly if the revocation
73 // condition is met (from ALLOW to something else). 73 // condition is met (from ALLOW to something else).
74 class ScopedRevocationReporter { 74 class ScopedRevocationReporter {
75 public: 75 public:
76 ScopedRevocationReporter(Profile* profile, 76 ScopedRevocationReporter(Profile* profile,
77 const GURL& primary_url, 77 const GURL& primary_url,
78 const GURL& secondary_url, 78 const GURL& secondary_url,
79 ContentSettingsType content_type, 79 ContentSettingsType content_type,
(...skipping 14 matching lines...) Expand all
94 ContentSettingsType content_type_; 94 ContentSettingsType content_type_;
95 PermissionSourceUI source_ui_; 95 PermissionSourceUI source_ui_;
96 bool is_initially_allowed_; 96 bool is_initially_allowed_;
97 }; 97 };
98 98
99 private: 99 private:
100 DISALLOW_IMPLICIT_CONSTRUCTORS(PermissionUtil); 100 DISALLOW_IMPLICIT_CONSTRUCTORS(PermissionUtil);
101 }; 101 };
102 102
103 #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_request_impl.cc ('k') | chrome/browser/permissions/permission_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698