Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(47)

Side by Side Diff: components/content_settings/core/browser/content_settings_utils.cc

Issue 2039803002: Unregister Images, Plugins and Mouselock content settings on android (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@only_register_platform_used_contentsettingtypes
Patch Set: address review comments, minor change Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « components/content_settings/core/browser/content_settings_registry_unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 #else
142 // Android doesn't use image content settings, so ALLOW rule is added for
143 // all origins.
144 rules->image_rules.push_back(
145 ContentSettingPatternSource(ContentSettingsPattern::Wildcard(),
146 ContentSettingsPattern::Wildcard(),
147 CONTENT_SETTING_ALLOW,
148 std::string(),
149 map->is_off_the_record()));
150 #endif
140 map->GetSettingsForOneType( 151 map->GetSettingsForOneType(
141 CONTENT_SETTINGS_TYPE_JAVASCRIPT, 152 CONTENT_SETTINGS_TYPE_JAVASCRIPT,
142 ResourceIdentifier(), 153 ResourceIdentifier(),
143 &(rules->script_rules)); 154 &(rules->script_rules));
144 map->GetSettingsForOneType( 155 map->GetSettingsForOneType(
145 CONTENT_SETTINGS_TYPE_AUTOPLAY, 156 CONTENT_SETTINGS_TYPE_AUTOPLAY,
146 ResourceIdentifier(), 157 ResourceIdentifier(),
147 &(rules->autoplay_rules)); 158 &(rules->autoplay_rules));
148 } 159 }
149 160
150 } // namespace content_settings 161 } // namespace content_settings
OLDNEW
« no previous file with comments | « components/content_settings/core/browser/content_settings_registry_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698