OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "components/content_settings/core/browser/content_settings_utils.h" | 5 #include "components/content_settings/core/browser/content_settings_utils.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <memory> | 9 #include <memory> |
10 #include <vector> | 10 #include <vector> |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 return false; | 121 return false; |
122 *setting = IntToContentSetting(int_value); | 122 *setting = IntToContentSetting(int_value); |
123 return *setting != CONTENT_SETTING_DEFAULT; | 123 return *setting != CONTENT_SETTING_DEFAULT; |
124 } | 124 } |
125 | 125 |
126 std::unique_ptr<base::Value> ContentSettingToValue(ContentSetting setting) { | 126 std::unique_ptr<base::Value> ContentSettingToValue(ContentSetting setting) { |
127 if (setting <= CONTENT_SETTING_DEFAULT || | 127 if (setting <= CONTENT_SETTING_DEFAULT || |
128 setting >= CONTENT_SETTING_NUM_SETTINGS) { | 128 setting >= CONTENT_SETTING_NUM_SETTINGS) { |
129 return nullptr; | 129 return nullptr; |
130 } | 130 } |
131 return base::WrapUnique(new base::FundamentalValue(setting)); | 131 return base::MakeUnique<base::FundamentalValue>(setting); |
132 } | 132 } |
133 | 133 |
134 void GetRendererContentSettingRules(const HostContentSettingsMap* map, | 134 void GetRendererContentSettingRules(const HostContentSettingsMap* map, |
135 RendererContentSettingRules* rules) { | 135 RendererContentSettingRules* rules) { |
136 #if !defined(OS_ANDROID) | 136 #if !defined(OS_ANDROID) |
137 map->GetSettingsForOneType( | 137 map->GetSettingsForOneType( |
138 CONTENT_SETTINGS_TYPE_IMAGES, | 138 CONTENT_SETTINGS_TYPE_IMAGES, |
139 ResourceIdentifier(), | 139 ResourceIdentifier(), |
140 &(rules->image_rules)); | 140 &(rules->image_rules)); |
141 #else | 141 #else |
(...skipping 10 matching lines...) Expand all Loading... |
152 CONTENT_SETTINGS_TYPE_JAVASCRIPT, | 152 CONTENT_SETTINGS_TYPE_JAVASCRIPT, |
153 ResourceIdentifier(), | 153 ResourceIdentifier(), |
154 &(rules->script_rules)); | 154 &(rules->script_rules)); |
155 map->GetSettingsForOneType( | 155 map->GetSettingsForOneType( |
156 CONTENT_SETTINGS_TYPE_AUTOPLAY, | 156 CONTENT_SETTINGS_TYPE_AUTOPLAY, |
157 ResourceIdentifier(), | 157 ResourceIdentifier(), |
158 &(rules->autoplay_rules)); | 158 &(rules->autoplay_rules)); |
159 } | 159 } |
160 | 160 |
161 } // namespace content_settings | 161 } // namespace content_settings |
OLD | NEW |