| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |