Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(192)

Side by Side Diff: chrome/browser/content_settings/host_content_settings_map.cc

Issue 10826089: Allow chrome://* to always include cookies in secure XHRs. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/content_settings/host_content_settings_map_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/content_settings/host_content_settings_map_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698