12011-11-28 Jon Lee <jonlee@apple.com>
2
3 Create skeleton framework for notifications support in WK2
4 https://bugs.webkit.org/show_bug.cgi?id=73253
5 <rdar://problem/10356943>
6
7 Reviewed by NOBODY (OOPS!).
8
9 * WebKit2.xcodeproj/project.pbxproj: Added classes for notification support.
10 * win/WebKit2.vcproj: Ditto.
11 * Configurations/FeatureDefines.xcconfig: Split out ENABLE_NOTIFICATIONS based on platform.
12 * DerivedSources.make: Add Notifications to VPATH.
13 * Platform/CoreIPC/MessageID.h: List WebNotificationManagerProxy as a class with messages.
14 * Scripts/webkit2/messages.py: Mark WebCore::NotificationContents as a struct.
15
16 * Shared/API/c/WKBase.h: Map opaque types to NotificationProvider, NotificationManager, and Notification.
17 * UIProcess/API/C/WKAPICast.h: Map WK types toNotificationProvider, NotificationManager, and Notification.
18 * Shared/APIObject.h: Add Notification and NotificationManager as APIObjects.
19 * Shared/WebCoreArgumentCoders.cpp: Added coders for KURL.
20 (CoreIPC::::encode):
21 (CoreIPC::::decode):
22 * Shared/WebCoreArgumentCoders.h:
23
24 * UIProcess/WebNotification.cpp: Added.
25 (WebKit::WebNotification::WebNotification):
26 (WebKit::WebNotification::~WebNotification):
27 (WebKit::WebNotification::encode):
28 (WebKit::WebNotification::decode):
29 * UIProcess/WebNotification.h: Added.
30 (WebKit::WebNotification::create):
31 (WebKit::WebNotification::title):
32 (WebKit::WebNotification::body):
33 (WebKit::WebNotification::type):
34 * UIProcess/API/C/WKNotification.cpp: Added as API.
35 (WKNotificationGetTypeID):
36 (WKNotificationCopyTitle):
37 (WKNotificationCopyBody):
38 * UIProcess/API/C/WKNotification.h: Added as API.
39
40 * WebProcess/Notifications/WebNotificationManager.h: Added. Contains for now show() and cancel().
41 The rest of the notification client methods will be added later. These two functions send messages
42 to the manager proxy.
43 * WebProcess/Notifications/WebNotificationManager.cpp: Added.
44 (WebKit::WebNotificationManager::WebNotificationManager):
45 (WebKit::WebNotificationManager::~WebNotificationManager):
46 (WebKit::WebNotificationManager::show):
47 (WebKit::WebNotificationManager::cancel):
48
49 * UIProcess/WebNotificationManagerProxy.cpp: Added.
50 (WebKit::WebNotificationManagerProxy::create):
51 (WebKit::WebNotificationManagerProxy::WebNotificationManagerProxy):
52 (WebKit::WebNotificationManagerProxy::~WebNotificationManagerProxy):
53 (WebKit::WebNotificationManagerProxy::invalidate):
54 (WebKit::WebNotificationManagerProxy::initializeProvider):
55 (WebKit::WebNotificationManagerProxy::didReceiveMessage):
56 (WebKit::WebNotificationManagerProxy::show):
57 (WebKit::WebNotificationManagerProxy::cancel):
58 * UIProcess/WebNotificationManagerProxy.h: Added.
59 (WebKit::WebNotificationManagerProxy::clearContext):
60 (WebKit::WebNotificationManagerProxy::type):
61 * UIProcess/WebNotificationManagerProxy.messages.in: Added.
62 * UIProcess/API/C/WKNotificationManager.cpp: Added.
63 (WKNotificationManagerGetTypeID):
64 (WKNotificationManagerSetProvider):
65 * UIProcess/API/C/WKNotificationManager.h: Added.
66
67 * UIProcess/WebContext.h: Add the notification manager to the web context.
68 (WebKit::WebContext::notificationManagerProxy): Access the manager.
69 * UIProcess/WebContext.cpp:
70 (WebKit::WebContext::WebContext): Boilerplate for managers.
71 (WebKit::WebContext::~WebContext): Boilerplate for managers.
72 (WebKit::WebContext::disconnectProcess): Boilerplate for managers.
73 (WebKit::WebContext::didReceiveMessage): Forward messages to the notification manager.
74 * UIProcess/API/C/WKContext.cpp: Expose as API.
75 (WKContextGetNotificationManager):
76 * UIProcess/API/C/WKContext.h: Expose as API.
77
78 * UIProcess/API/C/WKNotificationProvider.h: Added.
79 * UIProcess/WebNotificationProvider.h: Added as APIClient.
80 * UIProcess/WebNotificationProvider.cpp: Added.
81 (WebKit::WebNotificationProvider::show): Forward call to the client.
82 (WebKit::WebNotificationProvider::cancel): Forward call to the client.
83 * UIProcess/WebProcessProxy.cpp:
84 (WebKit::WebProcessProxy::didReceiveMessage): Forward messages for notification manager to the context.
85
86 * WebProcess/WebCoreSupport/WebChromeClient.cpp: Remove notificationPresenter().
87 * WebProcess/WebCoreSupport/WebChromeClient.h: Remove notificationPresenter().
88
89 * WebProcess/WebCoreSupport/WebNotificationClient.h: Added. Forwards client methods to manager.
90 * WebProcess/WebCoreSupport/WebNotificationClient.cpp: Added. Mostly stub implementation for now.
91 (WebKit::WebNotificationClient::WebNotificationClient):
92 (WebKit::WebNotificationClient::~WebNotificationClient):
93 (WebKit::WebNotificationClient::show):
94 (WebKit::WebNotificationClient::cancel):
95 (WebKit::WebNotificationClient::notificationObjectDestroyed):
96 (WebKit::WebNotificationClient::requestPermission):
97 (WebKit::WebNotificationClient::cancelRequestsForPermission):
98 (WebKit::WebNotificationClient::checkPermission):
99
100 * WebProcess/WebPage/WebPage.h: Added WebNotificationClient as one of its page clients.
101 * WebProcess/WebPage/WebPage.cpp:
102 (WebKit::WebPage::WebPage): Set the notification client to WebNotificationClient.
103 * WebProcess/WebProcess.h: Added WebNotificationManager.
104 (WebKit::WebProcess::notificationManager):
105 * WebProcess/WebProcess.cpp:
106 (WebKit::WebProcess::WebProcess): Initialize notificaton manager.
107