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

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

Issue 7831075: Delegating the "are images allowed" decision to renderer. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Doc fix. Created 9 years, 1 month 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
OLDNEW
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 <utility> 7 #include <utility>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/stl_util.h" 10 #include "base/stl_util.h"
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after
309 ContentSettingsType(j), 309 ContentSettingsType(j),
310 std::string()); 310 std::string());
311 } 311 }
312 } 312 }
313 return output; 313 return output;
314 } 314 }
315 315
316 void HostContentSettingsMap::GetSettingsForOneType( 316 void HostContentSettingsMap::GetSettingsForOneType(
317 ContentSettingsType content_type, 317 ContentSettingsType content_type,
318 const std::string& resource_identifier, 318 const std::string& resource_identifier,
319 SettingsForOneType* settings) const { 319 ContentSettingsForOneType* settings) const {
320 DCHECK(content_settings::SupportsResourceIdentifier(content_type) || 320 DCHECK(content_settings::SupportsResourceIdentifier(content_type) ||
321 resource_identifier.empty()); 321 resource_identifier.empty());
322 DCHECK(settings); 322 DCHECK(settings);
323 323
324 settings->clear(); 324 settings->clear();
325 for (ConstProviderIterator provider = content_settings_providers_.begin(); 325 for (ConstProviderIterator provider = content_settings_providers_.begin();
326 provider != content_settings_providers_.end(); 326 provider != content_settings_providers_.end();
327 ++provider) { 327 ++provider) {
328 // For each provider, iterate first the incognito-specific rules, then the 328 // For each provider, iterate first the incognito-specific rules, then the
329 // normal rules. 329 // normal rules.
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after
545 net::StaticCookiePolicy::BLOCK_SETTING_THIRD_PARTY_COOKIES); 545 net::StaticCookiePolicy::BLOCK_SETTING_THIRD_PARTY_COOKIES);
546 } 546 }
547 } 547 }
548 } 548 }
549 549
550 void HostContentSettingsMap::AddSettingsForOneType( 550 void HostContentSettingsMap::AddSettingsForOneType(
551 const content_settings::ProviderInterface* provider, 551 const content_settings::ProviderInterface* provider,
552 ProviderType provider_type, 552 ProviderType provider_type,
553 ContentSettingsType content_type, 553 ContentSettingsType content_type,
554 const std::string& resource_identifier, 554 const std::string& resource_identifier,
555 SettingsForOneType* settings, 555 ContentSettingsForOneType* settings,
556 bool incognito) const { 556 bool incognito) const {
557 scoped_ptr<content_settings::RuleIterator> rule_iterator( 557 scoped_ptr<content_settings::RuleIterator> rule_iterator(
558 provider->GetRuleIterator(content_type, 558 provider->GetRuleIterator(content_type,
559 resource_identifier, 559 resource_identifier,
560 incognito)); 560 incognito));
561 ContentSettingsPattern wildcard = ContentSettingsPattern::Wildcard(); 561 ContentSettingsPattern wildcard = ContentSettingsPattern::Wildcard();
562 while (rule_iterator->HasNext()) { 562 while (rule_iterator->HasNext()) {
563 const content_settings::Rule& rule = rule_iterator->Next(); 563 const content_settings::Rule& rule = rule_iterator->Next();
564 settings->push_back(PatternSettingSourceTuple( 564 settings->push_back(ContentSettingPatternSource(
565 rule.primary_pattern, rule.secondary_pattern, 565 rule.primary_pattern, rule.secondary_pattern,
566 content_settings::ValueToContentSetting(rule.value.get()), 566 content_settings::ValueToContentSetting(rule.value.get()),
567 kProviderNames[provider_type], 567 kProviderNames[provider_type],
568 incognito)); 568 incognito));
569 } 569 }
570 } 570 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698