Commit df9d9475 authored by msramek's avatar msramek Committed by Commit bot

Default Provider style fixes.

Addressing comments from CL 1004733003.

Review URL: https://codereview.chromium.org/1038203003

Cr-Commit-Position: refs/heads/master@{#324403}
parent d1f5e1f8
......@@ -169,6 +169,14 @@ bool ParseContentSettingValue(const base::Value* value,
return *setting != CONTENT_SETTING_DEFAULT;
}
scoped_ptr<base::Value> ContentSettingToValue(ContentSetting setting) {
if (setting <= CONTENT_SETTING_DEFAULT ||
setting >= CONTENT_SETTING_NUM_SETTINGS) {
return nullptr;
}
return make_scoped_ptr(new base::FundamentalValue(setting));
}
base::Value* GetContentSettingValueAndPatterns(
const ProviderInterface* provider,
const GURL& primary_url,
......
......@@ -9,6 +9,7 @@
#include <utility>
#include "base/compiler_specific.h"
#include "base/memory/scoped_ptr.h"
#include "components/content_settings/core/common/content_settings.h"
#include "components/content_settings/core/common/content_settings_pattern.h"
#include "components/content_settings/core/common/content_settings_types.h"
......@@ -59,6 +60,10 @@ base::Value* GetContentSettingValueAndPatterns(
ContentSettingsPattern* primary_pattern,
ContentSettingsPattern* secondary_pattern);
// Returns a |base::Value*| representation of |setting| if |setting| is
// a valid content setting. Otherwise, returns a nullptr.
scoped_ptr<base::Value> ContentSettingToValue(ContentSetting setting);
base::Value* GetContentSettingValueAndPatterns(
const ProviderInterface* provider,
const GURL& primary_url,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment