| 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 528 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 539 | 539 |
| 540 bool HostContentSettingsMap::ShouldAllowAllContent( | 540 bool HostContentSettingsMap::ShouldAllowAllContent( |
| 541 const GURL& primary_url, | 541 const GURL& primary_url, |
| 542 const GURL& secondary_url, | 542 const GURL& secondary_url, |
| 543 ContentSettingsType content_type) { | 543 ContentSettingsType content_type) { |
| 544 if (content_type == CONTENT_SETTINGS_TYPE_NOTIFICATIONS || | 544 if (content_type == CONTENT_SETTINGS_TYPE_NOTIFICATIONS || |
| 545 content_type == CONTENT_SETTINGS_TYPE_GEOLOCATION || | 545 content_type == CONTENT_SETTINGS_TYPE_GEOLOCATION || |
| 546 content_type == CONTENT_SETTINGS_TYPE_MIDI_SYSEX) { | 546 content_type == CONTENT_SETTINGS_TYPE_MIDI_SYSEX) { |
| 547 return false; | 547 return false; |
| 548 } | 548 } |
| 549 if (secondary_url.SchemeIs(chrome::kChromeUIScheme) && | 549 if (secondary_url.SchemeIs(content::kChromeUIScheme) && |
| 550 content_type == CONTENT_SETTINGS_TYPE_COOKIES && | 550 content_type == CONTENT_SETTINGS_TYPE_COOKIES && |
| 551 primary_url.SchemeIsSecure()) { | 551 primary_url.SchemeIsSecure()) { |
| 552 return true; | 552 return true; |
| 553 } | 553 } |
| 554 if (primary_url.SchemeIs(extensions::kExtensionScheme)) { | 554 if (primary_url.SchemeIs(extensions::kExtensionScheme)) { |
| 555 switch (content_type) { | 555 switch (content_type) { |
| 556 case CONTENT_SETTINGS_TYPE_PLUGINS: | 556 case CONTENT_SETTINGS_TYPE_PLUGINS: |
| 557 case CONTENT_SETTINGS_TYPE_MEDIASTREAM: | 557 case CONTENT_SETTINGS_TYPE_MEDIASTREAM: |
| 558 case CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC: | 558 case CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC: |
| 559 case CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA: | 559 case CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA: |
| 560 return false; | 560 return false; |
| 561 case CONTENT_SETTINGS_TYPE_COOKIES: | 561 case CONTENT_SETTINGS_TYPE_COOKIES: |
| 562 return secondary_url.SchemeIs(extensions::kExtensionScheme); | 562 return secondary_url.SchemeIs(extensions::kExtensionScheme); |
| 563 default: | 563 default: |
| 564 return true; | 564 return true; |
| 565 } | 565 } |
| 566 } | 566 } |
| 567 return primary_url.SchemeIs(chrome::kChromeDevToolsScheme) || | 567 return primary_url.SchemeIs(chrome::kChromeDevToolsScheme) || |
| 568 primary_url.SchemeIs(chrome::kChromeUIScheme); | 568 primary_url.SchemeIs(content::kChromeUIScheme); |
| 569 } | 569 } |
| 570 | 570 |
| 571 base::Value* HostContentSettingsMap::GetWebsiteSetting( | 571 base::Value* HostContentSettingsMap::GetWebsiteSetting( |
| 572 const GURL& primary_url, | 572 const GURL& primary_url, |
| 573 const GURL& secondary_url, | 573 const GURL& secondary_url, |
| 574 ContentSettingsType content_type, | 574 ContentSettingsType content_type, |
| 575 const std::string& resource_identifier, | 575 const std::string& resource_identifier, |
| 576 content_settings::SettingInfo* info) const { | 576 content_settings::SettingInfo* info) const { |
| 577 DCHECK(SupportsResourceIdentifier(content_type) || | 577 DCHECK(SupportsResourceIdentifier(content_type) || |
| 578 resource_identifier.empty()); | 578 resource_identifier.empty()); |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 623 HostContentSettingsMap::GetProviderTypeFromSource( | 623 HostContentSettingsMap::GetProviderTypeFromSource( |
| 624 const std::string& source) { | 624 const std::string& source) { |
| 625 for (size_t i = 0; i < arraysize(kProviderNames); ++i) { | 625 for (size_t i = 0; i < arraysize(kProviderNames); ++i) { |
| 626 if (source == kProviderNames[i]) | 626 if (source == kProviderNames[i]) |
| 627 return static_cast<ProviderType>(i); | 627 return static_cast<ProviderType>(i); |
| 628 } | 628 } |
| 629 | 629 |
| 630 NOTREACHED(); | 630 NOTREACHED(); |
| 631 return DEFAULT_PROVIDER; | 631 return DEFAULT_PROVIDER; |
| 632 } | 632 } |
| OLD | NEW |