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 "components/content_settings/core/browser/host_content_settings_map.h" | 5 #include "components/content_settings/core/browser/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" |
11 #include "base/prefs/pref_service.h" | 11 #include "base/prefs/pref_service.h" |
12 #include "base/stl_util.h" | 12 #include "base/stl_util.h" |
13 #include "base/strings/string_util.h" | 13 #include "base/strings/string_util.h" |
14 #include "base/strings/utf_string_conversions.h" | 14 #include "base/strings/utf_string_conversions.h" |
15 #include "base/time/clock.h" | 15 #include "base/time/clock.h" |
16 #include "components/content_settings/core/browser/content_settings_default_prov ider.h" | 16 #include "components/content_settings/core/browser/content_settings_default_prov ider.h" |
17 #include "components/content_settings/core/browser/content_settings_details.h" | 17 #include "components/content_settings/core/browser/content_settings_details.h" |
18 #include "components/content_settings/core/browser/content_settings_observable_p rovider.h" | 18 #include "components/content_settings/core/browser/content_settings_observable_p rovider.h" |
19 #include "components/content_settings/core/browser/content_settings_policy_provi der.h" | 19 #include "components/content_settings/core/browser/content_settings_policy_provi der.h" |
20 #include "components/content_settings/core/browser/content_settings_pref_provide r.h" | 20 #include "components/content_settings/core/browser/content_settings_pref_provide r.h" |
21 #include "components/content_settings/core/browser/content_settings_provider.h" | 21 #include "components/content_settings/core/browser/content_settings_provider.h" |
22 #include "components/content_settings/core/browser/content_settings_rule.h" | 22 #include "components/content_settings/core/browser/content_settings_rule.h" |
23 #include "components/content_settings/core/browser/content_settings_utils.h" | 23 #include "components/content_settings/core/browser/content_settings_utils.h" |
24 #include "components/content_settings/core/common/content_settings_pattern.h" | 24 #include "components/content_settings/core/common/content_settings_pattern.h" |
25 #include "components/content_settings/core/common/pref_names.h" | 25 #include "components/content_settings/core/common/pref_names.h" |
26 #include "components/pref_registry/pref_registry_syncable.h" | 26 #include "components/pref_registry/pref_registry_syncable.h" |
27 #include "content/public/common/origin_util.h" | |
lgarron
2015/04/27 23:21:53
`git cl upload` complains:
You added one or more
| |
27 #include "net/base/net_errors.h" | 28 #include "net/base/net_errors.h" |
28 #include "net/base/static_cookie_policy.h" | 29 #include "net/base/static_cookie_policy.h" |
29 #include "url/gurl.h" | 30 #include "url/gurl.h" |
30 | 31 |
31 namespace { | 32 namespace { |
32 | 33 |
33 typedef std::vector<content_settings::Rule> Rules; | 34 typedef std::vector<content_settings::Rule> Rules; |
34 | 35 |
35 typedef std::pair<std::string, std::string> StringPair; | 36 typedef std::pair<std::string, std::string> StringPair; |
36 | 37 |
(...skipping 615 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
652 content_type == CONTENT_SETTINGS_TYPE_MIDI_SYSEX) { | 653 content_type == CONTENT_SETTINGS_TYPE_MIDI_SYSEX) { |
653 return false; | 654 return false; |
654 } | 655 } |
655 #if defined(OS_ANDROID) || defined(OS_CHROMEOS) | 656 #if defined(OS_ANDROID) || defined(OS_CHROMEOS) |
656 if (content_type == CONTENT_SETTINGS_TYPE_PROTECTED_MEDIA_IDENTIFIER) { | 657 if (content_type == CONTENT_SETTINGS_TYPE_PROTECTED_MEDIA_IDENTIFIER) { |
657 return false; | 658 return false; |
658 } | 659 } |
659 #endif | 660 #endif |
660 if (secondary_url.SchemeIs(kChromeUIScheme) && | 661 if (secondary_url.SchemeIs(kChromeUIScheme) && |
661 content_type == CONTENT_SETTINGS_TYPE_COOKIES && | 662 content_type == CONTENT_SETTINGS_TYPE_COOKIES && |
662 primary_url.SchemeIsSecure()) { | 663 IsOriginSecure(primary_url)) { |
663 return true; | 664 return true; |
664 } | 665 } |
665 #if defined(ENABLE_EXTENSIONS) | 666 #if defined(ENABLE_EXTENSIONS) |
666 if (primary_url.SchemeIs(kExtensionScheme)) { | 667 if (primary_url.SchemeIs(kExtensionScheme)) { |
667 switch (content_type) { | 668 switch (content_type) { |
668 case CONTENT_SETTINGS_TYPE_PLUGINS: | 669 case CONTENT_SETTINGS_TYPE_PLUGINS: |
669 case CONTENT_SETTINGS_TYPE_MEDIASTREAM: | 670 case CONTENT_SETTINGS_TYPE_MEDIASTREAM: |
670 case CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC: | 671 case CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC: |
671 case CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA: | 672 case CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA: |
672 return false; | 673 return false; |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
769 } | 770 } |
770 } | 771 } |
771 | 772 |
772 if (info) { | 773 if (info) { |
773 info->source = content_settings::SETTING_SOURCE_NONE; | 774 info->source = content_settings::SETTING_SOURCE_NONE; |
774 info->primary_pattern = ContentSettingsPattern(); | 775 info->primary_pattern = ContentSettingsPattern(); |
775 info->secondary_pattern = ContentSettingsPattern(); | 776 info->secondary_pattern = ContentSettingsPattern(); |
776 } | 777 } |
777 return scoped_ptr<base::Value>(); | 778 return scoped_ptr<base::Value>(); |
778 } | 779 } |
OLD | NEW |