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

Unified Diff: components/content_settings/core/common/content_settings_utils.h

Issue 2938163002: Store base::Value in ContentSettingPatternSource instead of an enum (Closed)
Patch Set: rebased Created 3 years, 6 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/common/content_settings_utils.h
diff --git a/components/content_settings/core/common/content_settings_utils.h b/components/content_settings/core/common/content_settings_utils.h
new file mode 100644
index 0000000000000000000000000000000000000000..640483d9338f6c3e90394a84ee3d99b8ca531332
--- /dev/null
+++ b/components/content_settings/core/common/content_settings_utils.h
@@ -0,0 +1,27 @@
+// Copyright 2017 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_COMMON_CONTENT_SETTINGS_UTILS_H_
+#define COMPONENTS_CONTENT_SETTINGS_CORE_COMMON_CONTENT_SETTINGS_UTILS_H_
+
+#include <memory>
+
+#include "components/content_settings/core/common/content_settings.h"
+
+namespace base {
+class Value;
+}
+
+namespace content_settings {
+
+// Converts |value| to |ContentSetting|.
+ContentSetting ValueToContentSetting(const base::Value* value);
+
+// Returns a base::Value representation of |setting| if |setting| is
+// a valid content setting. Otherwise, returns a nullptr.
+std::unique_ptr<base::Value> ContentSettingToValue(ContentSetting setting);
+
+} // namespace content_settings
+
+#endif // COMPONENTS_CONTENT_SETTINGS_CORE_COMMON_CONTENT_SETTINGS_UTILS_H_

Powered by Google App Engine
This is Rietveld 408576698