| 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 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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::WrapUnique(new 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 map->GetSettingsForOneType( | 137 map->GetSettingsForOneType( |
| 137 CONTENT_SETTINGS_TYPE_IMAGES, | 138 CONTENT_SETTINGS_TYPE_IMAGES, |
| 138 ResourceIdentifier(), | 139 ResourceIdentifier(), |
| 139 &(rules->image_rules)); | 140 &(rules->image_rules)); |
| 141 #endif |
| 140 map->GetSettingsForOneType( | 142 map->GetSettingsForOneType( |
| 141 CONTENT_SETTINGS_TYPE_JAVASCRIPT, | 143 CONTENT_SETTINGS_TYPE_JAVASCRIPT, |
| 142 ResourceIdentifier(), | 144 ResourceIdentifier(), |
| 143 &(rules->script_rules)); | 145 &(rules->script_rules)); |
| 144 map->GetSettingsForOneType( | 146 map->GetSettingsForOneType( |
| 145 CONTENT_SETTINGS_TYPE_AUTOPLAY, | 147 CONTENT_SETTINGS_TYPE_AUTOPLAY, |
| 146 ResourceIdentifier(), | 148 ResourceIdentifier(), |
| 147 &(rules->autoplay_rules)); | 149 &(rules->autoplay_rules)); |
| 148 } | 150 } |
| 149 | 151 |
| 150 } // namespace content_settings | 152 } // namespace content_settings |
| OLD | NEW |