Changeset 110784 in webkit
- Timestamp:
- Mar 14, 2012 4:41:04 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 78 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r110782 r110784 1 2012-03-13 Jon Lee <jonlee@apple.com> 2 3 Separate NOTIFICATIONS and LEGACY_NOTIFICATIONS 4 https://bugs.webkit.org/show_bug.cgi?id=80922 5 <rdar://problem/11035082> 6 7 Reviewed by Jian Li. 8 9 You can include either NOTIFICATIONS or LEGACY_NOTIFICATIONS and have a complete API. 10 LEGACY_NOTIFICATIONS should cover all of the previous functionality, and NOTIFICATIONS will cover the 11 new API. Therefore, APIs that are common between the two will have: 12 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) 13 14 This patch initially sets both to be exactly the same. As other bugs with patches begin to migrate to 15 the new API, the defines will begin to split. This allows ports to decide which set of APIs to include. 16 17 * bindings/scripts/InFilesCompiler.pm: Update the script to handle the "|" flag in a conditional. 18 (preferredConditional): 19 (conditionalStringFromAttributeValue): 20 (generateInterfacesHeader): 21 (generateHeadersHeader): 22 23 Update everything to be #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) 24 * WebCore.exp.in: 25 * bindings/cpp/WebDOMEventTarget.cpp: 26 (toWebKit): 27 * bindings/js/JSDesktopNotificationsCustom.cpp: 28 * bindings/v8/custom/V8NotificationCenterCustom.cpp: 29 * dom/EventTargetFactory.in: 30 * notifications/Notification.cpp: 31 * notifications/Notification.h: 32 * notifications/Notification.idl: 33 * notifications/NotificationCenter.cpp: 34 * notifications/NotificationCenter.h: 35 * notifications/NotificationCenter.idl: 36 * notifications/NotificationContents.h: 37 * notifications/NotificationController.cpp: 38 * notifications/NotificationController.h: 39 * page/DOMWindow.cpp: 40 (WebCore::DOMWindow::~DOMWindow): 41 (WebCore::DOMWindow::willDetachPage): 42 (WebCore::DOMWindow::disconnectDOMWindowProperties): 43 (WebCore::DOMWindow::clearDOMWindowProperties): 44 (WebCore): 45 * page/DOMWindow.h: 46 (DOMWindow): 47 * page/DOMWindow.idl: 48 * page/Frame.cpp: 49 (WebCore::Frame::willDetachPage): 50 (WebCore::Frame::transferChildFrameToNewDocument): 51 * workers/WorkerContext.cpp: 52 (WebCore::WorkerContext::~WorkerContext): 53 (WebCore): 54 * workers/WorkerContext.h: 55 (WorkerContext): 56 * workers/WorkerContext.idl: 57 * workers/WorkerThread.cpp: 58 (WebCore::WorkerThread::WorkerThread): 59 * workers/WorkerThread.h: 60 (WorkerThread): 61 1 62 2012-03-14 Sheriff Bot <webkit.review.bot@gmail.com> 2 63 -
trunk/Source/WebCore/WebCore.exp.in
r110706 r110784 2123 2123 #endif 2124 2124 2125 #if ENABLE(NOTIFICATIONS) 2125 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) 2126 2126 __ZN7WebCore12NotificationC1Ev 2127 2127 __ZN7WebCore12NotificationD1Ev -
trunk/Source/WebCore/bindings/cpp/WebDOMEventTarget.cpp
r101145 r110784 57 57 #endif 58 58 59 #if ENABLE(NOTIFICATIONS) 59 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) 60 60 #include "WebDOMNotification.h" 61 61 #endif … … 123 123 #endif 124 124 125 #if ENABLE(NOTIFICATIONS) 125 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) 126 126 ConvertTo(Notification) 127 127 #endif … … 167 167 #endif 168 168 169 #if ENABLE(NOTIFICATIONS) 169 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) 170 170 if (WebCore::Notification* notification = value->toNotification()) 171 171 return toWebKit(notification); -
trunk/Source/WebCore/bindings/js/JSDesktopNotificationsCustom.cpp
r95901 r110784 31 31 #include "config.h" 32 32 33 #if ENABLE(NOTIFICATIONS) 33 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) 34 34 35 35 #include "Document.h" … … 71 71 } // namespace 72 72 73 #endif // ENABLE(NOTIFICATIONS) 73 #endif // ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) -
trunk/Source/WebCore/bindings/scripts/InFilesCompiler.pm
r98755 r110784 167 167 } 168 168 169 sub preferredConditional() 170 { 171 my $object = shift; 172 my $conditional = shift; 173 174 my @conditionals = split('\\|', $conditional); 175 return $conditionals[0]; 176 } 177 178 sub conditionalStringFromAttributeValue() 179 { 180 my $object = shift; 181 my $conditional = shift; 182 183 return "ENABLE(" . join(') || ENABLE(', split('\\|', $conditional)) . ")"; 184 } 185 169 186 sub generateInterfacesHeader() 170 187 { … … 203 220 204 221 for my $conditional (sort keys %interfacesByConditional) { 205 print F "#if ENABLE($conditional)\n"; 206 print F "#define DOM_${macroStyledNamespace}_INTERFACES_FOR_EACH_$conditional(macro) \\\n"; 222 my $preferredConditional = $object->preferredConditional($conditional); 223 print F "#if " . $object->conditionalStringFromAttributeValue($conditional) . "\n"; 224 print F "#define DOM_${macroStyledNamespace}_INTERFACES_FOR_EACH_$preferredConditional(macro) \\\n"; 207 225 208 226 for my $interface (sort keys %{ $interfacesByConditional{$conditional} }) { … … 211 229 } 212 230 213 print F "// End of DOM_${macroStyledNamespace}_INTERFACES_FOR_EACH_$ conditional\n";231 print F "// End of DOM_${macroStyledNamespace}_INTERFACES_FOR_EACH_$preferredConditional\n"; 214 232 print F "#else\n"; 215 print F "#define DOM_${macroStyledNamespace}_INTERFACES_FOR_EACH_$ conditional(macro)\n";233 print F "#define DOM_${macroStyledNamespace}_INTERFACES_FOR_EACH_$preferredConditional(macro)\n"; 216 234 print F "#endif\n"; 217 235 print F "\n"; … … 225 243 print F " \\\n"; 226 244 for my $conditional (sort keys %interfacesByConditional) { 227 print F " DOM_${macroStyledNamespace}_INTERFACES_FOR_EACH_$conditional(macro) \\\n"; 245 my $preferredConditional = $object->preferredConditional($conditional); 246 print F " DOM_${macroStyledNamespace}_INTERFACES_FOR_EACH_$preferredConditional(macro) \\\n"; 228 247 } 229 248 … … 259 278 $includedInterfaces{$interfaceName} = 1; 260 279 261 print F "#if ENABLE($conditional)\n" if $conditional;280 print F "#if " . $object->conditionalStringFromAttributeValue($conditional) . "\n" if $conditional; 262 281 print F "#include \"$interfaceName.h\"\n"; 263 282 print F "#if USE(JSC)\n"; -
trunk/Source/WebCore/bindings/v8/custom/V8NotificationCenterCustom.cpp
r99645 r110784 31 31 #include "config.h" 32 32 33 #if ENABLE(NOTIFICATIONS) 33 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) 34 34 #include "V8NotificationCenter.h" 35 35 … … 108 108 } // namespace WebCore 109 109 110 #endif // ENABLE(NOTIFICATIONS)110 #endif // ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) -
trunk/Source/WebCore/dom/EventTargetFactory.in
r110587 r110784 19 19 MessagePort 20 20 Node 21 Notification conditional=NOTIFICATIONS 21 Notification conditional=NOTIFICATIONS|LEGACY_NOTIFICATIONS 22 22 SharedWorker conditional=SHARED_WORKERS 23 23 SharedWorkerContext conditional=SHARED_WORKERS -
trunk/Source/WebCore/notifications/Notification.cpp
r110381 r110784 32 32 #include "config.h" 33 33 34 #if ENABLE(NOTIFICATIONS) 34 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) 35 35 36 36 #include "Notification.h" … … 263 263 } // namespace WebCore 264 264 265 #endif // ENABLE(NOTIFICATIONS) 265 #endif // ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) -
trunk/Source/WebCore/notifications/Notification.h
r101750 r110784 47 47 #include <wtf/text/AtomicStringHash.h> 48 48 49 #if ENABLE(NOTIFICATIONS) 49 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) 50 50 namespace WebCore { 51 51 … … 165 165 } // namespace WebCore 166 166 167 #endif // ENABLE(NOTIFICATIONS) 167 #endif // ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) 168 168 169 169 #endif // Notifications_h -
trunk/Source/WebCore/notifications/Notification.idl
r101750 r110784 33 33 34 34 interface [ 35 Conditional=NOTIFICATIONS ,35 Conditional=NOTIFICATIONS|LEGACY_NOTIFICATIONS, 36 36 ActiveDOMObject, 37 37 EventTarget, -
trunk/Source/WebCore/notifications/NotificationCenter.cpp
r110381 r110784 32 32 #include "config.h" 33 33 34 #if ENABLE(NOTIFICATIONS) 34 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) 35 35 36 36 #include "NotificationCenter.h" … … 81 81 } // namespace WebCore 82 82 83 #endif // ENABLE(NOTIFICATIONS) 83 #endif // ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) -
trunk/Source/WebCore/notifications/NotificationCenter.h
r110381 r110784 42 42 #include <wtf/RefPtr.h> 43 43 44 #if ENABLE(NOTIFICATIONS) 44 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) 45 45 46 46 namespace WebCore { … … 91 91 } // namespace WebCore 92 92 93 #endif // ENABLE(NOTIFICATIONS) 93 #endif // ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) 94 94 95 95 #endif // NotificationCenter_h -
trunk/Source/WebCore/notifications/NotificationCenter.idl
r107442 r110784 33 33 34 34 interface [ 35 Conditional=NOTIFICATIONS ,35 Conditional=NOTIFICATIONS|LEGACY_NOTIFICATIONS, 36 36 ActiveDOMObject, 37 37 OmitConstructor -
trunk/Source/WebCore/notifications/NotificationContents.h
r101307 r110784 33 33 #define NotificationContents_h 34 34 35 #if ENABLE(NOTIFICATIONS) 35 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) 36 36 37 37 #include "KURL.h" … … 56 56 } // namespace WebCore 57 57 58 #endif // ENABLE(NOTIFICATIONS) 58 #endif // ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) 59 59 60 60 #endif // NotificationContents_h -
trunk/Source/WebCore/notifications/NotificationController.cpp
r110381 r110784 27 27 #include "NotificationController.h" 28 28 29 #if ENABLE(NOTIFICATIONS) 29 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) 30 30 31 31 #include "NotificationClient.h" … … 71 71 } // namespace WebCore 72 72 73 #endif // ENABLE(NOTIFICATIONS) 73 #endif // ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) -
trunk/Source/WebCore/notifications/NotificationController.h
r110381 r110784 27 27 #define NotificationController_h 28 28 29 #if ENABLE(NOTIFICATIONS) 29 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) 30 30 31 31 #include "Page.h" … … 58 58 } // namespace WebCore 59 59 60 #endif // ENABLE(NOTIFICATIONS) 60 #endif // ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) 61 61 62 62 #endif // NotificationController_h -
trunk/Source/WebCore/page/DOMWindow.cpp
r110570 r110784 419 419 ASSERT(!m_localStorage); 420 420 ASSERT(!m_applicationCache); 421 #if ENABLE(NOTIFICATIONS) 421 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) 422 422 ASSERT(!m_notifications); 423 423 #endif … … 479 479 InspectorInstrumentation::frameWindowDiscarded(m_frame, this); 480 480 481 #if ENABLE(NOTIFICATIONS) 481 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) 482 482 // Clearing Notifications requests involves accessing the client so it must be done 483 483 // before the frame is detached. … … 529 529 (*it)->disconnectFrame(); 530 530 531 #if ENABLE(NOTIFICATIONS) 531 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) 532 532 // FIXME: Notifications shouldn't have different disconnection logic than 533 533 // the rest of the DOMWindowProperties. … … 572 572 m_localStorage = 0; 573 573 m_applicationCache = 0; 574 #if ENABLE(NOTIFICATIONS) 574 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) 575 575 // FIXME: Notifications shouldn't have different disconnection logic than 576 576 // the rest of the DOMWindowProperties. … … 785 785 } 786 786 787 #if ENABLE(NOTIFICATIONS) 787 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) 788 788 NotificationCenter* DOMWindow::webkitNotifications() const 789 789 { -
trunk/Source/WebCore/page/DOMWindow.h
r110570 r110784 357 357 Storage* localStorage(ExceptionCode&) const; 358 358 359 #if ENABLE(NOTIFICATIONS) 359 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) 360 360 NotificationCenter* webkitNotifications() const; 361 361 // Renders webkitNotifications object safely inoperable, disconnects … … 451 451 mutable RefPtr<DOMApplicationCache> m_applicationCache; 452 452 453 #if ENABLE(NOTIFICATIONS) 453 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) 454 454 mutable RefPtr<NotificationCenter> m_notifications; 455 455 #endif -
trunk/Source/WebCore/page/DOMWindow.idl
r109693 r110784 171 171 getter raises(DOMException); 172 172 173 #if defined(ENABLE_NOTIFICATIONS) && ENABLE_NOTIFICATIONS173 #if (defined(ENABLE_NOTIFICATIONS) && ENABLE_NOTIFICATIONS) || (defined(ENABLE_LEGACY_NOTIFICATIONS) && ENABLE_LEGACY_NOTIFICATIONS) 174 174 readonly attribute [V8EnabledAtRuntime] NotificationCenter webkitNotifications; 175 175 #endif -
trunk/Source/WebCore/page/Frame.cpp
r109931 r110784 688 688 parent->loader()->checkLoadComplete(); 689 689 690 #if ENABLE(NOTIFICATIONS) 690 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) 691 691 if (m_domWindow) 692 692 m_domWindow->resetNotifications(); … … 738 738 739 739 if (m_domWindow) { 740 #if ENABLE(NOTIFICATIONS) 740 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) 741 741 m_domWindow->resetNotifications(); 742 742 #endif -
trunk/Source/WebCore/workers/WorkerContext.cpp
r110381 r110784 60 60 #include <wtf/UnusedParam.h> 61 61 62 #if ENABLE(NOTIFICATIONS) 62 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) 63 63 #include "NotificationCenter.h" 64 64 #endif … … 105 105 { 106 106 ASSERT(currentThread() == thread()->threadID()); 107 #if ENABLE(NOTIFICATIONS) 107 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) 108 108 m_notifications.clear(); 109 109 #endif … … 295 295 } 296 296 297 #if ENABLE(NOTIFICATIONS) 297 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) 298 298 NotificationCenter* WorkerContext::webkitNotifications() const 299 299 { -
trunk/Source/WebCore/workers/WorkerContext.h
r109833 r110784 106 106 virtual WorkerEventQueue* eventQueue() const; 107 107 108 #if ENABLE(NOTIFICATIONS) 108 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) 109 109 NotificationCenter* webkitNotifications() const; 110 110 #endif … … 173 173 WorkerThread* m_thread; 174 174 175 #if ENABLE _NOTIFICATIONS175 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) 176 176 mutable RefPtr<NotificationCenter> m_notifications; 177 177 #endif -
trunk/Source/WebCore/workers/WorkerContext.idl
r109833 r110784 71 71 raises(EventException); 72 72 73 #if defined(ENABLE_NOTIFICATIONS) && ENABLE_NOTIFICATIONS73 #if (defined(ENABLE_NOTIFICATIONS) && ENABLE_NOTIFICATIONS) || (defined(ENABLE_LEGACY_NOTIFICATIONS) && ENABLE_LEGACY_NOTIFICATIONS) 74 74 // Notification interface 75 75 readonly attribute [V8EnabledAtRuntime] NotificationCenter webkitNotifications; -
trunk/Source/WebCore/workers/WorkerThread.cpp
r110381 r110784 97 97 , m_workerReportingProxy(workerReportingProxy) 98 98 , m_startupData(WorkerThreadStartupData::create(scriptURL, userAgent, sourceCode, startMode, contentSecurityPolicy, contentSecurityPolicyType)) 99 #if ENABLE(NOTIFICATIONS) 99 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) 100 100 , m_notificationClient(0) 101 101 #endif -
trunk/Source/WebCore/workers/WorkerThread.h
r110381 r110784 63 63 static unsigned workerThreadCount(); 64 64 65 #if ENABLE(NOTIFICATIONS) 65 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) 66 66 NotificationClient* getNotificationClient() { return m_notificationClient; } 67 67 void setNotificationClient(NotificationClient* client) { m_notificationClient = client; } … … 94 94 OwnPtr<WorkerThreadStartupData> m_startupData; 95 95 96 #if ENABLE(NOTIFICATIONS) 96 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) 97 97 NotificationClient* m_notificationClient; 98 98 #endif -
trunk/Source/WebKit/blackberry/Api/WebPage.cpp
r110712 r110784 71 71 #include "NetworkManager.h" 72 72 #include "NodeRenderStyle.h" 73 #if ENABLE(NOTIFICATIONS) 73 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) 74 74 #include "NotificationPresenterImpl.h" 75 75 #endif … … 432 432 WebCore::provideDeviceMotionTo(m_page, new DeviceMotionClientBlackBerry(this)); 433 433 434 #if ENABLE(NOTIFICATIONS) 434 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) 435 435 WebCore::provideNotification(m_page, NotificationPresenterImpl::instance()); 436 436 #endif -
trunk/Source/WebKit/blackberry/ChangeLog
r110712 r110784 1 2012-03-13 Jon Lee <jonlee@apple.com> 2 3 Separate NOTIFICATIONS and LEGACY_NOTIFICATIONS 4 https://bugs.webkit.org/show_bug.cgi?id=80922 5 <rdar://problem/11035082> 6 7 Reviewed by Jian Li. 8 9 You can include either NOTIFICATIONS or LEGACY_NOTIFICATIONS and have a complete API. 10 LEGACY_NOTIFICATIONS should cover all of the previous functionality, and NOTIFICATIONS will cover the 11 new API. Therefore, APIs that are common between the two will have: 12 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) 13 14 This patch initially sets both to be exactly the same. As other bugs with patches begin to migrate to 15 the new API, the defines will begin to split. This allows ports to decide which set of APIs to include. 16 17 Update everything to be #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) 18 * Api/WebPage.cpp: 19 (BlackBerry::WebKit::WebPagePrivate::init): 20 * WebCoreSupport/NotificationPresenterImpl.cpp: 21 * WebCoreSupport/NotificationPresenterImpl.h: 22 1 23 2012-03-14 Nima Ghanavatian <nghanavatian@rim.com> 2 24 -
trunk/Source/WebKit/blackberry/WebCoreSupport/NotificationPresenterImpl.cpp
r110381 r110784 20 20 #include "NotificationPresenterImpl.h" 21 21 22 #if ENABLE(NOTIFICATIONS) 22 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) 23 23 #include <Event.h> 24 24 #include <Notification.h> … … 156 156 } // namespace WebKit 157 157 158 #endif // ENABLE(NOTIFICATIONS) 158 #endif // ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) -
trunk/Source/WebKit/blackberry/WebCoreSupport/NotificationPresenterImpl.h
r110381 r110784 20 20 #define NotificationPresenterImpl_h 21 21 22 #if ENABLE(NOTIFICATIONS) 22 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) 23 23 #include <NotificationAckListener.h> 24 24 #include <NotificationClient.h> … … 82 82 } // namespace WebKit 83 83 84 #endif // ENABLE(NOTIFICATIONS) 84 #endif // ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) 85 85 #endif // NotificationPresenterImpl_h -
trunk/Source/WebKit/chromium/ChangeLog
r110773 r110784 1 2012-03-13 Jon Lee <jonlee@apple.com> 2 3 Separate NOTIFICATIONS and LEGACY_NOTIFICATIONS 4 https://bugs.webkit.org/show_bug.cgi?id=80922 5 <rdar://problem/11035082> 6 7 Reviewed by Jian Li. 8 9 You can include either NOTIFICATIONS or LEGACY_NOTIFICATIONS and have a complete API. 10 LEGACY_NOTIFICATIONS should cover all of the previous functionality, and NOTIFICATIONS will cover the 11 new API. Therefore, APIs that are common between the two will have: 12 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) 13 14 This patch initially sets both to be exactly the same. As other bugs with patches begin to migrate to 15 the new API, the defines will begin to split. This allows ports to decide which set of APIs to include. 16 17 Update everything to be #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) 18 * src/AssertMatchingEnums.cpp: 19 * src/NotificationPresenterImpl.cpp: 20 * src/NotificationPresenterImpl.h: 21 * src/WebNotification.cpp: 22 * src/WebRuntimeFeatures.cpp: 23 (WebKit::WebRuntimeFeatures::enableNotifications): 24 (WebKit::WebRuntimeFeatures::isNotificationsEnabled): 25 * src/WebViewImpl.cpp: 26 (WebKit::WebViewImpl::WebViewImpl): 27 (WebKit): 28 * src/WebViewImpl.h: 29 (WebViewImpl): 30 1 31 2012-03-14 James Robinson <jamesr@chromium.org> 2 32 -
trunk/Source/WebKit/chromium/src/AssertMatchingEnums.cpp
r110381 r110784 394 394 #endif 395 395 396 #if ENABLE(NOTIFICATIONS) 396 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) 397 397 COMPILE_ASSERT_MATCHING_ENUM(WebNotificationPresenter::PermissionAllowed, NotificationClient::PermissionAllowed); 398 398 COMPILE_ASSERT_MATCHING_ENUM(WebNotificationPresenter::PermissionNotAllowed, NotificationClient::PermissionNotAllowed); -
trunk/Source/WebKit/chromium/src/NotificationPresenterImpl.cpp
r110381 r110784 32 32 #include "NotificationPresenterImpl.h" 33 33 34 #if ENABLE(NOTIFICATIONS) 34 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) 35 35 36 36 #include "KURL.h" … … 112 112 } // namespace WebKit 113 113 114 #endif // ENABLE(NOTIFICATIONS) 114 #endif // ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) -
trunk/Source/WebKit/chromium/src/NotificationPresenterImpl.h
r110381 r110784 38 38 #include <wtf/PassRefPtr.h> 39 39 40 #if ENABLE(NOTIFICATIONS) 40 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) 41 41 42 42 namespace WebKit { … … 67 67 } // namespace WebKit 68 68 69 #endif // ENABLE(NOTIFICATIONS) 69 #endif // ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) 70 70 71 71 #endif -
trunk/Source/WebKit/chromium/src/WebNotification.cpp
r102044 r110784 32 32 #include "WebNotification.h" 33 33 34 #if ENABLE(NOTIFICATIONS) 34 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) 35 35 36 36 #include "Event.h" … … 175 175 } // namespace WebKit 176 176 177 #endif // ENABLE(NOTIFICATIONS) 177 #endif // ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) -
trunk/Source/WebKit/chromium/src/WebRuntimeFeatures.cpp
r109667 r110784 117 117 void WebRuntimeFeatures::enableNotifications(bool enable) 118 118 { 119 #if ENABLE(NOTIFICATIONS) 119 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) 120 120 RuntimeEnabledFeatures::setWebkitNotificationsEnabled(enable); 121 121 #endif … … 124 124 bool WebRuntimeFeatures::isNotificationsEnabled() 125 125 { 126 #if ENABLE(NOTIFICATIONS) 126 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) 127 127 return RuntimeEnabledFeatures::webkitNotificationsEnabled(); 128 128 #else -
trunk/Source/WebKit/chromium/src/WebViewImpl.cpp
r110706 r110784 390 390 provideSpeechInputTo(m_page.get(), m_speechInputClient.get()); 391 391 #endif 392 #if ENABLE(NOTIFICATIONS) 392 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) 393 393 provideNotification(m_page.get(), notificationPresenterImpl()); 394 394 #endif … … 2958 2958 } 2959 2959 2960 #if ENABLE(NOTIFICATIONS) 2960 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) 2961 2961 NotificationPresenterImpl* WebViewImpl::notificationPresenterImpl() 2962 2962 { -
trunk/Source/WebKit/chromium/src/WebViewImpl.h
r110706 r110784 417 417 } 418 418 419 #if ENABLE(NOTIFICATIONS) 419 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) 420 420 // Returns the provider of desktop notifications. 421 421 NotificationPresenterImpl* notificationPresenterImpl(); … … 683 683 OwnPtr<DragScrollTimer> m_dragScrollTimer; 684 684 685 #if ENABLE(NOTIFICATIONS) 685 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) 686 686 // The provider of desktop notifications; 687 687 NotificationPresenterImpl m_notificationPresenter; -
trunk/Source/WebKit/efl/ChangeLog
r110595 r110784 1 2012-03-13 Jon Lee <jonlee@apple.com> 2 3 Separate NOTIFICATIONS and LEGACY_NOTIFICATIONS 4 https://bugs.webkit.org/show_bug.cgi?id=80922 5 <rdar://problem/11035082> 6 7 Reviewed by Jian Li. 8 9 You can include either NOTIFICATIONS or LEGACY_NOTIFICATIONS and have a complete API. 10 LEGACY_NOTIFICATIONS should cover all of the previous functionality, and NOTIFICATIONS will cover the 11 new API. Therefore, APIs that are common between the two will have: 12 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) 13 14 This patch initially sets both to be exactly the same. As other bugs with patches begin to migrate to 15 the new API, the defines will begin to split. This allows ports to decide which set of APIs to include. 16 17 Update everything to be #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) 18 * WebCoreSupport/ChromeClientEfl.cpp: 19 (WebCore): 20 * WebCoreSupport/ChromeClientEfl.h: 21 (ChromeClientEfl): 22 * WebCoreSupport/NotificationPresenterClientEfl.cpp: 23 * WebCoreSupport/NotificationPresenterClientEfl.h: 24 1 25 2012-03-13 Adam Barth <abarth@webkit.org> && Benjamin Poulain <bpoulain@apple.com> 2 26 -
trunk/Source/WebKit/efl/WebCoreSupport/ChromeClientEfl.cpp
r110595 r110784 56 56 #include <wtf/text/CString.h> 57 57 58 #if ENABLE(NOTIFICATIONS) 58 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) 59 59 #include "NotificationPresenterClientEfl.h" 60 60 #endif … … 418 418 #endif 419 419 420 #if ENABLE(NOTIFICATIONS) 420 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) 421 421 NotificationClient* ChromeClientEfl::notificationPresenter() const 422 422 { -
trunk/Source/WebKit/efl/WebCoreSupport/ChromeClientEfl.h
r110595 r110784 29 29 #include "PopupMenu.h" 30 30 31 #if ENABLE(NOTIFICATIONS) 31 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) 32 32 #include "NotificationClient.h" 33 33 #endif … … 115 115 #endif 116 116 117 #if ENABLE(NOTIFICATIONS) 117 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) 118 118 virtual WebCore::NotificationClient* notificationPresenter() const; 119 119 #endif -
trunk/Source/WebKit/efl/WebCoreSupport/NotificationPresenterClientEfl.cpp
r103975 r110784 21 21 #include "NotificationPresenterClientEfl.h" 22 22 23 #if ENABLE(NOTIFICATIONS) 23 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) 24 24 #include "NotImplemented.h" 25 25 -
trunk/Source/WebKit/efl/WebCoreSupport/NotificationPresenterClientEfl.h
r103975 r110784 21 21 #define NotificationPresenterClientEfl_h 22 22 23 #if ENABLE(NOTIFICATIONS) 23 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) 24 24 #include "Notification.h" 25 25 #include "NotificationPresenter.h" -
trunk/Source/WebKit/mac/ChangeLog
r110595 r110784 1 2012-03-13 Jon Lee <jonlee@apple.com> 2 3 Separate NOTIFICATIONS and LEGACY_NOTIFICATIONS 4 https://bugs.webkit.org/show_bug.cgi?id=80922 5 <rdar://problem/11035082> 6 7 Reviewed by Jian Li. 8 9 You can include either NOTIFICATIONS or LEGACY_NOTIFICATIONS and have a complete API. 10 LEGACY_NOTIFICATIONS should cover all of the previous functionality, and NOTIFICATIONS will cover the 11 new API. Therefore, APIs that are common between the two will have: 12 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) 13 14 This patch initially sets both to be exactly the same. As other bugs with patches begin to migrate to 15 the new API, the defines will begin to split. This allows ports to decide which set of APIs to include. 16 17 Update everything to be #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) 18 * WebCoreSupport/WebNotificationClient.h: 19 * WebCoreSupport/WebNotificationClient.mm: 20 (WebNotificationClient::show): 21 (WebNotificationClient::cancel): 22 (WebNotificationClient::clearNotifications): 23 (WebNotificationClient::notificationObjectDestroyed): 24 (WebNotificationClient::notificationControllerDestroyed): 25 (WebNotificationClient::requestPermission): 26 (WebNotificationClient::checkPermission): 27 * WebView/WebNotification.mm: 28 (-[WebNotification title]): 29 (-[WebNotification body]): 30 (-[WebNotification replaceID]): 31 (-[WebNotification origin]): 32 (-[WebNotification notificationID]): 33 (-[WebNotification dispatchShowEvent]): 34 (-[WebNotification dispatchCloseEvent]): 35 (-[WebNotification dispatchClickEvent]): 36 (-[WebNotification dispatchErrorEvent]): 37 * WebView/WebNotificationInternal.h: 38 * WebView/WebView.mm: 39 (-[WebView _commonInitializationWithFrameName:groupName:]): 40 1 41 2012-03-13 Adam Barth <abarth@webkit.org> && Benjamin Poulain <bpoulain@apple.com> 2 42 -
trunk/Source/WebKit/mac/WebCoreSupport/WebNotificationClient.h
r110381 r110784 26 26 #import <WebCore/NotificationClient.h> 27 27 28 #if ENABLE(NOTIFICATIONS) 28 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) 29 29 #import <WebCore/Notification.h> 30 30 #import <wtf/HashMap.h> … … 58 58 59 59 WebView *m_webView; 60 #if ENABLE(NOTIFICATIONS) 60 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) 61 61 HashMap<RefPtr<WebCore::Notification>, RetainPtr<WebNotification> > m_notificationMap; 62 62 -
trunk/Source/WebKit/mac/WebCoreSupport/WebNotificationClient.mm
r110381 r110784 26 26 #import "WebNotificationClient.h" 27 27 28 #if ENABLE(NOTIFICATIONS) 28 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) 29 29 #import "WebDelegateImplementationCaching.h" 30 30 #import "WebNotificationInternal.h" … … 40 40 using namespace WebCore; 41 41 42 #if ENABLE(NOTIFICATIONS) 42 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) 43 43 @interface WebNotificationPolicyListener : NSObject <WebAllowDenyPolicyListener> 44 44 { … … 49 49 #endif 50 50 51 #if ENABLE(NOTIFICATIONS) 51 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) 52 52 static uint64_t generateNotificationID() 53 53 { … … 64 64 bool WebNotificationClient::show(Notification* notification) 65 65 { 66 #if ENABLE(NOTIFICATIONS) 66 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) 67 67 if (![m_webView _notificationProvider]) 68 68 return false; … … 85 85 void WebNotificationClient::cancel(Notification* notification) 86 86 { 87 #if ENABLE(NOTIFICATIONS) 87 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) 88 88 WebNotification *webNotification = m_notificationMap.get(notification).get(); 89 89 if (!webNotification) … … 98 98 void WebNotificationClient::clearNotifications(ScriptExecutionContext* context) 99 99 { 100 #if ENABLE(NOTIFICATIONS) 100 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) 101 101 NotificationContextMap::iterator it = m_notificationContextMap.find(context); 102 102 if (it == m_notificationContextMap.end()) … … 121 121 void WebNotificationClient::notificationObjectDestroyed(Notification* notification) 122 122 { 123 #if ENABLE(NOTIFICATIONS) 123 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) 124 124 RetainPtr<WebNotification> webNotification = m_notificationMap.take(notification); 125 125 if (!webNotification) … … 142 142 void WebNotificationClient::notificationControllerDestroyed() 143 143 { 144 #if ENABLE(NOTIFICATIONS) 144 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) 145 145 [m_webView _notificationControllerDestroyed]; 146 146 #endif … … 150 150 void WebNotificationClient::requestPermission(ScriptExecutionContext* context, PassRefPtr<VoidCallback> callback) 151 151 { 152 #if ENABLE(NOTIFICATIONS) 152 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) 153 153 BEGIN_BLOCK_OBJC_EXCEPTIONS; 154 154 … … 174 174 NotificationClient::Permission WebNotificationClient::checkPermission(ScriptExecutionContext* context) 175 175 { 176 #if ENABLE(NOTIFICATIONS) 176 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) 177 177 if (!context || !context->isDocument()) 178 178 return NotificationClient::PermissionDenied; … … 198 198 } 199 199 200 #if ENABLE(NOTIFICATIONS) 200 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) 201 201 @implementation WebNotificationPolicyListener 202 202 - (id)initWithCallback:(PassRefPtr<VoidCallback>)callback -
trunk/Source/WebKit/mac/WebView/WebNotification.mm
r109766 r110784 31 31 #import "WebNotificationInternal.h" 32 32 33 #if ENABLE(NOTIFICATIONS) 33 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) 34 34 #import "WebSecurityOriginInternal.h" 35 35 #import <WebCore/Notification.h> … … 45 45 { 46 46 @public 47 #if ENABLE(NOTIFICATIONS) 47 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) 48 48 RefPtr<Notification> _internal; 49 49 uint64_t _notificationID; … … 55 55 @end 56 56 57 #if ENABLE(NOTIFICATIONS) 57 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) 58 58 @implementation WebNotification (WebNotificationInternal) 59 59 Notification* core(WebNotification *notification) … … 84 84 - (NSString *)title 85 85 { 86 #if ENABLE(NOTIFICATIONS) 86 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) 87 87 ASSERT(core(self)); 88 88 return core(self)->contents().title; … … 94 94 - (NSString *)body 95 95 { 96 #if ENABLE(NOTIFICATIONS) 96 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) 97 97 ASSERT(core(self)); 98 98 return core(self)->contents().body; … … 104 104 - (NSString *)replaceID 105 105 { 106 #if ENABLE(NOTIFICATIONS) 106 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) 107 107 ASSERT(core(self)); 108 108 return core(self)->replaceId(); … … 114 114 - (WebSecurityOrigin *)origin 115 115 { 116 #if ENABLE(NOTIFICATIONS) 116 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) 117 117 ASSERT(core(self)); 118 118 return [[[WebSecurityOrigin alloc] _initWithWebCoreSecurityOrigin:core(self)->scriptExecutionContext()->securityOrigin()] autorelease]; … … 124 124 - (uint64_t)notificationID 125 125 { 126 #if ENABLE(NOTIFICATIONS) 126 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) 127 127 ASSERT(core(self)); 128 128 return _private->_notificationID; … … 134 134 - (void)dispatchShowEvent 135 135 { 136 #if ENABLE(NOTIFICATIONS) 136 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) 137 137 ASSERT(core(self)); 138 138 core(self)->dispatchShowEvent(); … … 142 142 - (void)dispatchCloseEvent 143 143 { 144 #if ENABLE(NOTIFICATIONS) 144 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) 145 145 ASSERT(core(self)); 146 146 core(self)->dispatchCloseEvent(); … … 150 150 - (void)dispatchClickEvent 151 151 { 152 #if ENABLE(NOTIFICATIONS) 152 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) 153 153 ASSERT(core(self)); 154 154 core(self)->dispatchClickEvent(); … … 158 158 - (void)dispatchErrorEvent 159 159 { 160 #if ENABLE(NOTIFICATIONS) 160 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) 161 161 ASSERT(core(self)); 162 162 core(self)->dispatchErrorEvent(); -
trunk/Source/WebKit/mac/WebView/WebNotificationInternal.h
r108409 r110784 29 29 #import "WebNotification.h" 30 30 31 #if ENABLE(NOTIFICATIONS) 31 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) 32 32 33 33 namespace WebCore { -
trunk/Source/WebKit/mac/WebView/WebView.mm
r110595 r110784 741 741 #endif 742 742 _private->page = new Page(pageClients); 743 #if ENABLE(NOTIFICATIONS) 743 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) 744 744 WebCore::provideNotification(_private->page, new WebNotificationClient(self)); 745 745 #endif -
trunk/Source/WebKit/qt/Api/qwebpage.cpp
r110677 r110784 341 341 WebCore::provideDeviceMotionTo(page, new DeviceMotionClientQt); 342 342 #endif 343 #if ENABLE(NOTIFICATIONS) 343 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) 344 344 WebCore::provideNotification(page, NotificationPresenterClientQt::notificationPresenter()); 345 345 #endif … … 364 364 PageGroup::setShouldTrackVisitedLinks(true); 365 365 366 #if ENABLE(NOTIFICATIONS) 366 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) 367 367 NotificationPresenterClientQt::notificationPresenter()->addClient(); 368 368 #endif … … 388 388 inspector->setPage(0); 389 389 390 #if ENABLE(NOTIFICATIONS) 390 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) 391 391 NotificationPresenterClientQt::notificationPresenter()->removeClient(); 392 392 #endif … … 2150 2150 switch (feature) { 2151 2151 case Notifications: 2152 #if ENABLE(NOTIFICATIONS) 2152 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) 2153 2153 if (policy == PermissionGrantedByUser) 2154 2154 NotificationPresenterClientQt::notificationPresenter()->allowNotificationForFrame(frame->d->frame); -
trunk/Source/WebKit/qt/ChangeLog
r110677 r110784 1 2012-03-13 Jon Lee <jonlee@apple.com> 2 3 Separate NOTIFICATIONS and LEGACY_NOTIFICATIONS 4 https://bugs.webkit.org/show_bug.cgi?id=80922 5 <rdar://problem/11035082> 6 7 Reviewed by Jian Li. 8 9 You can include either NOTIFICATIONS or LEGACY_NOTIFICATIONS and have a complete API. 10 LEGACY_NOTIFICATIONS should cover all of the previous functionality, and NOTIFICATIONS will cover the 11 new API. Therefore, APIs that are common between the two will have: 12 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) 13 14 This patch initially sets both to be exactly the same. As other bugs with patches begin to migrate to 15 the new API, the defines will begin to split. This allows ports to decide which set of APIs to include. 16 17 Update everything to be #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) 18 * Api/qwebpage.cpp: 19 (QWebPagePrivate::QWebPagePrivate): 20 (QWebPagePrivate::~QWebPagePrivate): 21 (QWebPage::setFeaturePermission): 22 * WebCoreSupport/DumpRenderTreeSupportQt.cpp: 23 (DumpRenderTreeSupportQt::dumpNotification): 24 (DumpRenderTreeSupportQt::simulateDesktopNotificationClick): 25 * WebCoreSupport/NotificationPresenterClientQt.cpp: 26 (WebCore): 27 (WebCore::NotificationWrapper::NotificationWrapper): 28 (WebCore::NotificationWrapper::close): 29 (WebCore::NotificationWrapper::title): 30 (WebCore::NotificationWrapper::message): 31 (WebCore::NotificationWrapper::iconData): 32 (WebCore::NotificationWrapper::openerPageUrl): 33 (WebCore::NotificationWrapper::notificationClicked): 34 (WebCore::NotificationWrapper::notificationClosed): 35 * WebCoreSupport/NotificationPresenterClientQt.h: 36 (WebCore): 37 1 38 2012-03-14 Csaba Osztrogonác <ossy@webkit.org> 2 39 -
trunk/Source/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp
r110604 r110784 791 791 void DumpRenderTreeSupportQt::dumpNotification(bool b) 792 792 { 793 #if ENABLE(NOTIFICATIONS) 793 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) 794 794 NotificationPresenterClientQt::dumpNotification = b; 795 795 #endif … … 988 988 void DumpRenderTreeSupportQt::simulateDesktopNotificationClick(const QString& title) 989 989 { 990 #if ENABLE(NOTIFICATIONS) 990 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) 991 991 NotificationPresenterClientQt::notificationPresenter()->notificationClicked(title); 992 992 #endif -
trunk/Source/WebKit/qt/WebCoreSupport/NotificationPresenterClientQt.cpp
r110381 r110784 49 49 namespace WebCore { 50 50 51 #if ENABLE(NOTIFICATIONS) 51 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) 52 52 53 53 const double notificationTimeout = 10.0; … … 71 71 : m_closeTimer(this, &NotificationWrapper::close) 72 72 { 73 #if ENABLE(NOTIFICATIONS) 73 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) 74 74 75 75 #ifndef QT_NO_SYSTEMTRAYICON … … 82 82 void NotificationWrapper::close(Timer<NotificationWrapper>*) 83 83 { 84 #if ENABLE(NOTIFICATIONS) 84 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) 85 85 NotificationPresenterClientQt::notificationPresenter()->cancel(this); 86 86 #endif … … 89 89 const QString NotificationWrapper::title() const 90 90 { 91 #if ENABLE(NOTIFICATIONS) 91 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) 92 92 Notification* notification = NotificationPresenterClientQt::notificationPresenter()->notificationForWrapper(this); 93 93 if (notification) … … 99 99 const QString NotificationWrapper::message() const 100 100 { 101 #if ENABLE(NOTIFICATIONS) 101 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) 102 102 Notification* notification = NotificationPresenterClientQt::notificationPresenter()->notificationForWrapper(this); 103 103 if (notification) … … 110 110 { 111 111 QByteArray iconData; 112 #if ENABLE(NOTIFICATIONS) 112 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) 113 113 Notification* notification = NotificationPresenterClientQt::notificationPresenter()->notificationForWrapper(this); 114 114 if (notification) { … … 123 123 { 124 124 QUrl url; 125 #if ENABLE(NOTIFICATIONS) 125 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) 126 126 Notification* notification = NotificationPresenterClientQt::notificationPresenter()->notificationForWrapper(this); 127 127 if (notification) { … … 135 135 void NotificationWrapper::notificationClicked() 136 136 { 137 #if ENABLE(NOTIFICATIONS) 137 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) 138 138 NotificationPresenterClientQt::notificationPresenter()->notificationClicked(this); 139 139 #endif … … 142 142 void NotificationWrapper::notificationClosed() 143 143 { 144 #if ENABLE(NOTIFICATIONS) 144 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) 145 145 NotificationPresenterClientQt::notificationPresenter()->cancel(this); 146 146 #endif 147 147 } 148 148 149 #if ENABLE(NOTIFICATIONS) 149 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) 150 150 151 151 NotificationPresenterClientQt::NotificationPresenterClientQt() : m_clientCount(0) … … 465 465 } 466 466 467 #endif // ENABLE(NOTIFICATIONS) 467 #endif // ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) 468 468 } 469 469 -
trunk/Source/WebKit/qt/WebCoreSupport/NotificationPresenterClientQt.h
r110381 r110784 78 78 }; 79 79 80 #if ENABLE(NOTIFICATIONS) 80 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) 81 81 82 82 typedef QHash <Notification*, NotificationWrapper*> NotificationsQueue; -
trunk/Source/WebKit/win/ChangeLog
r110595 r110784 1 2012-03-13 Jon Lee <jonlee@apple.com> 2 3 Separate NOTIFICATIONS and LEGACY_NOTIFICATIONS 4 https://bugs.webkit.org/show_bug.cgi?id=80922 5 <rdar://problem/11035082> 6 7 Reviewed by Jian Li. 8 9 You can include either NOTIFICATIONS or LEGACY_NOTIFICATIONS and have a complete API. 10 LEGACY_NOTIFICATIONS should cover all of the previous functionality, and NOTIFICATIONS will cover the 11 new API. Therefore, APIs that are common between the two will have: 12 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) 13 14 This patch initially sets both to be exactly the same. As other bugs with patches begin to migrate to 15 the new API, the defines will begin to split. This allows ports to decide which set of APIs to include. 16 17 Update everything to be #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) 18 * WebCoreSupport/WebChromeClient.cpp: 19 (WebChromeClient::WebChromeClient): 20 * WebCoreSupport/WebChromeClient.h: 21 (WebChromeClient): 22 * WebCoreSupport/WebDesktopNotificationsDelegate.cpp: 23 * WebCoreSupport/WebDesktopNotificationsDelegate.h: 24 1 25 2012-03-13 Adam Barth <abarth@webkit.org> && Benjamin Poulain <bpoulain@apple.com> 2 26 -
trunk/Source/WebKit/win/WebCoreSupport/WebChromeClient.cpp
r102874 r110784 75 75 WebChromeClient::WebChromeClient(WebView* webView) 76 76 : m_webView(webView) 77 #if ENABLE(NOTIFICATIONS) 77 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) 78 78 , m_notificationsDelegate(new WebDesktopNotificationsDelegate(webView)) 79 79 #endif -
trunk/Source/WebKit/win/WebCoreSupport/WebChromeClient.h
r110595 r110784 151 151 #endif 152 152 153 #if ENABLE(NOTIFICATIONS) 153 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) 154 154 virtual WebCore::NotificationClient* notificationPresenter() const { return reinterpret_cast<WebCore::NotificationClient*>(m_notificationsDelegate.get()); } 155 155 #endif … … 176 176 WebView* m_webView; 177 177 178 #if ENABLE(NOTIFICATIONS) 178 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) 179 179 OwnPtr<WebDesktopNotificationsDelegate> m_notificationsDelegate; 180 180 #endif -
trunk/Source/WebKit/win/WebCoreSupport/WebDesktopNotificationsDelegate.cpp
r110381 r110784 37 37 #include <WebCore/KURL.h> 38 38 39 #if ENABLE(NOTIFICATIONS) 39 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) 40 40 41 41 using namespace WebCore; … … 212 212 } 213 213 214 #endif // ENABLE(NOTIFICATIONS)214 #endif // ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) -
trunk/Source/WebKit/win/WebCoreSupport/WebDesktopNotificationsDelegate.h
r110381 r110784 33 33 #include <WebCore/NotificationClient.h> 34 34 35 #if ENABLE(NOTIFICATIONS) 35 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) 36 36 37 37 interface IWebDesktopNotificationPresenter; -
trunk/Source/WebKit/wince/ChangeLog
r110595 r110784 1 2012-03-13 Jon Lee <jonlee@apple.com> 2 3 Separate NOTIFICATIONS and LEGACY_NOTIFICATIONS 4 https://bugs.webkit.org/show_bug.cgi?id=80922 5 <rdar://problem/11035082> 6 7 Reviewed by Jian Li. 8 9 You can include either NOTIFICATIONS or LEGACY_NOTIFICATIONS and have a complete API. 10 LEGACY_NOTIFICATIONS should cover all of the previous functionality, and NOTIFICATIONS will cover the 11 new API. Therefore, APIs that are common between the two will have: 12 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) 13 14 This patch initially sets both to be exactly the same. As other bugs with patches begin to migrate to 15 the new API, the defines will begin to split. This allows ports to decide which set of APIs to include. 16 17 Update everything to be #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) 18 * WebCoreSupport/ChromeClientWinCE.h: 19 (ChromeClientWinCE): 20 1 21 2012-03-13 Adam Barth <abarth@webkit.org> && Benjamin Poulain <bpoulain@apple.com> 2 22 -
trunk/Source/WebKit/wince/WebCoreSupport/ChromeClientWinCE.h
r110595 r110784 132 132 virtual void reachedApplicationCacheOriginQuota(WebCore::SecurityOrigin*, int64_t totalSpaceNeeded); 133 133 134 #if ENABLE(NOTIFICATIONS) 134 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) 135 135 virtual WebCore::NotificationClient* notificationPresenter() const; 136 136 #endif -
trunk/Source/WebKit2/ChangeLog
r110781 r110784 1 2012-03-13 Jon Lee <jonlee@apple.com> 2 3 Separate NOTIFICATIONS and LEGACY_NOTIFICATIONS 4 https://bugs.webkit.org/show_bug.cgi?id=80922 5 <rdar://problem/11035082> 6 7 Reviewed by Jian Li. 8 9 You can include either NOTIFICATIONS or LEGACY_NOTIFICATIONS and have a complete API. 10 LEGACY_NOTIFICATIONS should cover all of the previous functionality, and NOTIFICATIONS will cover the 11 new API. Therefore, APIs that are common between the two will have: 12 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) 13 14 This patch initially sets both to be exactly the same. As other bugs with patches begin to migrate to 15 the new API, the defines will begin to split. This allows ports to decide which set of APIs to include. 16 17 Update everything to be #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) 18 * Shared/WebProcessCreationParameters.cpp: 19 (WebKit::WebProcessCreationParameters::encode): 20 (WebKit::WebProcessCreationParameters::decode): 21 * Shared/WebProcessCreationParameters.h: 22 (WebProcessCreationParameters): 23 * UIProcess/WebContext.cpp: 24 (WebKit::WebContext::ensureWebProcess): 25 * WebProcess/Notifications/NotificationPermissionRequestManager.cpp: 26 (WebKit): 27 (WebKit::NotificationPermissionRequestManager::startRequest): 28 (WebKit::NotificationPermissionRequestManager::cancelRequest): 29 (WebKit::NotificationPermissionRequestManager::permissionLevel): 30 (WebKit::NotificationPermissionRequestManager::didReceiveNotificationPermissionDecision): 31 * WebProcess/Notifications/WebNotificationManager.cpp: 32 (WebKit): 33 (WebKit::WebNotificationManager::initialize): 34 (WebKit::WebNotificationManager::didUpdateNotificationDecision): 35 (WebKit::WebNotificationManager::didRemoveNotificationDecisions): 36 (WebKit::WebNotificationManager::policyForOrigin): 37 (WebKit::WebNotificationManager::show): 38 (WebKit::WebNotificationManager::cancel): 39 (WebKit::WebNotificationManager::clearNotifications): 40 (WebKit::WebNotificationManager::didDestroyNotification): 41 (WebKit::WebNotificationManager::didShowNotification): 42 (WebKit::WebNotificationManager::didClickNotification): 43 (WebKit::WebNotificationManager::didCloseNotifications): 44 * WebProcess/Notifications/WebNotificationManager.h: 45 (WebNotificationManager): 46 * WebProcess/WebCoreSupport/WebNotificationClient.cpp: 47 * WebProcess/WebCoreSupport/WebNotificationClient.h: 48 * WebProcess/WebPage/WebPage.cpp: 49 (WebKit::WebPage::WebPage): 50 (WebKit::WebPage::updatePreferences): 51 * WebProcess/WebProcess.cpp: 52 (WebKit::WebProcess::WebProcess): 53 (WebKit::WebProcess::didReceiveMessage): 54 * WebProcess/WebProcess.h: 55 (WebProcess): 56 * WebProcess/mac/WebProcessMac.mm: 57 (WebKit::WebProcess::platformInitializeWebProcess): 58 1 59 2012-03-14 Dinu Jacob <dinu.jacob@nokia.com> 2 60 -
trunk/Source/WebKit2/Shared/WebProcessCreationParameters.cpp
r110425 r110784 100 100 #endif 101 101 102 #if ENABLE(NOTIFICATIONS) 102 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) 103 103 encoder->encode(notificationPermissions); 104 104 #endif … … 195 195 #endif 196 196 197 #if ENABLE(NOTIFICATIONS) 197 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) 198 198 if (!decoder->decode(parameters.notificationPermissions)) 199 199 return false; -
trunk/Source/WebKit2/Shared/WebProcessCreationParameters.h
r110425 r110784 123 123 #endif 124 124 125 #if ENABLE(NOTIFICATIONS) 125 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) 126 126 HashMap<String, bool> notificationPermissions; 127 127 #endif -
trunk/Source/WebKit2/UIProcess/WebContext.cpp
r110425 r110784 280 280 parameters.defaultRequestTimeoutInterval = WebURLRequest::defaultTimeoutInterval(); 281 281 282 #if ENABLE(NOTIFICATIONS) 282 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) 283 283 m_notificationManagerProxy->populateCopyOfNotificationPermissions(parameters.notificationPermissions); 284 284 #endif -
trunk/Source/WebKit2/WebProcess/Notifications/NotificationPermissionRequestManager.cpp
r110381 r110784 42 42 namespace WebKit { 43 43 44 #if ENABLE(NOTIFICATIONS) 44 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) 45 45 static uint64_t generateRequestID() 46 46 { … … 62 62 void NotificationPermissionRequestManager::startRequest(SecurityOrigin* origin, PassRefPtr<VoidCallback> callback) 63 63 { 64 #if ENABLE(NOTIFICATIONS) 64 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) 65 65 if (permissionLevel(origin) != NotificationClient::PermissionNotAllowed) { 66 66 callback->handleEvent(); … … 81 81 void NotificationPermissionRequestManager::cancelRequest(SecurityOrigin* origin) 82 82 { 83 #if ENABLE(NOTIFICATIONS) 83 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) 84 84 uint64_t id = m_originToIDMap.take(origin); 85 85 if (!id) … … 95 95 NotificationClient::Permission NotificationPermissionRequestManager::permissionLevel(SecurityOrigin* securityOrigin) 96 96 { 97 #if ENABLE(NOTIFICATIONS) 97 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) 98 98 if (!m_page->corePage()->settings()->notificationsEnabled()) 99 99 return NotificationClient::PermissionDenied; … … 108 108 void NotificationPermissionRequestManager::didReceiveNotificationPermissionDecision(uint64_t requestID, bool allowed) 109 109 { 110 #if ENABLE(NOTIFICATIONS) 110 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) 111 111 if (!isRequestIDValid(requestID)) 112 112 return; -
trunk/Source/WebKit2/WebProcess/Notifications/WebNotificationManager.cpp
r110381 r110784 30 30 #include "WebProcess.h" 31 31 32 #if ENABLE(NOTIFICATIONS) 32 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) 33 33 #include "WebNotification.h" 34 34 #include "WebNotificationManagerProxyMessages.h" … … 46 46 namespace WebKit { 47 47 48 #if ENABLE(NOTIFICATIONS) 48 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) 49 49 static uint64_t generateNotificationID() 50 50 { … … 70 70 void WebNotificationManager::initialize(const HashMap<String, bool>& permissions) 71 71 { 72 #if ENABLE(NOTIFICATIONS) 72 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) 73 73 m_permissionsMap = permissions; 74 74 #endif … … 77 77 void WebNotificationManager::didUpdateNotificationDecision(const String& originString, bool allowed) 78 78 { 79 #if ENABLE(NOTIFICATIONS) 79 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) 80 80 m_permissionsMap.set(originString, allowed); 81 81 #endif … … 84 84 void WebNotificationManager::didRemoveNotificationDecisions(const Vector<String>& originStrings) 85 85 { 86 #if ENABLE(NOTIFICATIONS) 86 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) 87 87 size_t count = originStrings.size(); 88 88 for (size_t i = 0; i < count; ++i) … … 93 93 NotificationClient::Permission WebNotificationManager::policyForOrigin(WebCore::SecurityOrigin *origin) const 94 94 { 95 #if ENABLE(NOTIFICATIONS) 95 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) 96 96 if (!origin) 97 97 return NotificationClient::PermissionNotAllowed; … … 107 107 bool WebNotificationManager::show(Notification* notification, WebPage* page) 108 108 { 109 #if ENABLE(NOTIFICATIONS) 109 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) 110 110 if (!notification || !page->corePage()->settings()->notificationsEnabled()) 111 111 return true; … … 127 127 void WebNotificationManager::cancel(Notification* notification, WebPage* page) 128 128 { 129 #if ENABLE(NOTIFICATIONS) 129 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) 130 130 if (!notification || !page->corePage()->settings()->notificationsEnabled()) 131 131 return; … … 141 141 void WebNotificationManager::clearNotifications(WebCore::ScriptExecutionContext* context, WebPage* page) 142 142 { 143 #if ENABLE(NOTIFICATIONS) 143 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) 144 144 NotificationContextMap::iterator it = m_notificationContextMap.find(context); 145 145 if (it == m_notificationContextMap.end()) … … 162 162 void WebNotificationManager::didDestroyNotification(Notification* notification, WebPage* page) 163 163 { 164 #if ENABLE(NOTIFICATIONS) 164 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) 165 165 uint64_t notificationID = m_notificationMap.take(notification); 166 166 if (!notificationID) … … 175 175 void WebNotificationManager::didShowNotification(uint64_t notificationID) 176 176 { 177 #if ENABLE(NOTIFICATIONS) 177 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) 178 178 if (!isNotificationIDValid(notificationID)) 179 179 return; … … 189 189 void WebNotificationManager::didClickNotification(uint64_t notificationID) 190 190 { 191 #if ENABLE(NOTIFICATIONS) 191 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) 192 192 if (!isNotificationIDValid(notificationID)) 193 193 return; … … 203 203 void WebNotificationManager::didCloseNotifications(const Vector<uint64_t>& notificationIDs) 204 204 { 205 #if ENABLE(NOTIFICATIONS) 205 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) 206 206 size_t count = notificationIDs.size(); 207 207 for (size_t i = 0; i < count; ++i) { … … 222 222 } 223 223 224 #if ENABLE(NOTIFICATIONS) 224 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) 225 225 void WebNotificationManager::removeNotificationFromContextMap(uint64_t notificationID, Notification* notification) 226 226 { -
trunk/Source/WebKit2/WebProcess/Notifications/WebNotificationManager.h
r110381 r110784 79 79 void didRemoveNotificationDecisions(const Vector<String>& originStrings); 80 80 81 #if ENABLE(NOTIFICATIONS) 81 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) 82 82 void removeNotificationFromContextMap(uint64_t notificationID, WebCore::Notification*); 83 83 #endif … … 85 85 WebProcess* m_process; 86 86 87 #if ENABLE(NOTIFICATIONS) 87 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) 88 88 typedef HashMap<RefPtr<WebCore::Notification>, uint64_t> NotificationMap; 89 89 NotificationMap m_notificationMap; -
trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebNotificationClient.cpp
r110381 r110784 27 27 #include "WebNotificationClient.h" 28 28 29 #if ENABLE(NOTIFICATIONS) 29 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) 30 30 31 31 #include "NotificationPermissionRequestManager.h" … … 92 92 } // namespace WebKit 93 93 94 #endif // ENABLE(NOTIFICATIONS) 94 #endif // ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) -
trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebNotificationClient.h
r110381 r110784 27 27 #define WebNotificationClient_h 28 28 29 #if ENABLE(NOTIFICATIONS) 29 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) 30 30 31 31 #include <WebCore/NotificationClient.h> … … 60 60 } // namespace WebKit 61 61 62 #endif // ENABLE(NOTIFICATIONS) 62 #endif // ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) 63 63 64 64 #endif // WebNotificationClient_h -
trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp
r110743 r110784 238 238 m_page = adoptPtr(new Page(pageClients)); 239 239 240 #if ENABLE(NOTIFICATIONS) 240 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) 241 241 WebCore::provideNotification(m_page.get(), new WebNotificationClient(this)); 242 242 #endif … … 1953 1953 #endif 1954 1954 1955 #if ENABLE(NOTIFICATIONS) 1955 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) 1956 1956 settings->setNotificationsEnabled(store.getBoolValueForKey(WebPreferencesKey::notificationsEnabledKey())); 1957 1957 #endif -
trunk/Source/WebKit2/WebProcess/WebProcess.cpp
r108125 r110784 142 142 , m_textCheckerState() 143 143 , m_geolocationManager(this) 144 #if ENABLE(NOTIFICATIONS) 144 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) 145 145 , m_notificationManager(this) 146 146 #endif … … 639 639 } 640 640 641 #if ENABLE(NOTIFICATIONS) 641 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) 642 642 if (messageID.is<CoreIPC::MessageClassWebNotificationManager>()) { 643 643 m_notificationManager.didReceiveMessage(connection, messageID, arguments); -
trunk/Source/WebKit2/WebProcess/WebProcess.h
r105475 r110784 49 49 #endif 50 50 51 #if ENABLE(NOTIFICATIONS) 51 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) 52 52 #include "WebNotificationManager.h" 53 53 #endif … … 134 134 WebGeolocationManager& geolocationManager() { return m_geolocationManager; } 135 135 136 #if ENABLE(NOTIFICATIONS) 136 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) 137 137 WebNotificationManager& notificationManager() { return m_notificationManager; } 138 138 #endif … … 269 269 TextCheckerState m_textCheckerState; 270 270 WebGeolocationManager m_geolocationManager; 271 #if ENABLE(NOTIFICATIONS) 271 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) 272 272 WebNotificationManager m_notificationManager; 273 273 #endif -
trunk/Source/WebKit2/WebProcess/mac/WebProcessMac.mm
r110425 r110784 252 252 m_compositingRenderServerPort = parameters.acceleratedCompositingPort.port(); 253 253 254 #if ENABLE(NOTIFICATIONS) 254 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) 255 255 m_notificationManager.initialize(parameters.notificationPermissions); 256 256 #endif -
trunk/Tools/ChangeLog
r110783 r110784 1 2012-03-13 Jon Lee <jonlee@apple.com> 2 3 Separate NOTIFICATIONS and LEGACY_NOTIFICATIONS 4 https://bugs.webkit.org/show_bug.cgi?id=80922 5 <rdar://problem/11035082> 6 7 Reviewed by Jian Li. 8 9 You can include either NOTIFICATIONS or LEGACY_NOTIFICATIONS and have a complete API. 10 LEGACY_NOTIFICATIONS should cover all of the previous functionality, and NOTIFICATIONS will cover the 11 new API. Therefore, APIs that are common between the two will have: 12 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) 13 14 This patch initially sets both to be exactly the same. As other bugs with patches begin to migrate to 15 the new API, the defines will begin to split. This allows ports to decide which set of APIs to include. 16 17 Update everything to be #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) 18 * DumpRenderTree/chromium/LayoutTestController.cpp: 19 (LayoutTestController::grantDesktopNotificationPermission): 20 (LayoutTestController::simulateDesktopNotificationClick): 21 * DumpRenderTree/chromium/NotificationPresenter.cpp: 22 * DumpRenderTree/chromium/TestShell.cpp: 23 (TestShell::TestShell): 24 (TestShell::resetTestController): 25 * DumpRenderTree/win/DRTDesktopNotificationPresenter.cpp: 26 (DRTDesktopNotificationPresenter::checkNotificationPermission): 27 1 28 2012-03-13 Ojan Vafai <ojan@chromium.org> 2 29 -
trunk/Tools/DumpRenderTree/chromium/LayoutTestController.cpp
r109288 r110784 1192 1192 return; 1193 1193 } 1194 #if ENABLE(NOTIFICATIONS) 1194 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) 1195 1195 m_shell->notificationPresenter()->grantPermission(cppVariantToWebString(arguments[0])); 1196 1196 #endif … … 1204 1204 return; 1205 1205 } 1206 #if ENABLE(NOTIFICATIONS) 1206 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) 1207 1207 if (m_shell->notificationPresenter()->simulateClick(cppVariantToWebString(arguments[0]))) 1208 1208 result->set(true); -
trunk/Tools/DumpRenderTree/chromium/NotificationPresenter.cpp
r102044 r110784 32 32 #include "NotificationPresenter.h" 33 33 34 #if ENABLE(NOTIFICATIONS) 34 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) 35 35 36 36 #include "WebKit.h" … … 152 152 } 153 153 154 #endif // ENABLE(NOTIFICATIONS) 154 #endif // ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) -
trunk/Tools/DumpRenderTree/chromium/TestShell.cpp
r110032 r110784 139 139 m_eventSender = adoptPtr(new EventSender(this)); 140 140 m_textInputController = adoptPtr(new TextInputController(this)); 141 #if ENABLE(NOTIFICATIONS) 141 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) 142 142 m_notificationPresenter = adoptPtr(new NotificationPresenter(this)); 143 143 #endif … … 295 295 m_eventSender->reset(); 296 296 m_webViewHost->reset(); 297 #if ENABLE(NOTIFICATIONS) 297 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) 298 298 m_notificationPresenter->reset(); 299 299 #endif -
trunk/Tools/DumpRenderTree/win/DRTDesktopNotificationPresenter.cpp
r110381 r110784 124 124 /* [out, retval] */ int* result) 125 125 { 126 #if ENABLE(NOTIFICATIONS) 126 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) 127 127 JSStringRef jsOrigin = JSStringCreateWithBSTR(origin); 128 128 bool allowed = ::gLayoutTestController->checkDesktopNotificationPermission(jsOrigin);
Note: See TracChangeset
for help on using the changeset viewer.