| 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 "chrome/browser/content_settings/host_content_settings_map.h" | 5 #include "chrome/browser/content_settings/host_content_settings_map.h" |
| 6 | 6 |
| 7 #include <list> | 7 #include <list> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
| (...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 182 // value that is to be used as default. We here rely on the | 182 // value that is to be used as default. We here rely on the |
| 183 // PrefContentSettingProvider to always provide a value. | 183 // PrefContentSettingProvider to always provide a value. |
| 184 CHECK_NE(CONTENT_SETTING_DEFAULT, setting); | 184 CHECK_NE(CONTENT_SETTING_DEFAULT, setting); |
| 185 return setting; | 185 return setting; |
| 186 } | 186 } |
| 187 | 187 |
| 188 ContentSettings HostContentSettingsMap::GetDefaultContentSettings() const { | 188 ContentSettings HostContentSettingsMap::GetDefaultContentSettings() const { |
| 189 ContentSettings output(CONTENT_SETTING_DEFAULT); | 189 ContentSettings output(CONTENT_SETTING_DEFAULT); |
| 190 for (int i = 0; i < CONTENT_SETTINGS_NUM_TYPES; ++i) { | 190 for (int i = 0; i < CONTENT_SETTINGS_NUM_TYPES; ++i) { |
| 191 if (!ContentTypeHasCompoundValue(ContentSettingsType(i))) | 191 if (!ContentTypeHasCompoundValue(ContentSettingsType(i))) |
| 192 output.settings[i] = GetDefaultContentSetting(ContentSettingsType(i)); | 192 output.settings[i] = GetDefaultContentSetting(ContentSettingsType(i)); |
| 193 } | 193 } |
| 194 return output; | 194 return output; |
| 195 } | 195 } |
| 196 | 196 |
| 197 ContentSetting HostContentSettingsMap::GetCookieContentSetting( | 197 ContentSetting HostContentSettingsMap::GetCookieContentSetting( |
| 198 const GURL& url, | 198 const GURL& url, |
| 199 const GURL& first_party_url, | 199 const GURL& first_party_url, |
| 200 bool setting_cookie) const { | 200 bool setting_cookie) const { |
| 201 if (ShouldAllowAllContent(first_party_url, CONTENT_SETTINGS_TYPE_COOKIES)) | 201 if (ShouldAllowAllContent(first_party_url, CONTENT_SETTINGS_TYPE_COOKIES)) |
| 202 return CONTENT_SETTING_ALLOW; | 202 return CONTENT_SETTING_ALLOW; |
| (...skipping 388 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 591 SetDefaultContentSetting(CONTENT_SETTINGS_TYPE_COOKIES, | 591 SetDefaultContentSetting(CONTENT_SETTINGS_TYPE_COOKIES, |
| 592 (cookie_behavior == net::StaticCookiePolicy::BLOCK_ALL_COOKIES) ? | 592 (cookie_behavior == net::StaticCookiePolicy::BLOCK_ALL_COOKIES) ? |
| 593 CONTENT_SETTING_BLOCK : CONTENT_SETTING_ALLOW); | 593 CONTENT_SETTING_BLOCK : CONTENT_SETTING_ALLOW); |
| 594 } | 594 } |
| 595 if (!prefs_->HasPrefPath(prefs::kBlockThirdPartyCookies)) { | 595 if (!prefs_->HasPrefPath(prefs::kBlockThirdPartyCookies)) { |
| 596 SetBlockThirdPartyCookies(cookie_behavior == | 596 SetBlockThirdPartyCookies(cookie_behavior == |
| 597 net::StaticCookiePolicy::BLOCK_SETTING_THIRD_PARTY_COOKIES); | 597 net::StaticCookiePolicy::BLOCK_SETTING_THIRD_PARTY_COOKIES); |
| 598 } | 598 } |
| 599 } | 599 } |
| 600 } | 600 } |
| OLD | NEW |