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

Unified Diff: components/content_settings/core/browser/content_settings_binary_value_map.h

Issue 902833003: Add a HostContentSettingsMap layer for Supervised Users. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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 side-by-side diff with in-line comments
Download patch
Index: components/content_settings/core/browser/content_settings_binary_value_map.h
diff --git a/components/content_settings/core/browser/content_settings_binary_value_map.h b/components/content_settings/core/browser/content_settings_binary_value_map.h
new file mode 100644
index 0000000000000000000000000000000000000000..3416a13cd15a4232e05539974296046afb82cb0e
--- /dev/null
+++ b/components/content_settings/core/browser/content_settings_binary_value_map.h
@@ -0,0 +1,39 @@
+// Copyright (c) 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef COMPONENTS_CONTENT_SETTINGS_CORE_BROWSER_CONTENT_SETTINGS_BINARY_VALUE_MAP_H_
+#define COMPONENTS_CONTENT_SETTINGS_CORE_BROWSER_CONTENT_SETTINGS_BINARY_VALUE_MAP_H_
+
+#include "components/content_settings/core/browser/content_settings_provider.h"
+#include "components/content_settings/core/common/content_settings_types.h"
+
+namespace base {
+class AutoLock;
+} // namespace base
+
+namespace content_settings {
+
+class RuleIterator;
+
+// A simplified value map that can be used to disable or enable the entire
+// Content Setting. The default behaviour is enabling the Content Setting if
+// it is not set explicitly.
+class BinaryValueMap {
+ public:
+ BinaryValueMap();
+
+ RuleIterator* GetRuleIterator(ContentSettingsType content_type,
+ const ResourceIdentifier& resource_identifier,
+ scoped_ptr<base::AutoLock> lock) const;
+ void SetContentSettingDisabled(ContentSettingsType content_type,
+ bool disabled);
+ bool IsContentSettingEnabled(ContentSettingsType content_type) const;
+
+ private:
+ bool is_enabled_[CONTENT_SETTINGS_NUM_TYPES];
+};
+
+} // namespace content_settings
+
+#endif // COMPONENTS_CONTENT_SETTINGS_CORE_BROWSER_CONTENT_SETTINGS_BINARY_VALUE_MAP_H_

Powered by Google App Engine
This is Rietveld 408576698