Chromium Code Reviews| 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 "components/content_settings/core/common/content_settings.h" | 5 #include "components/content_settings/core/common/content_settings.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 | 8 |
| 9 ContentSetting IntToContentSetting(int content_setting) { | 9 ContentSetting IntToContentSetting(int content_setting) { |
| 10 return ((content_setting < 0) || | 10 return ((content_setting < 0) || |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 66 #endif | 66 #endif |
| 67 case CONTENT_SETTINGS_TYPE_APP_BANNER: | 67 case CONTENT_SETTINGS_TYPE_APP_BANNER: |
| 68 return CONTENT_SETTINGS_TYPE_HISTOGRAM_APP_BANNER; | 68 return CONTENT_SETTINGS_TYPE_HISTOGRAM_APP_BANNER; |
| 69 case CONTENT_SETTINGS_NUM_TYPES: | 69 case CONTENT_SETTINGS_NUM_TYPES: |
| 70 return CONTENT_SETTINGS_TYPE_HISTOGRAM_INVALID; | 70 return CONTENT_SETTINGS_TYPE_HISTOGRAM_INVALID; |
| 71 } | 71 } |
| 72 NOTREACHED(); | 72 NOTREACHED(); |
| 73 return CONTENT_SETTINGS_TYPE_HISTOGRAM_INVALID; | 73 return CONTENT_SETTINGS_TYPE_HISTOGRAM_INVALID; |
| 74 } | 74 } |
| 75 | 75 |
| 76 bool IsContentSettingsTypeSyncable(ContentSettingsType content_setting) { | |
| 77 switch (content_setting) { | |
| 78 case CONTENT_SETTINGS_TYPE_COOKIES: | |
| 79 case CONTENT_SETTINGS_TYPE_IMAGES: | |
| 80 case CONTENT_SETTINGS_TYPE_JAVASCRIPT: | |
| 81 case CONTENT_SETTINGS_TYPE_PLUGINS: | |
| 82 case CONTENT_SETTINGS_TYPE_POPUPS: | |
| 83 case CONTENT_SETTINGS_TYPE_FULLSCREEN: | |
| 84 case CONTENT_SETTINGS_TYPE_MOUSELOCK: | |
| 85 case CONTENT_SETTINGS_TYPE_MIXEDSCRIPT: | |
| 86 case CONTENT_SETTINGS_TYPE_PROTOCOL_HANDLERS: | |
| 87 case CONTENT_SETTINGS_TYPE_AUTOMATIC_DOWNLOADS: | |
| 88 case CONTENT_SETTINGS_TYPE_MIDI_SYSEX: | |
| 89 case CONTENT_SETTINGS_TYPE_PUSH_MESSAGING: | |
| 90 #if defined(OS_WIN) | |
| 91 case CONTENT_SETTINGS_TYPE_METRO_SWITCH_TO_DESKTOP: | |
| 92 #endif | |
| 93 return true; | |
| 94 | |
| 95 case CONTENT_SETTINGS_TYPE_GEOLOCATION: | |
| 96 case CONTENT_SETTINGS_TYPE_NOTIFICATIONS: | |
| 97 case CONTENT_SETTINGS_TYPE_AUTO_SELECT_CERTIFICATE: | |
| 98 case CONTENT_SETTINGS_TYPE_MEDIASTREAM: | |
| 99 case CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC: | |
| 100 case CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA: | |
| 101 case CONTENT_SETTINGS_TYPE_PPAPI_BROKER: | |
| 102 case CONTENT_SETTINGS_TYPE_SSL_CERT_DECISIONS: | |
| 103 #if defined(OS_ANDROID) || defined(OS_CHROMEOS) | |
| 104 case CONTENT_SETTINGS_TYPE_PROTECTED_MEDIA_IDENTIFIER: | |
| 105 #endif | |
| 106 case CONTENT_SETTINGS_TYPE_APP_BANNER: | |
| 107 return false; | |
| 108 | |
| 109 default: | |
|
raymes
2015/04/01 06:51:20
nit: do we need "default"? can we just put
NOTREA
msramek
2015/04/01 09:34:26
The compiler requires every option to be represent
msramek
2015/04/01 10:53:35
Oh yes, but now trybots can't see that all options
| |
| 110 NOTREACHED(); | |
| 111 return false; | |
| 112 } | |
| 113 } | |
| 114 | |
| 76 ContentSettingPatternSource::ContentSettingPatternSource( | 115 ContentSettingPatternSource::ContentSettingPatternSource( |
| 77 const ContentSettingsPattern& primary_pattern, | 116 const ContentSettingsPattern& primary_pattern, |
| 78 const ContentSettingsPattern& secondary_pattern, | 117 const ContentSettingsPattern& secondary_pattern, |
| 79 ContentSetting setting, | 118 ContentSetting setting, |
| 80 const std::string& source, | 119 const std::string& source, |
| 81 bool incognito) | 120 bool incognito) |
| 82 : primary_pattern(primary_pattern), | 121 : primary_pattern(primary_pattern), |
| 83 secondary_pattern(secondary_pattern), | 122 secondary_pattern(secondary_pattern), |
| 84 setting(setting), | 123 setting(setting), |
| 85 source(source), | 124 source(source), |
| 86 incognito(incognito) {} | 125 incognito(incognito) {} |
| 87 | 126 |
| 88 ContentSettingPatternSource::ContentSettingPatternSource() | 127 ContentSettingPatternSource::ContentSettingPatternSource() |
| 89 : setting(CONTENT_SETTING_DEFAULT), incognito(false) { | 128 : setting(CONTENT_SETTING_DEFAULT), incognito(false) { |
| 90 } | 129 } |
| 91 | 130 |
| 92 RendererContentSettingRules::RendererContentSettingRules() {} | 131 RendererContentSettingRules::RendererContentSettingRules() {} |
| 93 | 132 |
| 94 RendererContentSettingRules::~RendererContentSettingRules() {} | 133 RendererContentSettingRules::~RendererContentSettingRules() {} |
| OLD | NEW |