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

Side by Side Diff: components/content_settings/core/common/content_settings.cc

Issue 1005303003: Split the aggregate dictionary of content settings exceptions into per-type dictionaries (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 months 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
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 "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
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) {
msramek 2015/03/24 15:11:45 Somehow this didn't come to my mind when doing the
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_NOTIFICATIONS:
84 case CONTENT_SETTINGS_TYPE_FULLSCREEN:
85 case CONTENT_SETTINGS_TYPE_MOUSELOCK:
86 case CONTENT_SETTINGS_TYPE_MIXEDSCRIPT:
87 case CONTENT_SETTINGS_TYPE_PROTOCOL_HANDLERS:
88 case CONTENT_SETTINGS_TYPE_AUTOMATIC_DOWNLOADS:
89 case CONTENT_SETTINGS_TYPE_MIDI_SYSEX:
90 case CONTENT_SETTINGS_TYPE_PUSH_MESSAGING:
91 #if defined(OS_WIN)
92 case CONTENT_SETTINGS_TYPE_METRO_SWITCH_TO_DESKTOP:
93 #endif
94 return true;
95
96 case CONTENT_SETTINGS_TYPE_GEOLOCATION:
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:
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() {}
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698