blob: 9f88154f25d5abebfbf2ed1e688105b8a42eb863 [file] [log] [blame]
ddkilzer@apple.com8b32f3f2009-04-27 23:06:46 +00001/*
aestes@apple.comed8cafe2017-05-16 06:06:58 +00002 * Copyright (C) 2009-2017 Apple Inc. All rights reserved.
ddkilzer@apple.com8b32f3f2009-04-27 23:06:46 +00003 *
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
aestes@apple.comed8cafe2017-05-16 06:06:58 +000026#pragma once
ddkilzer@apple.com8b32f3f2009-04-27 23:06:46 +000027
cdumez@apple.comb35e2be2016-03-04 06:00:02 +000028#include <wtf/Forward.h>
29
ddkilzer@apple.com8b32f3f2009-04-27 23:06:46 +000030namespace WebCore {
31
aestes@apple.comed8cafe2017-05-16 06:06:58 +000032WEBCORE_EXPORT void setPresentingApplicationPID(int);
33WEBCORE_EXPORT int presentingApplicationPID();
34
rniwa@webkit.org568c8342017-12-12 06:30:34 +000035#if PLATFORM(WIN)
36inline bool isInWebProcess() { return false; }
jbedard@apple.come1c948c2018-07-03 16:50:57 +000037#elif !PLATFORM(COCOA)
38inline bool isInWebProcess() { return true; }
rniwa@webkit.org568c8342017-12-12 06:30:34 +000039#endif
40
aestes@apple.comed8cafe2017-05-16 06:06:58 +000041#if PLATFORM(COCOA)
42
jbedard@apple.come1c948c2018-07-03 16:50:57 +000043bool isInWebProcess();
achristensen@apple.com66b119e2019-10-04 19:33:00 +000044bool isInNetworkProcess();
jbedard@apple.come1c948c2018-07-03 16:50:57 +000045
achristensen@apple.com84fc9522018-08-01 03:57:07 +000046WEBCORE_EXPORT void setApplicationSDKVersion(uint32_t);
commit-queue@webkit.orgc9914a42019-08-09 20:20:49 +000047WEBCORE_EXPORT uint32_t applicationSDKVersion();
achristensen@apple.com84fc9522018-08-01 03:57:07 +000048
cdumez@apple.comb35e2be2016-03-04 06:00:02 +000049WEBCORE_EXPORT void setApplicationBundleIdentifier(const String&);
pvollan@apple.com8ee789b2020-01-06 16:03:44 +000050WEBCORE_EXPORT String applicationBundleIdentifier();
ddkilzer@apple.com8b32f3f2009-04-27 23:06:46 +000051
cdumez@apple.com0b0e88f2016-03-06 03:28:54 +000052#if PLATFORM(MAC)
53
54namespace MacApplication {
55
56WEBCORE_EXPORT bool isAOLInstantMessenger();
57WEBCORE_EXPORT bool isAdobeInstaller();
58WEBCORE_EXPORT bool isAperture();
59WEBCORE_EXPORT bool isAppleMail();
60WEBCORE_EXPORT bool isIBooks();
61WEBCORE_EXPORT bool isITunes();
62WEBCORE_EXPORT bool isMicrosoftMessenger();
63WEBCORE_EXPORT bool isMicrosoftMyDay();
64WEBCORE_EXPORT bool isMicrosoftOutlook();
65bool isQuickenEssentials();
66WEBCORE_EXPORT bool isSafari();
67bool isSolidStateNetworksDownloader();
68WEBCORE_EXPORT bool isVersions();
69WEBCORE_EXPORT bool isHRBlock();
cdumez@apple.comb76ce7b2017-02-21 23:25:49 +000070WEBCORE_EXPORT bool isIAdProducer();
commit-queue@webkit.orgd5f0db92019-11-04 18:20:56 +000071WEBCORE_EXPORT bool isEpsonSoftwareUpdater();
cdumez@apple.com0b0e88f2016-03-06 03:28:54 +000072
73} // MacApplication
74
75#endif // PLATFORM(MAC)
76
ap@apple.com1e8475922018-10-18 21:38:50 +000077#if PLATFORM(IOS_FAMILY)
cdumez@apple.com0b0e88f2016-03-06 03:28:54 +000078
79namespace IOSApplication {
80
81WEBCORE_EXPORT bool isMobileMail();
wenson_hsieh@apple.com4cbbea32019-08-27 14:59:32 +000082WEBCORE_EXPORT bool isMailCompositionService();
cdumez@apple.com0b0e88f2016-03-06 03:28:54 +000083WEBCORE_EXPORT bool isMobileSafari();
jiewen_tan@apple.com19b3fc12019-09-03 18:56:10 +000084WEBCORE_EXPORT bool isSafariViewService();
commit-queue@webkit.orgc9914a42019-08-09 20:20:49 +000085WEBCORE_EXPORT bool isIMDb();
achristensen@apple.com62045652016-07-19 02:02:37 +000086WEBCORE_EXPORT bool isWebBookmarksD();
dbates@webkit.org4830e012018-09-28 23:02:41 +000087WEBCORE_EXPORT bool isDumpRenderTree();
cdumez@apple.com0b0e88f2016-03-06 03:28:54 +000088bool isMobileStore();
ddkilzer@apple.com84e20582018-04-28 05:53:03 +000089bool isSpringBoard();
cdumez@apple.com0b0e88f2016-03-06 03:28:54 +000090WEBCORE_EXPORT bool isWebProcess();
antti@apple.com1aad67b2018-10-31 15:08:26 +000091WEBCORE_EXPORT bool isIBooks();
commit-queue@webkit.org8e6a8692017-07-16 21:36:54 +000092bool isIBooksStorytime();
wilander@apple.com4827ffc2016-06-23 16:35:17 +000093WEBCORE_EXPORT bool isTheSecretSocietyHiddenMystery();
dbates@webkit.org2e7f9fc2018-01-17 19:09:21 +000094WEBCORE_EXPORT bool isCardiogram();
dbates@webkit.org05bd87b2018-02-05 20:46:46 +000095WEBCORE_EXPORT bool isNike();
achristensen@apple.com84fc9522018-08-01 03:57:07 +000096bool isMoviStarPlus();
timothy_horton@apple.com35b29992019-01-11 23:30:07 +000097WEBCORE_EXPORT bool isFirefox();
wenson_hsieh@apple.com5e1df602019-04-13 03:54:10 +000098WEBCORE_EXPORT bool isAppleApplication();
dbates@webkit.org57ed60e2019-06-21 00:49:14 +000099WEBCORE_EXPORT bool isEvernote();
antti@apple.com67312552019-09-11 17:29:25 +0000100WEBCORE_EXPORT bool isEventbrite();
wenson_hsieh@apple.com8738a422019-09-25 16:01:38 +0000101WEBCORE_EXPORT bool isDataActivation();
cdumez@apple.com0b0e88f2016-03-06 03:28:54 +0000102
103} // IOSApplication
104
ap@apple.com1e8475922018-10-18 21:38:50 +0000105#endif // PLATFORM(IOS_FAMILY)
cdumez@apple.com0b0e88f2016-03-06 03:28:54 +0000106
achristensen@apple.com66b119e2019-10-04 19:33:00 +0000107#else
108
109inline bool isInNetworkProcess() { return false; }
110
cdumez@apple.com0b0e88f2016-03-06 03:28:54 +0000111#endif // PLATFORM(COCOA)
112
aestes@apple.comed8cafe2017-05-16 06:06:58 +0000113} // namespace WebCore