| 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 479 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 490 } | 490 } |
| 491 | 491 |
| 492 bool HostContentSettingsMap::ShouldAllowAllContent( | 492 bool HostContentSettingsMap::ShouldAllowAllContent( |
| 493 const GURL& primary_url, | 493 const GURL& primary_url, |
| 494 const GURL& secondary_url, | 494 const GURL& secondary_url, |
| 495 ContentSettingsType content_type) { | 495 ContentSettingsType content_type) { |
| 496 if (content_type == CONTENT_SETTINGS_TYPE_NOTIFICATIONS || | 496 if (content_type == CONTENT_SETTINGS_TYPE_NOTIFICATIONS || |
| 497 content_type == CONTENT_SETTINGS_TYPE_GEOLOCATION) { | 497 content_type == CONTENT_SETTINGS_TYPE_GEOLOCATION) { |
| 498 return false; | 498 return false; |
| 499 } | 499 } |
| 500 if (secondary_url.SchemeIs(chrome::kChromeUIScheme) && |
| 501 content_type == CONTENT_SETTINGS_TYPE_COOKIES && |
| 502 primary_url.SchemeIsSecure()) { |
| 503 return true; |
| 504 } |
| 500 if (primary_url.SchemeIs(chrome::kExtensionScheme)) { | 505 if (primary_url.SchemeIs(chrome::kExtensionScheme)) { |
| 501 return content_type != CONTENT_SETTINGS_TYPE_PLUGINS && | 506 return content_type != CONTENT_SETTINGS_TYPE_PLUGINS && |
| 502 (content_type != CONTENT_SETTINGS_TYPE_COOKIES || | 507 (content_type != CONTENT_SETTINGS_TYPE_COOKIES || |
| 503 secondary_url.SchemeIs(chrome::kExtensionScheme)); | 508 secondary_url.SchemeIs(chrome::kExtensionScheme)); |
| 504 } | 509 } |
| 505 return primary_url.SchemeIs(chrome::kChromeDevToolsScheme) || | 510 return primary_url.SchemeIs(chrome::kChromeDevToolsScheme) || |
| 506 primary_url.SchemeIs(chrome::kChromeInternalScheme) || | 511 primary_url.SchemeIs(chrome::kChromeInternalScheme) || |
| 507 primary_url.SchemeIs(chrome::kChromeUIScheme); | 512 primary_url.SchemeIs(chrome::kChromeUIScheme); |
| 508 } | 513 } |
| 509 | 514 |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 549 } | 554 } |
| 550 } | 555 } |
| 551 | 556 |
| 552 if (info) { | 557 if (info) { |
| 553 info->source = content_settings::SETTING_SOURCE_NONE; | 558 info->source = content_settings::SETTING_SOURCE_NONE; |
| 554 info->primary_pattern = ContentSettingsPattern(); | 559 info->primary_pattern = ContentSettingsPattern(); |
| 555 info->secondary_pattern = ContentSettingsPattern(); | 560 info->secondary_pattern = ContentSettingsPattern(); |
| 556 } | 561 } |
| 557 return NULL; | 562 return NULL; |
| 558 } | 563 } |
| OLD | NEW |