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 "chrome/browser/content_settings/host_content_settings_map.h" | 5 #include "chrome/browser/content_settings/host_content_settings_map.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
194 continue; | 194 continue; |
195 ContentSetting default_setting = | 195 ContentSetting default_setting = |
196 GetDefaultContentSettingFromProvider(content_type, provider->second); | 196 GetDefaultContentSettingFromProvider(content_type, provider->second); |
197 if (default_setting != CONTENT_SETTING_DEFAULT) { | 197 if (default_setting != CONTENT_SETTING_DEFAULT) { |
198 if (provider_id) | 198 if (provider_id) |
199 *provider_id = kProviderNames[provider->first]; | 199 *provider_id = kProviderNames[provider->first]; |
200 return default_setting; | 200 return default_setting; |
201 } | 201 } |
202 } | 202 } |
203 | 203 |
204 // The method GetDefaultContentSetting always has to return an explicit | |
205 // value that is to be used as default. We here rely on the | |
206 // DefaultProvider to always provide a value. | |
207 NOTREACHED(); | |
Bernhard Bauer
2014/09/15 09:13:49
Why is this not the case anymore?
Daniel Nishi
2014/09/15 16:57:27
If we ask for a default content setting for a cont
Bernhard Bauer
2014/09/15 17:05:38
Yeah, but the point of the DefaultProvider is that
Daniel Nishi
2014/09/15 17:43:53
In some cases, the idea of a default setting doesn
| |
208 return CONTENT_SETTING_DEFAULT; | 204 return CONTENT_SETTING_DEFAULT; |
209 } | 205 } |
210 | 206 |
211 ContentSetting HostContentSettingsMap::GetContentSetting( | 207 ContentSetting HostContentSettingsMap::GetContentSetting( |
212 const GURL& primary_url, | 208 const GURL& primary_url, |
213 const GURL& secondary_url, | 209 const GURL& secondary_url, |
214 ContentSettingsType content_type, | 210 ContentSettingsType content_type, |
215 const std::string& resource_identifier) const { | 211 const std::string& resource_identifier) const { |
216 DCHECK(!ContentTypeHasCompoundValue(content_type)); | 212 DCHECK(!ContentTypeHasCompoundValue(content_type)); |
217 scoped_ptr<base::Value> value(GetWebsiteSetting( | 213 scoped_ptr<base::Value> value(GetWebsiteSetting( |
(...skipping 534 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
752 } | 748 } |
753 | 749 |
754 NOTREACHED(); | 750 NOTREACHED(); |
755 return DEFAULT_PROVIDER; | 751 return DEFAULT_PROVIDER; |
756 } | 752 } |
757 | 753 |
758 content_settings::PrefProvider* HostContentSettingsMap::GetPrefProvider() { | 754 content_settings::PrefProvider* HostContentSettingsMap::GetPrefProvider() { |
759 return static_cast<content_settings::PrefProvider*>( | 755 return static_cast<content_settings::PrefProvider*>( |
760 content_settings_providers_[PREF_PROVIDER]); | 756 content_settings_providers_[PREF_PROVIDER]); |
761 } | 757 } |
OLD | NEW |