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 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 return false; | 138 return false; |
139 *setting = IntToContentSetting(int_value); | 139 *setting = IntToContentSetting(int_value); |
140 return *setting != CONTENT_SETTING_DEFAULT; | 140 return *setting != CONTENT_SETTING_DEFAULT; |
141 } | 141 } |
142 | 142 |
143 std::unique_ptr<base::Value> ContentSettingToValue(ContentSetting setting) { | 143 std::unique_ptr<base::Value> ContentSettingToValue(ContentSetting setting) { |
144 if (setting <= CONTENT_SETTING_DEFAULT || | 144 if (setting <= CONTENT_SETTING_DEFAULT || |
145 setting >= CONTENT_SETTING_NUM_SETTINGS) { | 145 setting >= CONTENT_SETTING_NUM_SETTINGS) { |
146 return nullptr; | 146 return nullptr; |
147 } | 147 } |
148 return base::MakeUnique<base::FundamentalValue>(setting); | 148 return base::MakeUnique<base::Value>(setting); |
149 } | 149 } |
150 | 150 |
151 void GetRendererContentSettingRules(const HostContentSettingsMap* map, | 151 void GetRendererContentSettingRules(const HostContentSettingsMap* map, |
152 RendererContentSettingRules* rules) { | 152 RendererContentSettingRules* rules) { |
153 #if !defined(OS_ANDROID) | 153 #if !defined(OS_ANDROID) |
154 map->GetSettingsForOneType( | 154 map->GetSettingsForOneType( |
155 CONTENT_SETTINGS_TYPE_IMAGES, | 155 CONTENT_SETTINGS_TYPE_IMAGES, |
156 ResourceIdentifier(), | 156 ResourceIdentifier(), |
157 &(rules->image_rules)); | 157 &(rules->image_rules)); |
158 #else | 158 #else |
(...skipping 23 matching lines...) Expand all Loading... |
182 if (setting == b) | 182 if (setting == b) |
183 return false; | 183 return false; |
184 if (setting == a) | 184 if (setting == a) |
185 return true; | 185 return true; |
186 } | 186 } |
187 NOTREACHED(); | 187 NOTREACHED(); |
188 return true; | 188 return true; |
189 } | 189 } |
190 | 190 |
191 } // namespace content_settings | 191 } // namespace content_settings |
OLD | NEW |