| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "content/child/blink_platform_impl.h" | 5 #include "content/child/blink_platform_impl.h" |
| 6 | 6 |
| 7 #include <math.h> | 7 #include <math.h> |
| 8 | 8 |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 844 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 855 int BlinkPlatformImpl::domKeyEnumFromString(const WebString& key_string) { | 855 int BlinkPlatformImpl::domKeyEnumFromString(const WebString& key_string) { |
| 856 return static_cast<int>( | 856 return static_cast<int>( |
| 857 ui::KeycodeConverter::KeyStringToDomKey(key_string.utf8())); | 857 ui::KeycodeConverter::KeyStringToDomKey(key_string.utf8())); |
| 858 } | 858 } |
| 859 | 859 |
| 860 blink::WebFeaturePolicy* BlinkPlatformImpl::createFeaturePolicy( | 860 blink::WebFeaturePolicy* BlinkPlatformImpl::createFeaturePolicy( |
| 861 const blink::WebFeaturePolicy* parentPolicy, | 861 const blink::WebFeaturePolicy* parentPolicy, |
| 862 const blink::WebParsedFeaturePolicyHeader& policyHeader, | 862 const blink::WebParsedFeaturePolicyHeader& policyHeader, |
| 863 const blink::WebSecurityOrigin& origin) { | 863 const blink::WebSecurityOrigin& origin) { |
| 864 std::unique_ptr<FeaturePolicy> policy = FeaturePolicy::CreateFromParentPolicy( | 864 std::unique_ptr<FeaturePolicy> policy = FeaturePolicy::CreateFromParentPolicy( |
| 865 static_cast<const FeaturePolicy*>(parentPolicy), url::Origin(origin)); | 865 static_cast<const FeaturePolicy*>(parentPolicy), nullptr, |
| 866 url::Origin(origin)); |
| 866 policy->SetHeaderPolicy(FeaturePolicyHeaderFromWeb(policyHeader)); | 867 policy->SetHeaderPolicy(FeaturePolicyHeaderFromWeb(policyHeader)); |
| 867 return policy.release(); | 868 return policy.release(); |
| 868 } | 869 } |
| 869 | 870 |
| 870 bool BlinkPlatformImpl::isFeatureEnabledByPolicy( | 871 bool BlinkPlatformImpl::isFeatureEnabledByPolicy( |
| 871 const blink::WebFeaturePolicy* policy, | 872 const blink::WebFeaturePolicy* policy, |
| 872 blink::WebFeaturePolicyFeature feature, | 873 blink::WebFeaturePolicyFeature feature, |
| 873 const blink::WebSecurityOrigin& origin) { | 874 const blink::WebSecurityOrigin& origin) { |
| 874 // if (!policy) | 875 // if (!policy) |
| 875 // return FeaturePolicy::IsFeatureAllowedByDefault(""); | 876 // return FeaturePolicy::IsFeatureAllowedByDefault(""); |
| 876 return static_cast<const FeaturePolicy*>(policy)->IsFeatureEnabledForOrigin( | 877 return static_cast<const FeaturePolicy*>(policy)->IsFeatureEnabledForOrigin( |
| 877 feature, url::Origin(origin)); | 878 feature, url::Origin(origin)); |
| 878 } | 879 } |
| 879 | 880 |
| 880 } // namespace content | 881 } // namespace content |
| OLD | NEW |