OLD | NEW |
| (Empty) |
1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef COMPONENTS_CONTENT_SETTINGS_CORE_BROWSER_CONTENT_SETTINGS_BINARY_VALUE_M
AP_H_ | |
6 #define COMPONENTS_CONTENT_SETTINGS_CORE_BROWSER_CONTENT_SETTINGS_BINARY_VALUE_M
AP_H_ | |
7 | |
8 #include <map> | |
9 | |
10 #include "components/content_settings/core/browser/content_settings_provider.h" | |
11 #include "components/content_settings/core/common/content_settings_types.h" | |
12 | |
13 namespace base { | |
14 class AutoLock; | |
15 } // namespace base | |
16 | |
17 namespace content_settings { | |
18 | |
19 class RuleIterator; | |
20 | |
21 // A simplified value map that can be used to disable or enable the entire | |
22 // Content Setting. The default behaviour is enabling the Content Setting if | |
23 // it is not set explicitly. | |
24 class BinaryValueMap { | |
25 public: | |
26 BinaryValueMap(); | |
27 ~BinaryValueMap(); | |
28 | |
29 // Returns nullptr to indicate the RuleIterator is empty. | |
30 std::unique_ptr<RuleIterator> GetRuleIterator( | |
31 ContentSettingsType content_type, | |
32 const ResourceIdentifier& resource_identifier, | |
33 std::unique_ptr<base::AutoLock> lock) const; | |
34 void SetContentSettingDisabled(ContentSettingsType content_type, | |
35 bool disabled); | |
36 bool IsContentSettingEnabled(ContentSettingsType content_type) const; | |
37 | |
38 private: | |
39 std::map<ContentSettingsType, bool> is_enabled_; | |
40 }; | |
41 | |
42 } // namespace content_settings | |
43 | |
44 #endif // COMPONENTS_CONTENT_SETTINGS_CORE_BROWSER_CONTENT_SETTINGS_BINARY_VALU
E_MAP_H_ | |
OLD | NEW |