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

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

Issue 2250053002: Clean up the PermissionInfoBarDelegate hierarchy. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@permission-infobar-remember-decision
Patch Set: 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
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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 46
47 // Limited conversion of ContentSettingsType to PermissionType. Intended for 47 // Limited conversion of ContentSettingsType to PermissionType. Intended for
48 // recording Permission UMA metrics from areas of the codebase which have not 48 // recording Permission UMA metrics from areas of the codebase which have not
49 // yet been converted to PermissionType. Returns true if the conversion was 49 // yet been converted to PermissionType. Returns true if the conversion was
50 // performed. 50 // performed.
51 // TODO(tsergeant): Remove this function once callsites operate on 51 // TODO(tsergeant): Remove this function once callsites operate on
52 // PermissionType directly. 52 // PermissionType directly.
53 static bool GetPermissionType(ContentSettingsType type, 53 static bool GetPermissionType(ContentSettingsType type,
54 content::PermissionType* out); 54 content::PermissionType* out);
55 55
56 static bool ShouldShowPersistenceToggle();
57
56 // A scoped class that will check the current resolved content setting on 58 // A scoped class that will check the current resolved content setting on
57 // construction and report a revocation metric accordingly if the revocation 59 // construction and report a revocation metric accordingly if the revocation
58 // condition is met (from ALLOW to something else). 60 // condition is met (from ALLOW to something else).
59 class ScopedRevocationReporter { 61 class ScopedRevocationReporter {
60 public: 62 public:
61 ScopedRevocationReporter(Profile* profile, 63 ScopedRevocationReporter(Profile* profile,
62 const GURL& primary_url, 64 const GURL& primary_url,
63 const GURL& secondary_url, 65 const GURL& secondary_url,
64 ContentSettingsType content_type, 66 ContentSettingsType content_type,
65 PermissionSourceUI source_ui); 67 PermissionSourceUI source_ui);
(...skipping 13 matching lines...) Expand all
79 ContentSettingsType content_type_; 81 ContentSettingsType content_type_;
80 PermissionSourceUI source_ui_; 82 PermissionSourceUI source_ui_;
81 bool is_initially_allowed_; 83 bool is_initially_allowed_;
82 }; 84 };
83 85
84 private: 86 private:
85 DISALLOW_IMPLICIT_CONSTRUCTORS(PermissionUtil); 87 DISALLOW_IMPLICIT_CONSTRUCTORS(PermissionUtil);
86 }; 88 };
87 89
88 #endif // CHROME_BROWSER_PERMISSIONS_PERMISSION_UTIL_H_ 90 #endif // CHROME_BROWSER_PERMISSIONS_PERMISSION_UTIL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698