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 "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/string_util.h" | 8 #include "base/string_util.h" |
9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
10 #include "chrome/browser/content_settings/content_settings_extension_provider.h" | 10 #include "chrome/browser/content_settings/content_settings_extension_provider.h" |
(...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
359 const GURL& secondary_url, | 359 const GURL& secondary_url, |
360 ContentSettingsType content_type, | 360 ContentSettingsType content_type, |
361 const std::string& resource_identifier, | 361 const std::string& resource_identifier, |
362 ContentSetting setting) { | 362 ContentSetting setting) { |
363 // TODO(markusheintz): Until the UI supports pattern pairs, both urls must | 363 // TODO(markusheintz): Until the UI supports pattern pairs, both urls must |
364 // match. | 364 // match. |
365 DCHECK(primary_url == secondary_url); | 365 DCHECK(primary_url == secondary_url); |
366 | 366 |
367 // Make sure there is no entry that would override the pattern we are about | 367 // Make sure there is no entry that would override the pattern we are about |
368 // to insert for exactly this URL. | 368 // to insert for exactly this URL. |
369 | |
370 // TODO(markusheintz): For cookies, the pattern and wildcard parameter need | |
371 // to be switched. | |
Bernhard Bauer
2011/06/22 09:49:11
It should be correct this way; we switched to prim
markusheintz_
2011/06/22 10:53:08
+1 for Bernhard's comment.
That's way easier to m
| |
369 SetContentSetting(ContentSettingsPattern::FromURLNoWildcard(primary_url), | 372 SetContentSetting(ContentSettingsPattern::FromURLNoWildcard(primary_url), |
370 ContentSettingsPattern::Wildcard(), | 373 ContentSettingsPattern::Wildcard(), |
371 content_type, | 374 content_type, |
372 resource_identifier, | 375 resource_identifier, |
373 CONTENT_SETTING_DEFAULT); | 376 CONTENT_SETTING_DEFAULT); |
374 | 377 |
375 SetContentSetting(ContentSettingsPattern::FromURL(primary_url), | 378 SetContentSetting(ContentSettingsPattern::FromURL(primary_url), |
376 ContentSettingsPattern::Wildcard(), | 379 ContentSettingsPattern::Wildcard(), |
377 content_type, | 380 content_type, |
378 resource_identifier, | 381 resource_identifier, |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
534 SetDefaultContentSetting(CONTENT_SETTINGS_TYPE_COOKIES, | 537 SetDefaultContentSetting(CONTENT_SETTINGS_TYPE_COOKIES, |
535 (cookie_behavior == net::StaticCookiePolicy::BLOCK_ALL_COOKIES) ? | 538 (cookie_behavior == net::StaticCookiePolicy::BLOCK_ALL_COOKIES) ? |
536 CONTENT_SETTING_BLOCK : CONTENT_SETTING_ALLOW); | 539 CONTENT_SETTING_BLOCK : CONTENT_SETTING_ALLOW); |
537 } | 540 } |
538 if (!prefs->HasPrefPath(prefs::kBlockThirdPartyCookies)) { | 541 if (!prefs->HasPrefPath(prefs::kBlockThirdPartyCookies)) { |
539 SetBlockThirdPartyCookies(cookie_behavior == | 542 SetBlockThirdPartyCookies(cookie_behavior == |
540 net::StaticCookiePolicy::BLOCK_SETTING_THIRD_PARTY_COOKIES); | 543 net::StaticCookiePolicy::BLOCK_SETTING_THIRD_PARTY_COOKIES); |
541 } | 544 } |
542 } | 545 } |
543 } | 546 } |
OLD | NEW |