Chromium Code Reviews| 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. |
|
lazyboy
2017/06/30 18:11:40
drive by:
Isn't CONTENT_SETTING_DEFAULT a valid co
tbansal1
2017/06/30 18:32:31
DEFAULT is encoded as a null value. In the functio
|
| +std::unique_ptr<base::Value> ContentSettingToValue(ContentSetting setting); |
| + |
| +} // namespace content_settings |
| + |
| +#endif // COMPONENTS_CONTENT_SETTINGS_CORE_COMMON_CONTENT_SETTINGS_UTILS_H_ |