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
30namespace WebCore {
31
32WEBCORE_EXPORT void setPresentingApplicationPID(int);
33WEBCORE_EXPORT int presentingApplicationPID();
34
35#if PLATFORM(WIN)
36inline bool isInWebProcess() { return false; }
37#elif !PLATFORM(COCOA)
38inline bool isInWebProcess() { return true; }
39#endif
40
41#if PLATFORM(COCOA)
42
43bool isInWebProcess();
44
45WEBCORE_EXPORT void setApplicationSDKVersion(uint32_t);
46uint32_t applicationSDKVersion();
47
48WEBCORE_EXPORT void setApplicationBundleIdentifier(const String&);
49String applicationBundleIdentifier();
50
51#if PLATFORM(MAC)
52
53namespace MacApplication {
54
55WEBCORE_EXPORT bool isAOLInstantMessenger();
56WEBCORE_EXPORT bool isAdobeInstaller();
57WEBCORE_EXPORT bool isAperture();
58WEBCORE_EXPORT bool isAppleMail();
59WEBCORE_EXPORT bool isIBooks();
60WEBCORE_EXPORT bool isITunes();
61WEBCORE_EXPORT bool isMicrosoftMessenger();
62WEBCORE_EXPORT bool isMicrosoftMyDay();
63WEBCORE_EXPORT bool isMicrosoftOutlook();
64bool isQuickenEssentials();
65WEBCORE_EXPORT bool isSafari();
66bool isSolidStateNetworksDownloader();
67WEBCORE_EXPORT bool isVersions();
68WEBCORE_EXPORT bool isHRBlock();
69WEBCORE_EXPORT bool isIAdProducer();
70
71} // MacApplication
72
73#endif // PLATFORM(MAC)
74
75#if PLATFORM(IOS_FAMILY)
76
77namespace IOSApplication {
78
79WEBCORE_EXPORT bool isMobileMail();
80WEBCORE_EXPORT bool isMobileSafari();
81WEBCORE_EXPORT bool isWebBookmarksD();
82WEBCORE_EXPORT bool isDumpRenderTree();
83bool isMobileStore();
84bool isSpringBoard();
85WEBCORE_EXPORT bool isWebApp();
86WEBCORE_EXPORT bool isWebProcess();
87WEBCORE_EXPORT bool isIBooks();
88bool isIBooksStorytime();
89WEBCORE_EXPORT bool isTheSecretSocietyHiddenMystery();
90WEBCORE_EXPORT bool isCardiogram();
91WEBCORE_EXPORT bool isNike();
92bool isMoviStarPlus();
93WEBCORE_EXPORT bool isFirefox();
94WEBCORE_EXPORT bool isAppleApplication();
95
96} // IOSApplication
97
98#endif // PLATFORM(IOS_FAMILY)
99
100#endif // PLATFORM(COCOA)
101
102} // namespace WebCore
103