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 21 matching lines...) Expand all Loading... |
32 #include "base/trace_event/memory_dump_manager.h" | 32 #include "base/trace_event/memory_dump_manager.h" |
33 #include "base/trace_event/trace_event.h" | 33 #include "base/trace_event/trace_event.h" |
34 #include "blink/public/resources/grit/blink_image_resources.h" | 34 #include "blink/public/resources/grit/blink_image_resources.h" |
35 #include "blink/public/resources/grit/blink_resources.h" | 35 #include "blink/public/resources/grit/blink_resources.h" |
36 #include "build/build_config.h" | 36 #include "build/build_config.h" |
37 #include "components/mime_util/mime_util.h" | 37 #include "components/mime_util/mime_util.h" |
38 #include "content/app/resources/grit/content_resources.h" | 38 #include "content/app/resources/grit/content_resources.h" |
39 #include "content/app/strings/grit/content_strings.h" | 39 #include "content/app/strings/grit/content_strings.h" |
40 #include "content/child/child_thread_impl.h" | 40 #include "content/child/child_thread_impl.h" |
41 #include "content/child/content_child_helpers.h" | 41 #include "content/child/content_child_helpers.h" |
| 42 #include "content/child/feature_policy/feature_policy_platform.h" |
42 #include "content/child/notifications/notification_dispatcher.h" | 43 #include "content/child/notifications/notification_dispatcher.h" |
43 #include "content/child/notifications/notification_manager.h" | 44 #include "content/child/notifications/notification_manager.h" |
44 #include "content/child/push_messaging/push_dispatcher.h" | 45 #include "content/child/push_messaging/push_dispatcher.h" |
45 #include "content/child/push_messaging/push_provider.h" | 46 #include "content/child/push_messaging/push_provider.h" |
46 #include "content/child/thread_safe_sender.h" | 47 #include "content/child/thread_safe_sender.h" |
47 #include "content/child/web_url_loader_impl.h" | 48 #include "content/child/web_url_loader_impl.h" |
48 #include "content/child/web_url_request_util.h" | 49 #include "content/child/web_url_request_util.h" |
49 #include "content/child/worker_thread_registry.h" | 50 #include "content/child/worker_thread_registry.h" |
50 #include "content/public/common/content_client.h" | 51 #include "content/public/common/content_client.h" |
51 #include "content/public/common/service_manager_connection.h" | 52 #include "content/public/common/service_manager_connection.h" |
(...skipping 797 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
849 WebString BlinkPlatformImpl::domKeyStringFromEnum(int dom_key) { | 850 WebString BlinkPlatformImpl::domKeyStringFromEnum(int dom_key) { |
850 return WebString::fromUTF8(ui::KeycodeConverter::DomKeyToKeyString( | 851 return WebString::fromUTF8(ui::KeycodeConverter::DomKeyToKeyString( |
851 static_cast<ui::DomKey>(dom_key))); | 852 static_cast<ui::DomKey>(dom_key))); |
852 } | 853 } |
853 | 854 |
854 int BlinkPlatformImpl::domKeyEnumFromString(const WebString& key_string) { | 855 int BlinkPlatformImpl::domKeyEnumFromString(const WebString& key_string) { |
855 return static_cast<int>( | 856 return static_cast<int>( |
856 ui::KeycodeConverter::KeyStringToDomKey(key_string.utf8())); | 857 ui::KeycodeConverter::KeyStringToDomKey(key_string.utf8())); |
857 } | 858 } |
858 | 859 |
| 860 blink::WebFeaturePolicy* BlinkPlatformImpl::createFeaturePolicy( |
| 861 const blink::WebFeaturePolicy* parentPolicy, |
| 862 const blink::WebParsedFeaturePolicyHeader& policyHeader, |
| 863 const blink::WebSecurityOrigin& origin) { |
| 864 std::unique_ptr<FeaturePolicy> policy = FeaturePolicy::CreateFromParentPolicy( |
| 865 static_cast<const FeaturePolicy*>(parentPolicy), url::Origin(origin)); |
| 866 policy->SetHeaderPolicy(FeaturePolicyHeaderFromWeb(policyHeader)); |
| 867 return policy.release(); |
| 868 } |
| 869 |
| 870 bool BlinkPlatformImpl::isFeatureEnabledByPolicy( |
| 871 const blink::WebFeaturePolicy* policy, |
| 872 blink::WebFeaturePolicyFeature feature, |
| 873 const blink::WebSecurityOrigin& origin) { |
| 874 // if (!policy) |
| 875 // return FeaturePolicy::IsFeatureAllowedByDefault(""); |
| 876 return static_cast<const FeaturePolicy*>(policy)->IsFeatureEnabledForOrigin( |
| 877 feature, url::Origin(origin)); |
| 878 } |
| 879 |
859 } // namespace content | 880 } // namespace content |
OLD | NEW |