| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 EXTENSIONS_COMMON_PERMISSIONS_PERMISSION_SET_H_ | 5 #ifndef EXTENSIONS_COMMON_PERMISSIONS_PERMISSION_SET_H_ |
| 6 #define EXTENSIONS_COMMON_PERMISSIONS_PERMISSION_SET_H_ | 6 #define EXTENSIONS_COMMON_PERMISSIONS_PERMISSION_SET_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 } | 115 } |
| 116 | 116 |
| 117 const URLPatternSet& effective_hosts() const { return effective_hosts_; } | 117 const URLPatternSet& effective_hosts() const { return effective_hosts_; } |
| 118 | 118 |
| 119 const URLPatternSet& explicit_hosts() const { return explicit_hosts_; } | 119 const URLPatternSet& explicit_hosts() const { return explicit_hosts_; } |
| 120 | 120 |
| 121 const URLPatternSet& scriptable_hosts() const { return scriptable_hosts_; } | 121 const URLPatternSet& scriptable_hosts() const { return scriptable_hosts_; } |
| 122 | 122 |
| 123 private: | 123 private: |
| 124 FRIEND_TEST_ALL_PREFIXES(PermissionsTest, GetWarningMessages_AudioVideo); | 124 FRIEND_TEST_ALL_PREFIXES(PermissionsTest, GetWarningMessages_AudioVideo); |
| 125 FRIEND_TEST_ALL_PREFIXES(PermissionsTest, AccessToDevicesMessages); |
| 125 friend class base::RefCountedThreadSafe<PermissionSet>; | 126 friend class base::RefCountedThreadSafe<PermissionSet>; |
| 126 | 127 |
| 127 ~PermissionSet(); | 128 ~PermissionSet(); |
| 128 | 129 |
| 129 // Adds permissions implied independently of other context. | 130 // Adds permissions implied independently of other context. |
| 130 void InitImplicitPermissions(); | 131 void InitImplicitPermissions(); |
| 131 | 132 |
| 132 // Initializes the effective host permission based on the data in this set. | 133 // Initializes the effective host permission based on the data in this set. |
| 133 void InitEffectiveHosts(); | 134 void InitEffectiveHosts(); |
| 134 | 135 |
| (...skipping 26 matching lines...) Expand all Loading... |
| 161 }; | 162 }; |
| 162 // Whether or not this permission set includes access to so many origins, we | 163 // Whether or not this permission set includes access to so many origins, we |
| 163 // should treat it as all_hosts for warning purposes. | 164 // should treat it as all_hosts for warning purposes. |
| 164 // Lazily initialized (and therefore mutable). | 165 // Lazily initialized (and therefore mutable). |
| 165 mutable ShouldWarnAllHostsType should_warn_all_hosts_; | 166 mutable ShouldWarnAllHostsType should_warn_all_hosts_; |
| 166 }; | 167 }; |
| 167 | 168 |
| 168 } // namespace extensions | 169 } // namespace extensions |
| 169 | 170 |
| 170 #endif // EXTENSIONS_COMMON_PERMISSIONS_PERMISSION_SET_H_ | 171 #endif // EXTENSIONS_COMMON_PERMISSIONS_PERMISSION_SET_H_ |
| OLD | NEW |