[iOS] Show external device name/type in placeholder
[WebKit-https.git] / Source / WebKit / mac / WebCoreSupport / WebSystemInterface.mm
1 /*
2  * Copyright 2006, 2007, 2008, 2009, 2010, 2011 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  *
8  * 1.  Redistributions of source code must retain the above copyright
9  *     notice, this list of conditions and the following disclaimer. 
10  * 2.  Redistributions in binary form must reproduce the above copyright
11  *     notice, this list of conditions and the following disclaimer in the
12  *     documentation and/or other materials provided with the distribution. 
13  * 3.  Neither the name of Apple Computer, Inc. ("Apple") nor the names of
14  *     its contributors may be used to endorse or promote products derived
15  *     from this software without specific prior written permission. 
16  *
17  * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
18  * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
19  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20  * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
21  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
22  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
23  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
24  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27  */
28
29 #import "WebSystemInterface.h"
30
31 // Needed for builds not using PCH to expose BUILDING_ macros, see bug 32753.
32 #include <wtf/Platform.h>
33
34 #import <WebCore/WebCoreSystemInterface.h>
35 #import <WebKitSystemInterface.h>
36
37 #define INIT(function) wk##function = WK##function
38
39 void InitWebCoreSystemInterface(void)
40 {
41     static bool didInit;
42     if (didInit)
43         return;
44
45 #if !PLATFORM(IOS)
46     INIT(AdvanceDefaultButtonPulseAnimation);
47 #endif
48     INIT(CALayerEnumerateRectsBeingDrawnWithBlock);
49 #if !PLATFORM(IOS)
50     INIT(CGContextGetShouldSmoothFonts);
51 #endif
52     INIT(CGPatternCreateWithImageAndTransform);
53     INIT(CGContextResetClip);
54 #if !PLATFORM(IOS)
55     INIT(CGContextDrawsWithCorrectShadowOffsets);
56 #endif
57 #if PLATFORM(IOS) || __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090
58     INIT(CTFontTransformGlyphs);
59 #endif
60     INIT(CopyCFLocalizationPreferredName);
61     INIT(CopyCONNECTProxyResponse);
62     INIT(CopyNSURLResponseStatusLine);
63     INIT(CopyNSURLResponseCertificateChain);
64     INIT(CreateCustomCFReadStream);
65 #if !PLATFORM(IOS)
66     INIT(DrawCapsLockIndicator);
67     INIT(DrawBezeledTextArea);
68     INIT(DrawBezeledTextFieldCell);
69     INIT(DrawFocusRing);
70     INIT(DrawMediaUIPart);
71     INIT(DrawMediaSliderTrack);
72     INIT(DrawTextFieldCellFocusRing);
73     INIT(GetExtensionsForMIMEType);
74     INIT(GetFontInLanguageForCharacter);
75     INIT(GetFontInLanguageForRange);
76     INIT(GetGlyphTransformedAdvances);
77 #endif
78     INIT(GetHTTPRequestPriority);
79     INIT(GetMIMETypeForExtension);
80     INIT(GetNSURLResponseLastModifiedDate);
81 #if !PLATFORM(IOS)
82     INIT(SignedPublicKeyAndChallengeString);
83     INIT(GetPreferredExtensionForMIMEType);
84     INIT(GetWheelEventDeltas);
85     INIT(GetNSEventKeyChar);
86     INIT(HitTestMediaUIPart);
87 #endif
88     INIT(InitializeMaximumHTTPConnectionCountPerHost);
89 #if !PLATFORM(IOS)
90     INIT(MeasureMediaUIPart);
91     INIT(CreateMediaUIBackgroundView);
92     INIT(CreateMediaUIControl);
93     INIT(WindowSetAlpha);
94     INIT(WindowSetScaledFrame);
95     INIT(PopupMenu);
96     INIT(SetCGFontRenderingMode);
97 #endif
98     INIT(SetBaseCTM);
99     INIT(SetCONNECTProxyAuthorizationForStream);
100     INIT(SetCONNECTProxyForStream);
101 #if !PLATFORM(IOS)
102     INIT(SetDragImage);
103 #endif
104     INIT(SetHTTPRequestMaximumPriority);
105     INIT(SetHTTPRequestPriority);
106     INIT(SetHTTPRequestMinimumFastLanePriority);
107     INIT(HTTPRequestEnablePipelining);
108     INIT(SetNSURLConnectionDefersCallbacks);
109     INIT(SetNSURLRequestShouldContentSniff);
110     INIT(SetPatternPhaseInUserSpace);
111     INIT(CGContextIsPDFContext);
112     INIT(GetUserToBaseCTM);
113     INIT(SetUpFontCache);
114     INIT(SignalCFReadStreamEnd);
115     INIT(SignalCFReadStreamError);
116     INIT(SignalCFReadStreamHasBytes);
117 #if ENABLE(VIDEO) && !PLATFORM(IOS)
118     INIT(QTIncludeOnlyModernMediaFileTypes);
119     INIT(QTMovieDataRate);
120     INIT(QTMovieDisableComponent);
121     INIT(QTMovieMaxTimeLoaded);
122     INIT(QTMovieMaxTimeLoadedChangeNotification);
123     INIT(QTMovieMaxTimeSeekable);
124     INIT(QTMovieGetType);
125     INIT(QTMovieHasClosedCaptions);
126     INIT(QTMovieResolvedURL);
127     INIT(QTMovieSetShowClosedCaptions);
128     INIT(QTMovieSelectPreferredAlternates);
129     INIT(QTMovieViewSetDrawSynchronously);
130     INIT(QTGetSitesInMediaDownloadCache);
131     INIT(QTClearMediaDownloadCacheForSite);
132     INIT(QTClearMediaDownloadCache);
133 #endif
134
135 #if !PLATFORM(IOS)
136     INIT(GetGlyphsForCharacters);
137 #endif
138     INIT(GetVerticalGlyphsForCharacters);
139 #if PLATFORM(IOS)
140     INIT(ExecutableWasLinkedOnOrAfterIOSVersion);
141     INIT(GetDeviceClass);
142     INIT(GetViewportScreenSize);
143     INIT(GetScreenScaleFactor);
144     INIT(IsGB18030ComplianceRequired);
145 #endif
146
147     INIT(CreateCTLineWithUniCharProvider);
148
149 #if !PLATFORM(IOS_SIMULATOR)
150     INIT(IOSurfaceContextCreate);
151     INIT(IOSurfaceContextCreateImage);
152 #endif
153     INIT(CreateCTTypesetterWithUniCharProviderAndOptions);
154     INIT(CTRunGetInitialAdvance);
155 #if PLATFORM(MAC) || PLATFORM(IOS_SIMULATOR)
156     INIT(SetCrashReportApplicationSpecificInformation);
157 #endif
158 #if !PLATFORM(IOS)
159     INIT(RecommendedScrollerStyle);
160     INIT(ExecutableWasLinkedOnOrBeforeSnowLeopard);
161     INIT(CopyDefaultSearchProviderDisplayName);
162     INIT(AVAssetResolvedURL);
163     INIT(Cursor);
164 #endif
165
166 #if USE(CFNETWORK)
167     INIT(GetDefaultHTTPCookieStorage);
168     INIT(CopyCredentialFromCFPersistentStorage);
169     INIT(SetCFURLRequestShouldContentSniff);
170     INIT(CFURLRequestCopyHTTPRequestBodyParts);
171     INIT(CFURLRequestSetHTTPRequestBodyParts);
172     INIT(SetRequestStorageSession);
173 #endif
174
175 #if !PLATFORM(IOS)
176     INIT(SpeechSynthesisGetVoiceIdentifiers);
177     INIT(SpeechSynthesisGetDefaultVoiceIdentifierForLocale);
178     INIT(GetAXTextMarkerTypeID);
179     INIT(GetAXTextMarkerRangeTypeID);
180     INIT(CreateAXTextMarker);
181     INIT(GetBytesFromAXTextMarker);
182     INIT(CreateAXTextMarkerRange);
183     INIT(CopyAXTextMarkerRangeStart);
184     INIT(CopyAXTextMarkerRangeEnd);
185     INIT(AccessibilityHandleFocusChanged);
186     INIT(CreateAXUIElementRef);
187     INIT(UnregisterUniqueIdForElement);
188 #endif
189     INIT(CreatePrivateStorageSession);
190     INIT(CopyRequestWithStorageSession);
191     INIT(CopyHTTPCookieStorage);
192     INIT(GetHTTPCookieAcceptPolicy);
193     INIT(HTTPCookies);
194     INIT(HTTPCookiesForURL);
195     INIT(SetHTTPCookiesForURL);
196     INIT(DeleteAllHTTPCookies);
197     INIT(DeleteHTTPCookie);
198
199     INIT(GetCFURLResponseMIMEType);
200     INIT(GetCFURLResponseURL);
201     INIT(GetCFURLResponseHTTPResponse);
202     INIT(CopyCFURLResponseSuggestedFilename);
203     INIT(SetCFURLResponseMIMEType);
204
205 #if !PLATFORM(IOS)
206     INIT(SetMetadataURL);
207 #endif
208
209     INIT(DestroyRenderingResources);
210
211 #if !PLATFORM(IOS)
212     INIT(CreateVMPressureDispatchOnMainQueue);
213
214 #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090
215     INIT(CreateMemoryStatusPressureCriticalDispatchOnMainQueue);
216 #endif
217
218     INIT(ExecutableWasLinkedOnOrBeforeLion);
219 #endif
220
221     INIT(CGPathAddRoundedRect);
222
223     INIT(CFURLRequestAllowAllPostCaching);
224
225 #if PLATFORM(IOS)
226     INIT(GetUserAgent);
227     INIT(GetDeviceName);
228     INIT(GetOSNameForUserAgent);
229     INIT(GetPlatformNameForNavigator);
230     INIT(GetVendorNameForNavigator);
231 #endif
232
233 #if !PLATFORM(IOS)
234     INIT(NSElasticDeltaForTimeDelta);
235     INIT(NSElasticDeltaForReboundDelta);
236     INIT(NSReboundDeltaForElasticDelta);
237 #endif
238
239 #if ENABLE(PUBLIC_SUFFIX_LIST)
240     INIT(IsPublicSuffix);
241 #endif
242
243 #if ENABLE(CACHE_PARTITIONING)
244     INIT(CachePartitionKey);
245 #endif
246
247     INIT(ExernalDeviceTypeForPlayer);
248     INIT(ExernalDeviceDisplayNameForPlayer);
249
250     didInit = true;
251 }