| 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 <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 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 case CONTENT_SETTING_SESSION_ONLY: | 84 case CONTENT_SETTING_SESSION_ONLY: |
| 85 return "session"; | 85 return "session"; |
| 86 case CONTENT_SETTING_DETECT_IMPORTANT_CONTENT: | 86 case CONTENT_SETTING_DETECT_IMPORTANT_CONTENT: |
| 87 return "detect"; | 87 return "detect"; |
| 88 case CONTENT_SETTING_DEFAULT: | 88 case CONTENT_SETTING_DEFAULT: |
| 89 return "default"; | 89 return "default"; |
| 90 case CONTENT_SETTING_NUM_SETTINGS: | 90 case CONTENT_SETTING_NUM_SETTINGS: |
| 91 NOTREACHED(); | 91 NOTREACHED(); |
| 92 } | 92 } |
| 93 | 93 |
| 94 return std::string(); | 94 return ResourceIdentifier(); |
| 95 } | 95 } |
| 96 | 96 |
| 97 ContentSetting ContentSettingFromString(const std::string& name) { | 97 ContentSetting ContentSettingFromString(const std::string& name) { |
| 98 if (name == "allow") | 98 if (name == "allow") |
| 99 return CONTENT_SETTING_ALLOW; | 99 return CONTENT_SETTING_ALLOW; |
| 100 if (name == "ask") | 100 if (name == "ask") |
| 101 return CONTENT_SETTING_ASK; | 101 return CONTENT_SETTING_ASK; |
| 102 if (name == "block") | 102 if (name == "block") |
| 103 return CONTENT_SETTING_BLOCK; | 103 return CONTENT_SETTING_BLOCK; |
| 104 if (name == "session") | 104 if (name == "session") |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 222 *secondary_pattern = rule.secondary_pattern; | 222 *secondary_pattern = rule.secondary_pattern; |
| 223 return rule.value.get()->DeepCopy(); | 223 return rule.value.get()->DeepCopy(); |
| 224 } | 224 } |
| 225 } | 225 } |
| 226 return NULL; | 226 return NULL; |
| 227 } | 227 } |
| 228 | 228 |
| 229 void GetRendererContentSettingRules(const HostContentSettingsMap* map, | 229 void GetRendererContentSettingRules(const HostContentSettingsMap* map, |
| 230 RendererContentSettingRules* rules) { | 230 RendererContentSettingRules* rules) { |
| 231 map->GetSettingsForOneType( | 231 map->GetSettingsForOneType( |
| 232 CONTENT_SETTINGS_TYPE_IMAGES, std::string(), &(rules->image_rules)); | 232 CONTENT_SETTINGS_TYPE_IMAGES, |
| 233 ResourceIdentifier(), |
| 234 &(rules->image_rules)); |
| 233 map->GetSettingsForOneType( | 235 map->GetSettingsForOneType( |
| 234 CONTENT_SETTINGS_TYPE_JAVASCRIPT, std::string(), &(rules->script_rules)); | 236 CONTENT_SETTINGS_TYPE_JAVASCRIPT, |
| 237 ResourceIdentifier(), |
| 238 &(rules->script_rules)); |
| 235 } | 239 } |
| 236 | 240 |
| 237 } // namespace content_settings | 241 } // namespace content_settings |
| OLD | NEW |