1 | /* |
2 | * Copyright (C) 2009-2017 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 | * |
14 | * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY |
15 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
16 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
17 | * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY |
18 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
19 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
20 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND |
21 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
22 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
23 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
24 | */ |
25 | |
26 | #pragma once |
27 | |
28 | #include <wtf/Forward.h> |
29 | |
30 | namespace WebCore { |
31 | |
32 | WEBCORE_EXPORT void setPresentingApplicationPID(int); |
33 | WEBCORE_EXPORT int presentingApplicationPID(); |
34 | |
35 | #if PLATFORM(WIN) |
36 | inline bool isInWebProcess() { return false; } |
37 | #elif !PLATFORM(COCOA) |
38 | inline bool isInWebProcess() { return true; } |
39 | #endif |
40 | |
41 | #if PLATFORM(COCOA) |
42 | |
43 | bool isInWebProcess(); |
44 | |
45 | WEBCORE_EXPORT void setApplicationSDKVersion(uint32_t); |
46 | uint32_t applicationSDKVersion(); |
47 | |
48 | WEBCORE_EXPORT void setApplicationBundleIdentifier(const String&); |
49 | String applicationBundleIdentifier(); |
50 | |
51 | #if PLATFORM(MAC) |
52 | |
53 | namespace MacApplication { |
54 | |
55 | WEBCORE_EXPORT bool isAOLInstantMessenger(); |
56 | WEBCORE_EXPORT bool isAdobeInstaller(); |
57 | WEBCORE_EXPORT bool isAperture(); |
58 | WEBCORE_EXPORT bool isAppleMail(); |
59 | WEBCORE_EXPORT bool isIBooks(); |
60 | WEBCORE_EXPORT bool isITunes(); |
61 | WEBCORE_EXPORT bool isMicrosoftMessenger(); |
62 | WEBCORE_EXPORT bool isMicrosoftMyDay(); |
63 | WEBCORE_EXPORT bool isMicrosoftOutlook(); |
64 | bool isQuickenEssentials(); |
65 | WEBCORE_EXPORT bool isSafari(); |
66 | bool isSolidStateNetworksDownloader(); |
67 | WEBCORE_EXPORT bool isVersions(); |
68 | WEBCORE_EXPORT bool isHRBlock(); |
69 | WEBCORE_EXPORT bool isIAdProducer(); |
70 | |
71 | } // MacApplication |
72 | |
73 | #endif // PLATFORM(MAC) |
74 | |
75 | #if PLATFORM(IOS_FAMILY) |
76 | |
77 | namespace IOSApplication { |
78 | |
79 | WEBCORE_EXPORT bool isMobileMail(); |
80 | WEBCORE_EXPORT bool isMobileSafari(); |
81 | WEBCORE_EXPORT bool isWebBookmarksD(); |
82 | WEBCORE_EXPORT bool isDumpRenderTree(); |
83 | bool isMobileStore(); |
84 | bool isSpringBoard(); |
85 | WEBCORE_EXPORT bool isWebApp(); |
86 | WEBCORE_EXPORT bool isWebProcess(); |
87 | WEBCORE_EXPORT bool isIBooks(); |
88 | bool isIBooksStorytime(); |
89 | WEBCORE_EXPORT bool isTheSecretSocietyHiddenMystery(); |
90 | WEBCORE_EXPORT bool isCardiogram(); |
91 | WEBCORE_EXPORT bool isNike(); |
92 | bool isMoviStarPlus(); |
93 | WEBCORE_EXPORT bool isFirefox(); |
94 | WEBCORE_EXPORT bool isAppleApplication(); |
95 | |
96 | } // IOSApplication |
97 | |
98 | #endif // PLATFORM(IOS_FAMILY) |
99 | |
100 | #endif // PLATFORM(COCOA) |
101 | |
102 | } // namespace WebCore |
103 | |