1 | /* |
2 | * Copyright (C) 2013 Apple Inc. All rights reserved. |
3 | * |
4 | * Redistribution and use in source and binary forms, with or without |
5 | * modification, are permitted provided that the following conditions |
6 | * are met: |
7 | * 1. Redistributions of source code must retain the above copyright |
8 | * notice, this list of conditions and the following disclaimer. |
9 | * 2. Redistributions in binary form must reproduce the above copyright |
10 | * notice, this list of conditions and the following disclaimer in the |
11 | * documentation and/or other materials provided with the distribution. |
12 | * |
13 | * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' |
14 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, |
15 | * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR |
16 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS |
17 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
18 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
19 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
20 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
21 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
22 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF |
23 | * THE POSSIBILITY OF SUCH DAMAGE. |
24 | */ |
25 | |
26 | #include "config.h" |
27 | #include "WKPluginInformation.h" |
28 | |
29 | #include "APIString.h" |
30 | #include "PluginInformation.h" |
31 | #include "WKSharedAPICast.h" |
32 | |
33 | WKStringRef WKPluginInformationBundleIdentifierKey() |
34 | { |
35 | #if ENABLE(NETSCAPE_PLUGIN_API) |
36 | static API::String& key = API::String::create(WebKit::pluginInformationBundleIdentifierKey()).leakRef(); |
37 | return WebKit::toAPI(&key); |
38 | #else |
39 | return 0; |
40 | #endif |
41 | } |
42 | |
43 | WKStringRef WKPluginInformationBundleVersionKey() |
44 | { |
45 | #if ENABLE(NETSCAPE_PLUGIN_API) |
46 | static API::String& key = API::String::create(WebKit::pluginInformationBundleVersionKey()).leakRef(); |
47 | return WebKit::toAPI(&key); |
48 | #else |
49 | return 0; |
50 | #endif |
51 | } |
52 | |
53 | WKStringRef WKPluginInformationBundleShortVersionKey() |
54 | { |
55 | #if ENABLE(NETSCAPE_PLUGIN_API) |
56 | static API::String& key = API::String::create(WebKit::pluginInformationBundleShortVersionKey()).leakRef(); |
57 | return WebKit::toAPI(&key); |
58 | #else |
59 | return 0; |
60 | #endif |
61 | } |
62 | |
63 | WKStringRef WKPluginInformationPathKey() |
64 | { |
65 | #if ENABLE(NETSCAPE_PLUGIN_API) |
66 | static API::String& key = API::String::create(WebKit::pluginInformationPathKey()).leakRef(); |
67 | return WebKit::toAPI(&key); |
68 | #else |
69 | return 0; |
70 | #endif |
71 | } |
72 | |
73 | WKStringRef WKPluginInformationDisplayNameKey() |
74 | { |
75 | #if ENABLE(NETSCAPE_PLUGIN_API) |
76 | static API::String& key = API::String::create(WebKit::pluginInformationDisplayNameKey()).leakRef(); |
77 | return WebKit::toAPI(&key); |
78 | #else |
79 | return 0; |
80 | #endif |
81 | } |
82 | |
83 | WKStringRef WKPluginInformationDefaultLoadPolicyKey() |
84 | { |
85 | #if ENABLE(NETSCAPE_PLUGIN_API) |
86 | static API::String& key = API::String::create(WebKit::pluginInformationDefaultLoadPolicyKey()).leakRef(); |
87 | return WebKit::toAPI(&key); |
88 | #else |
89 | return 0; |
90 | #endif |
91 | } |
92 | |
93 | WKStringRef WKPluginInformationUpdatePastLastBlockedVersionIsKnownAvailableKey() |
94 | { |
95 | #if ENABLE(NETSCAPE_PLUGIN_API) |
96 | static API::String& key = API::String::create(WebKit::pluginInformationUpdatePastLastBlockedVersionIsKnownAvailableKey()).leakRef(); |
97 | return WebKit::toAPI(&key); |
98 | #else |
99 | return 0; |
100 | #endif |
101 | } |
102 | |
103 | WKStringRef WKPluginInformationHasSandboxProfileKey() |
104 | { |
105 | #if ENABLE(NETSCAPE_PLUGIN_API) |
106 | static API::String& key = API::String::create(WebKit::pluginInformationHasSandboxProfileKey()).leakRef(); |
107 | return WebKit::toAPI(&key); |
108 | #else |
109 | return 0; |
110 | #endif |
111 | } |
112 | |
113 | WKStringRef WKPluginInformationFrameURLKey() |
114 | { |
115 | #if ENABLE(NETSCAPE_PLUGIN_API) |
116 | static API::String& key = API::String::create(WebKit::pluginInformationFrameURLKey()).leakRef(); |
117 | return WebKit::toAPI(&key); |
118 | #else |
119 | return 0; |
120 | #endif |
121 | } |
122 | |
123 | WKStringRef WKPluginInformationMIMETypeKey() |
124 | { |
125 | #if ENABLE(NETSCAPE_PLUGIN_API) |
126 | static API::String& key = API::String::create(WebKit::pluginInformationMIMETypeKey()).leakRef(); |
127 | return WebKit::toAPI(&key); |
128 | #else |
129 | return 0; |
130 | #endif |
131 | } |
132 | |
133 | WKStringRef WKPluginInformationPageURLKey() |
134 | { |
135 | #if ENABLE(NETSCAPE_PLUGIN_API) |
136 | static API::String& key = API::String::create(WebKit::pluginInformationPageURLKey()).leakRef(); |
137 | return WebKit::toAPI(&key); |
138 | #else |
139 | return 0; |
140 | #endif |
141 | } |
142 | |
143 | WKStringRef WKPluginInformationPluginspageAttributeURLKey() |
144 | { |
145 | #if ENABLE(NETSCAPE_PLUGIN_API) |
146 | static API::String& key = API::String::create(WebKit::pluginInformationPluginspageAttributeURLKey()).leakRef(); |
147 | return WebKit::toAPI(&key); |
148 | #else |
149 | return 0; |
150 | #endif |
151 | } |
152 | |
153 | WKStringRef WKPluginInformationPluginURLKey() |
154 | { |
155 | #if ENABLE(NETSCAPE_PLUGIN_API) |
156 | static API::String& key = API::String::create(WebKit::pluginInformationPluginURLKey()).leakRef(); |
157 | return WebKit::toAPI(&key); |
158 | #else |
159 | return 0; |
160 | #endif |
161 | } |
162 | |
163 | WKStringRef WKPlugInInformationReplacementObscuredKey() |
164 | { |
165 | #if ENABLE(NETSCAPE_PLUGIN_API) |
166 | static API::String& key = API::String::create(WebKit::plugInInformationReplacementObscuredKey()).leakRef(); |
167 | return WebKit::toAPI(&key); |
168 | #else |
169 | return 0; |
170 | #endif |
171 | } |
172 | |