| 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 12 matching lines...) Expand all Loading... |
| 23 #include "url/gurl.h" | 23 #include "url/gurl.h" |
| 24 | 24 |
| 25 namespace { | 25 namespace { |
| 26 | 26 |
| 27 const char kPatternSeparator[] = ","; | 27 const char kPatternSeparator[] = ","; |
| 28 | 28 |
| 29 } // namespace | 29 } // namespace |
| 30 | 30 |
| 31 namespace content_settings { | 31 namespace content_settings { |
| 32 | 32 |
| 33 std::string GetTypeName(ContentSettingsType type) { | |
| 34 return WebsiteSettingsRegistry::GetInstance()->Get(type)->name(); | |
| 35 } | |
| 36 | |
| 37 std::string ContentSettingToString(ContentSetting setting) { | 33 std::string ContentSettingToString(ContentSetting setting) { |
| 38 switch (setting) { | 34 switch (setting) { |
| 39 case CONTENT_SETTING_ALLOW: | 35 case CONTENT_SETTING_ALLOW: |
| 40 return "allow"; | 36 return "allow"; |
| 41 case CONTENT_SETTING_ASK: | 37 case CONTENT_SETTING_ASK: |
| 42 return "ask"; | 38 return "ask"; |
| 43 case CONTENT_SETTING_BLOCK: | 39 case CONTENT_SETTING_BLOCK: |
| 44 return "block"; | 40 return "block"; |
| 45 case CONTENT_SETTING_SESSION_ONLY: | 41 case CONTENT_SETTING_SESSION_ONLY: |
| 46 return "session"; | 42 return "session"; |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 206 if (IsContentSettingsTypeSyncable(content_type)) | 202 if (IsContentSettingsTypeSyncable(content_type)) |
| 207 flags |= user_prefs::PrefRegistrySyncable::SYNCABLE_PREF; | 203 flags |= user_prefs::PrefRegistrySyncable::SYNCABLE_PREF; |
| 208 | 204 |
| 209 if (IsContentSettingsTypeLossy(content_type)) | 205 if (IsContentSettingsTypeLossy(content_type)) |
| 210 flags |= PrefRegistry::LOSSY_PREF; | 206 flags |= PrefRegistry::LOSSY_PREF; |
| 211 | 207 |
| 212 return flags; | 208 return flags; |
| 213 } | 209 } |
| 214 | 210 |
| 215 } // namespace content_settings | 211 } // namespace content_settings |
| OLD | NEW |