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

Side by Side Diff: chrome/browser/content_settings/content_settings_utils.cc

Issue 8804016: Cleanup content settings code (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Re-add deleted include in host_content_settings_map.cc Created 9 years 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "chrome/browser/content_settings/content_settings_utils.h" 5 #include "chrome/browser/content_settings/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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 const char kPatternSeparator[] = ","; 42 const char kPatternSeparator[] = ",";
43 43
44 } // namespace 44 } // namespace
45 45
46 namespace content_settings { 46 namespace content_settings {
47 47
48 std::string GetTypeName(ContentSettingsType type) { 48 std::string GetTypeName(ContentSettingsType type) {
49 return std::string(kTypeNames[type]); 49 return std::string(kTypeNames[type]);
50 } 50 }
51 51
52 bool SupportsResourceIdentifier(ContentSettingsType content_type) {
53 return content_type == CONTENT_SETTINGS_TYPE_PLUGINS;
54 }
55
56 ContentSetting ClickToPlayFixup(ContentSettingsType content_type, 52 ContentSetting ClickToPlayFixup(ContentSettingsType content_type,
57 ContentSetting setting) { 53 ContentSetting setting) {
58 if (setting == CONTENT_SETTING_ASK && 54 if (setting == CONTENT_SETTING_ASK &&
59 content_type == CONTENT_SETTINGS_TYPE_PLUGINS && 55 content_type == CONTENT_SETTINGS_TYPE_PLUGINS &&
60 !CommandLine::ForCurrentProcess()->HasSwitch( 56 !CommandLine::ForCurrentProcess()->HasSwitch(
61 switches::kEnableClickToPlay)) { 57 switches::kEnableClickToPlay)) {
62 return CONTENT_SETTING_BLOCK; 58 return CONTENT_SETTING_BLOCK;
63 } 59 }
64 return setting; 60 return setting;
65 } 61 }
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
198 194
199 void GetRendererContentSettingRules(const HostContentSettingsMap* map, 195 void GetRendererContentSettingRules(const HostContentSettingsMap* map,
200 RendererContentSettingRules* rules) { 196 RendererContentSettingRules* rules) {
201 map->GetSettingsForOneType(CONTENT_SETTINGS_TYPE_IMAGES, "", 197 map->GetSettingsForOneType(CONTENT_SETTINGS_TYPE_IMAGES, "",
202 &(rules->image_rules)); 198 &(rules->image_rules));
203 map->GetSettingsForOneType(CONTENT_SETTINGS_TYPE_JAVASCRIPT, "", 199 map->GetSettingsForOneType(CONTENT_SETTINGS_TYPE_JAVASCRIPT, "",
204 &(rules->script_rules)); 200 &(rules->script_rules));
205 } 201 }
206 202
207 } // namespace content_settings 203 } // namespace content_settings
OLDNEW
« no previous file with comments | « chrome/browser/content_settings/content_settings_utils.h ('k') | chrome/browser/content_settings/host_content_settings_map.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698