| 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 291 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 302                     secondary_pattern, | 302                     secondary_pattern, | 
| 303                     content_type, | 303                     content_type, | 
| 304                     resource_identifier, | 304                     resource_identifier, | 
| 305                     value); | 305                     value); | 
| 306 } | 306 } | 
| 307 | 307 | 
| 308 void HostContentSettingsMap::AddExceptionForURL( | 308 void HostContentSettingsMap::AddExceptionForURL( | 
| 309     const GURL& primary_url, | 309     const GURL& primary_url, | 
| 310     const GURL& secondary_url, | 310     const GURL& secondary_url, | 
| 311     ContentSettingsType content_type, | 311     ContentSettingsType content_type, | 
| 312     const std::string& resource_identifier, |  | 
| 313     ContentSetting setting) { | 312     ContentSetting setting) { | 
| 314   // TODO(markusheintz): Until the UI supports pattern pairs, both urls must | 313   // TODO(markusheintz): Until the UI supports pattern pairs, both urls must | 
| 315   // match. | 314   // match. | 
| 316   DCHECK(primary_url == secondary_url); | 315   DCHECK(primary_url == secondary_url); | 
| 317   DCHECK(!ContentTypeHasCompoundValue(content_type)); | 316   DCHECK(!ContentTypeHasCompoundValue(content_type)); | 
| 318 | 317 | 
| 319   // Make sure there is no entry that would override the pattern we are about | 318   // Make sure there is no entry that would override the pattern we are about | 
| 320   // to insert for exactly this URL. | 319   // to insert for exactly this URL. | 
| 321   SetContentSetting(ContentSettingsPattern::FromURLNoWildcard(primary_url), | 320   SetContentSetting(ContentSettingsPattern::FromURLNoWildcard(primary_url), | 
| 322                     ContentSettingsPattern::Wildcard(), | 321                     ContentSettingsPattern::Wildcard(), | 
| 323                     content_type, | 322                     content_type, | 
| 324                     resource_identifier, | 323                     std::string(), | 
| 325                     CONTENT_SETTING_DEFAULT); | 324                     CONTENT_SETTING_DEFAULT); | 
| 326 | 325 | 
| 327   SetContentSetting(ContentSettingsPattern::FromURL(primary_url), | 326   SetContentSetting(ContentSettingsPattern::FromURL(primary_url), | 
| 328                     ContentSettingsPattern::Wildcard(), | 327                     ContentSettingsPattern::Wildcard(), | 
| 329                     content_type, | 328                     content_type, | 
| 330                     resource_identifier, | 329                     std::string(), | 
| 331                     setting); | 330                     setting); | 
| 332 } | 331 } | 
| 333 | 332 | 
| 334 void HostContentSettingsMap::ClearSettingsForOneType( | 333 void HostContentSettingsMap::ClearSettingsForOneType( | 
| 335     ContentSettingsType content_type) { | 334     ContentSettingsType content_type) { | 
| 336   UsedContentSettingsProviders(); | 335   UsedContentSettingsProviders(); | 
| 337   for (ProviderIterator provider = content_settings_providers_.begin(); | 336   for (ProviderIterator provider = content_settings_providers_.begin(); | 
| 338        provider != content_settings_providers_.end(); | 337        provider != content_settings_providers_.end(); | 
| 339        ++provider) { | 338        ++provider) { | 
| 340     provider->second->ClearAllContentSettingsRules(content_type); | 339     provider->second->ClearAllContentSettingsRules(content_type); | 
| (...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 613     HostContentSettingsMap::GetProviderTypeFromSource( | 612     HostContentSettingsMap::GetProviderTypeFromSource( | 
| 614         const std::string& source) { | 613         const std::string& source) { | 
| 615   for (size_t i = 0; i < arraysize(kProviderNames); ++i) { | 614   for (size_t i = 0; i < arraysize(kProviderNames); ++i) { | 
| 616     if (source == kProviderNames[i]) | 615     if (source == kProviderNames[i]) | 
| 617       return static_cast<ProviderType>(i); | 616       return static_cast<ProviderType>(i); | 
| 618   } | 617   } | 
| 619 | 618 | 
| 620   NOTREACHED(); | 619   NOTREACHED(); | 
| 621   return DEFAULT_PROVIDER; | 620   return DEFAULT_PROVIDER; | 
| 622 } | 621 } | 
| OLD | NEW | 
|---|