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

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

Issue 1038203003: Default Provider style fixes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Back to reset(release()). Created 5 years, 8 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_utils.h ('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 <vector> 7 #include <vector>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 *setting = CONTENT_SETTING_DEFAULT; 162 *setting = CONTENT_SETTING_DEFAULT;
163 return true; 163 return true;
164 } 164 }
165 int int_value = -1; 165 int int_value = -1;
166 if (!value->GetAsInteger(&int_value)) 166 if (!value->GetAsInteger(&int_value))
167 return false; 167 return false;
168 *setting = IntToContentSetting(int_value); 168 *setting = IntToContentSetting(int_value);
169 return *setting != CONTENT_SETTING_DEFAULT; 169 return *setting != CONTENT_SETTING_DEFAULT;
170 } 170 }
171 171
172 scoped_ptr<base::Value> ContentSettingToValue(ContentSetting setting) {
173 if (setting <= CONTENT_SETTING_DEFAULT ||
174 setting >= CONTENT_SETTING_NUM_SETTINGS) {
175 return nullptr;
176 }
177 return make_scoped_ptr(new base::FundamentalValue(setting));
178 }
179
172 base::Value* GetContentSettingValueAndPatterns( 180 base::Value* GetContentSettingValueAndPatterns(
173 const ProviderInterface* provider, 181 const ProviderInterface* provider,
174 const GURL& primary_url, 182 const GURL& primary_url,
175 const GURL& secondary_url, 183 const GURL& secondary_url,
176 ContentSettingsType content_type, 184 ContentSettingsType content_type,
177 const std::string& resource_identifier, 185 const std::string& resource_identifier,
178 bool include_incognito, 186 bool include_incognito,
179 ContentSettingsPattern* primary_pattern, 187 ContentSettingsPattern* primary_pattern,
180 ContentSettingsPattern* secondary_pattern) { 188 ContentSettingsPattern* secondary_pattern) {
181 if (include_incognito) { 189 if (include_incognito) {
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
220 228
221 void GetRendererContentSettingRules(const HostContentSettingsMap* map, 229 void GetRendererContentSettingRules(const HostContentSettingsMap* map,
222 RendererContentSettingRules* rules) { 230 RendererContentSettingRules* rules) {
223 map->GetSettingsForOneType( 231 map->GetSettingsForOneType(
224 CONTENT_SETTINGS_TYPE_IMAGES, std::string(), &(rules->image_rules)); 232 CONTENT_SETTINGS_TYPE_IMAGES, std::string(), &(rules->image_rules));
225 map->GetSettingsForOneType( 233 map->GetSettingsForOneType(
226 CONTENT_SETTINGS_TYPE_JAVASCRIPT, std::string(), &(rules->script_rules)); 234 CONTENT_SETTINGS_TYPE_JAVASCRIPT, std::string(), &(rules->script_rules));
227 } 235 }
228 236
229 } // namespace content_settings 237 } // namespace content_settings
OLDNEW
« no previous file with comments | « components/content_settings/core/browser/content_settings_utils.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698