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

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

Issue 2628883008: Add a supervised user setting to allow all cookies. (Closed)
Patch Set: . Created 3 years, 11 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.cc
diff --git a/components/content_settings/core/browser/content_settings_binary_value_map.cc b/components/content_settings/core/browser/content_settings_binary_value_map.cc
deleted file mode 100644
index ddfb7326c125a2964700eac88e287fdc7efb642a..0000000000000000000000000000000000000000
--- a/components/content_settings/core/browser/content_settings_binary_value_map.cc
+++ /dev/null
@@ -1,64 +0,0 @@
-// 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.
-
-#include "components/content_settings/core/browser/content_settings_binary_value_map.h"
-
-#include <utility>
-
-#include "base/synchronization/lock.h"
-#include "components/content_settings/core/browser/content_settings_rule.h"
-#include "components/content_settings/core/common/content_settings.h"
-
-namespace content_settings {
-
-namespace {
-
-class RuleIteratorBinary : public RuleIterator {
- public:
- RuleIteratorBinary(bool is_enabled, std::unique_ptr<base::AutoLock> auto_lock)
- : is_done_(is_enabled), auto_lock_(std::move(auto_lock)) {}
-
- bool HasNext() const override { return !is_done_; }
-
- Rule Next() override {
- DCHECK(HasNext());
- is_done_ = true;
- return Rule(ContentSettingsPattern::Wildcard(),
- ContentSettingsPattern::Wildcard(),
- new base::FundamentalValue(CONTENT_SETTING_BLOCK));
- }
-
- private:
- bool is_done_;
- std::unique_ptr<base::AutoLock> auto_lock_;
-};
-
-} // namespace
-
-BinaryValueMap::BinaryValueMap() {}
-
-BinaryValueMap::~BinaryValueMap() {}
-
-std::unique_ptr<RuleIterator> BinaryValueMap::GetRuleIterator(
- ContentSettingsType content_type,
- const ResourceIdentifier& resource_identifier,
- std::unique_ptr<base::AutoLock> auto_lock) const {
- if (!resource_identifier.empty())
- return nullptr;
- return std::unique_ptr<RuleIterator>(new RuleIteratorBinary(
- IsContentSettingEnabled(content_type), std::move(auto_lock)));
-}
-
-void BinaryValueMap::SetContentSettingDisabled(ContentSettingsType content_type,
- bool is_disabled) {
- is_enabled_[content_type] = !is_disabled;
-}
-
-bool BinaryValueMap::IsContentSettingEnabled(
- ContentSettingsType content_type) const {
- auto it = is_enabled_.find(content_type);
- return it == is_enabled_.end() || it->second;
-}
-
-} // namespace content_settings

Powered by Google App Engine
This is Rietveld 408576698