| 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_details.h" | 10 #include "chrome/browser/content_settings/content_settings_details.h" |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 namespace { | 29 namespace { |
| 30 | 30 |
| 31 // Returns true if we should allow all content types for this URL. This is | 31 // Returns true if we should allow all content types for this URL. This is |
| 32 // true for various internal objects like chrome:// URLs, so UI and other | 32 // true for various internal objects like chrome:// URLs, so UI and other |
| 33 // things users think of as "not webpages" don't break. | 33 // things users think of as "not webpages" don't break. |
| 34 static bool ShouldAllowAllContent(const GURL& url) { | 34 static bool ShouldAllowAllContent(const GURL& url) { |
| 35 return url.SchemeIs(chrome::kChromeDevToolsScheme) || | 35 return url.SchemeIs(chrome::kChromeDevToolsScheme) || |
| 36 url.SchemeIs(chrome::kChromeInternalScheme) || | 36 url.SchemeIs(chrome::kChromeInternalScheme) || |
| 37 url.SchemeIs(chrome::kChromeUIScheme) || | 37 url.SchemeIs(chrome::kChromeUIScheme) || |
| 38 url.SchemeIs(chrome::kExtensionScheme) || | 38 url.SchemeIs(chrome::kExtensionScheme) || |
| 39 url.SchemeIs(chrome::kGearsScheme) || | |
| 40 url.SchemeIs(chrome::kUserScriptScheme); | 39 url.SchemeIs(chrome::kUserScriptScheme); |
| 41 } | 40 } |
| 42 | 41 |
| 43 typedef linked_ptr<content_settings::DefaultProviderInterface> | 42 typedef linked_ptr<content_settings::DefaultProviderInterface> |
| 44 DefaultContentSettingsProviderPtr; | 43 DefaultContentSettingsProviderPtr; |
| 45 typedef std::vector<DefaultContentSettingsProviderPtr>::iterator | 44 typedef std::vector<DefaultContentSettingsProviderPtr>::iterator |
| 46 DefaultProviderIterator; | 45 DefaultProviderIterator; |
| 47 typedef std::vector<DefaultContentSettingsProviderPtr>::const_iterator | 46 typedef std::vector<DefaultContentSettingsProviderPtr>::const_iterator |
| 48 ConstDefaultProviderIterator; | 47 ConstDefaultProviderIterator; |
| 49 | 48 |
| (...skipping 421 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 471 SetDefaultContentSetting(CONTENT_SETTINGS_TYPE_COOKIES, | 470 SetDefaultContentSetting(CONTENT_SETTINGS_TYPE_COOKIES, |
| 472 (cookie_behavior == net::StaticCookiePolicy::BLOCK_ALL_COOKIES) ? | 471 (cookie_behavior == net::StaticCookiePolicy::BLOCK_ALL_COOKIES) ? |
| 473 CONTENT_SETTING_BLOCK : CONTENT_SETTING_ALLOW); | 472 CONTENT_SETTING_BLOCK : CONTENT_SETTING_ALLOW); |
| 474 } | 473 } |
| 475 if (!prefs->HasPrefPath(prefs::kBlockThirdPartyCookies)) { | 474 if (!prefs->HasPrefPath(prefs::kBlockThirdPartyCookies)) { |
| 476 SetBlockThirdPartyCookies(cookie_behavior == | 475 SetBlockThirdPartyCookies(cookie_behavior == |
| 477 net::StaticCookiePolicy::BLOCK_SETTING_THIRD_PARTY_COOKIES); | 476 net::StaticCookiePolicy::BLOCK_SETTING_THIRD_PARTY_COOKIES); |
| 478 } | 477 } |
| 479 } | 478 } |
| 480 } | 479 } |
| OLD | NEW |