Separate NOTIFICATIONS and LEGACY_NOTIFICATIONS
authorjonlee@apple.com <jonlee@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 14 Mar 2012 23:41:04 +0000 (23:41 +0000)
committerjonlee@apple.com <jonlee@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 14 Mar 2012 23:41:04 +0000 (23:41 +0000)
https://bugs.webkit.org/show_bug.cgi?id=80922
<rdar://problem/11035082>

Reviewed by Jian Li.

You can include either NOTIFICATIONS or LEGACY_NOTIFICATIONS and have a complete API.
LEGACY_NOTIFICATIONS should cover all of the previous functionality, and NOTIFICATIONS will cover the
new API. Therefore, APIs that are common between the two will have:
#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)

This patch initially sets both to be exactly the same. As other bugs with patches begin to migrate to
the new API, the defines will begin to split. This allows ports to decide which set of APIs to include.

Source/WebCore:

* bindings/scripts/InFilesCompiler.pm: Update the script to handle the "|" flag in a conditional.
(preferredConditional):
(conditionalStringFromAttributeValue):
(generateInterfacesHeader):
(generateHeadersHeader):

Update everything to be #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
* WebCore.exp.in:
* bindings/cpp/WebDOMEventTarget.cpp:
(toWebKit):
* bindings/js/JSDesktopNotificationsCustom.cpp:
* bindings/v8/custom/V8NotificationCenterCustom.cpp:
* dom/EventTargetFactory.in:
* notifications/Notification.cpp:
* notifications/Notification.h:
* notifications/Notification.idl:
* notifications/NotificationCenter.cpp:
* notifications/NotificationCenter.h:
* notifications/NotificationCenter.idl:
* notifications/NotificationContents.h:
* notifications/NotificationController.cpp:
* notifications/NotificationController.h:
* page/DOMWindow.cpp:
(WebCore::DOMWindow::~DOMWindow):
(WebCore::DOMWindow::willDetachPage):
(WebCore::DOMWindow::disconnectDOMWindowProperties):
(WebCore::DOMWindow::clearDOMWindowProperties):
(WebCore):
* page/DOMWindow.h:
(DOMWindow):
* page/DOMWindow.idl:
* page/Frame.cpp:
(WebCore::Frame::willDetachPage):
(WebCore::Frame::transferChildFrameToNewDocument):
* workers/WorkerContext.cpp:
(WebCore::WorkerContext::~WorkerContext):
(WebCore):
* workers/WorkerContext.h:
(WorkerContext):
* workers/WorkerContext.idl:
* workers/WorkerThread.cpp:
(WebCore::WorkerThread::WorkerThread):
* workers/WorkerThread.h:
(WorkerThread):

Source/WebKit/blackberry:

Update everything to be #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
* Api/WebPage.cpp:
(BlackBerry::WebKit::WebPagePrivate::init):
* WebCoreSupport/NotificationPresenterImpl.cpp:
* WebCoreSupport/NotificationPresenterImpl.h:

Source/WebKit/chromium:

Update everything to be #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
* src/AssertMatchingEnums.cpp:
* src/NotificationPresenterImpl.cpp:
* src/NotificationPresenterImpl.h:
* src/WebNotification.cpp:
* src/WebRuntimeFeatures.cpp:
(WebKit::WebRuntimeFeatures::enableNotifications):
(WebKit::WebRuntimeFeatures::isNotificationsEnabled):
* src/WebViewImpl.cpp:
(WebKit::WebViewImpl::WebViewImpl):
(WebKit):
* src/WebViewImpl.h:
(WebViewImpl):

Source/WebKit/efl:

Update everything to be #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
* WebCoreSupport/ChromeClientEfl.cpp:
(WebCore):
* WebCoreSupport/ChromeClientEfl.h:
(ChromeClientEfl):
* WebCoreSupport/NotificationPresenterClientEfl.cpp:
* WebCoreSupport/NotificationPresenterClientEfl.h:

Source/WebKit/mac:

Update everything to be #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
* WebCoreSupport/WebNotificationClient.h:
* WebCoreSupport/WebNotificationClient.mm:
(WebNotificationClient::show):
(WebNotificationClient::cancel):
(WebNotificationClient::clearNotifications):
(WebNotificationClient::notificationObjectDestroyed):
(WebNotificationClient::notificationControllerDestroyed):
(WebNotificationClient::requestPermission):
(WebNotificationClient::checkPermission):
* WebView/WebNotification.mm:
(-[WebNotification title]):
(-[WebNotification body]):
(-[WebNotification replaceID]):
(-[WebNotification origin]):
(-[WebNotification notificationID]):
(-[WebNotification dispatchShowEvent]):
(-[WebNotification dispatchCloseEvent]):
(-[WebNotification dispatchClickEvent]):
(-[WebNotification dispatchErrorEvent]):
* WebView/WebNotificationInternal.h:
* WebView/WebView.mm:
(-[WebView _commonInitializationWithFrameName:groupName:]):

Source/WebKit/qt:

Update everything to be #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
* Api/qwebpage.cpp:
(QWebPagePrivate::QWebPagePrivate):
(QWebPagePrivate::~QWebPagePrivate):
(QWebPage::setFeaturePermission):
* WebCoreSupport/DumpRenderTreeSupportQt.cpp:
(DumpRenderTreeSupportQt::dumpNotification):
(DumpRenderTreeSupportQt::simulateDesktopNotificationClick):
* WebCoreSupport/NotificationPresenterClientQt.cpp:
(WebCore):
(WebCore::NotificationWrapper::NotificationWrapper):
(WebCore::NotificationWrapper::close):
(WebCore::NotificationWrapper::title):
(WebCore::NotificationWrapper::message):
(WebCore::NotificationWrapper::iconData):
(WebCore::NotificationWrapper::openerPageUrl):
(WebCore::NotificationWrapper::notificationClicked):
(WebCore::NotificationWrapper::notificationClosed):
* WebCoreSupport/NotificationPresenterClientQt.h:
(WebCore):

Source/WebKit/win:

Update everything to be #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
* WebCoreSupport/WebChromeClient.cpp:
(WebChromeClient::WebChromeClient):
* WebCoreSupport/WebChromeClient.h:
(WebChromeClient):
* WebCoreSupport/WebDesktopNotificationsDelegate.cpp:
* WebCoreSupport/WebDesktopNotificationsDelegate.h:

Source/WebKit/wince:

Update everything to be #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
* WebCoreSupport/ChromeClientWinCE.h:
(ChromeClientWinCE):

Source/WebKit2:

Update everything to be #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
* Shared/WebProcessCreationParameters.cpp:
(WebKit::WebProcessCreationParameters::encode):
(WebKit::WebProcessCreationParameters::decode):
* Shared/WebProcessCreationParameters.h:
(WebProcessCreationParameters):
* UIProcess/WebContext.cpp:
(WebKit::WebContext::ensureWebProcess):
* WebProcess/Notifications/NotificationPermissionRequestManager.cpp:
(WebKit):
(WebKit::NotificationPermissionRequestManager::startRequest):
(WebKit::NotificationPermissionRequestManager::cancelRequest):
(WebKit::NotificationPermissionRequestManager::permissionLevel):
(WebKit::NotificationPermissionRequestManager::didReceiveNotificationPermissionDecision):
* WebProcess/Notifications/WebNotificationManager.cpp:
(WebKit):
(WebKit::WebNotificationManager::initialize):
(WebKit::WebNotificationManager::didUpdateNotificationDecision):
(WebKit::WebNotificationManager::didRemoveNotificationDecisions):
(WebKit::WebNotificationManager::policyForOrigin):
(WebKit::WebNotificationManager::show):
(WebKit::WebNotificationManager::cancel):
(WebKit::WebNotificationManager::clearNotifications):
(WebKit::WebNotificationManager::didDestroyNotification):
(WebKit::WebNotificationManager::didShowNotification):
(WebKit::WebNotificationManager::didClickNotification):
(WebKit::WebNotificationManager::didCloseNotifications):
* WebProcess/Notifications/WebNotificationManager.h:
(WebNotificationManager):
* WebProcess/WebCoreSupport/WebNotificationClient.cpp:
* WebProcess/WebCoreSupport/WebNotificationClient.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::WebPage):
(WebKit::WebPage::updatePreferences):
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::WebProcess):
(WebKit::WebProcess::didReceiveMessage):
* WebProcess/WebProcess.h:
(WebProcess):
* WebProcess/mac/WebProcessMac.mm:
(WebKit::WebProcess::platformInitializeWebProcess):

Tools:

Update everything to be #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
* DumpRenderTree/chromium/LayoutTestController.cpp:
(LayoutTestController::grantDesktopNotificationPermission):
(LayoutTestController::simulateDesktopNotificationClick):
* DumpRenderTree/chromium/NotificationPresenter.cpp:
* DumpRenderTree/chromium/TestShell.cpp:
(TestShell::TestShell):
(TestShell::resetTestController):
* DumpRenderTree/win/DRTDesktopNotificationPresenter.cpp:
(DRTDesktopNotificationPresenter::checkNotificationPermission):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@110784 268f45cc-cd09-0410-ab3c-d52691b4dbfc

78 files changed:
Source/WebCore/ChangeLog
Source/WebCore/WebCore.exp.in
Source/WebCore/bindings/cpp/WebDOMEventTarget.cpp
Source/WebCore/bindings/js/JSDesktopNotificationsCustom.cpp
Source/WebCore/bindings/scripts/InFilesCompiler.pm
Source/WebCore/bindings/v8/custom/V8NotificationCenterCustom.cpp
Source/WebCore/dom/EventTargetFactory.in
Source/WebCore/notifications/Notification.cpp
Source/WebCore/notifications/Notification.h
Source/WebCore/notifications/Notification.idl
Source/WebCore/notifications/NotificationCenter.cpp
Source/WebCore/notifications/NotificationCenter.h
Source/WebCore/notifications/NotificationCenter.idl
Source/WebCore/notifications/NotificationContents.h
Source/WebCore/notifications/NotificationController.cpp
Source/WebCore/notifications/NotificationController.h
Source/WebCore/page/DOMWindow.cpp
Source/WebCore/page/DOMWindow.h
Source/WebCore/page/DOMWindow.idl
Source/WebCore/page/Frame.cpp
Source/WebCore/workers/WorkerContext.cpp
Source/WebCore/workers/WorkerContext.h
Source/WebCore/workers/WorkerContext.idl
Source/WebCore/workers/WorkerThread.cpp
Source/WebCore/workers/WorkerThread.h
Source/WebKit/blackberry/Api/WebPage.cpp
Source/WebKit/blackberry/ChangeLog
Source/WebKit/blackberry/WebCoreSupport/NotificationPresenterImpl.cpp
Source/WebKit/blackberry/WebCoreSupport/NotificationPresenterImpl.h
Source/WebKit/chromium/ChangeLog
Source/WebKit/chromium/src/AssertMatchingEnums.cpp
Source/WebKit/chromium/src/NotificationPresenterImpl.cpp
Source/WebKit/chromium/src/NotificationPresenterImpl.h
Source/WebKit/chromium/src/WebNotification.cpp
Source/WebKit/chromium/src/WebRuntimeFeatures.cpp
Source/WebKit/chromium/src/WebViewImpl.cpp
Source/WebKit/chromium/src/WebViewImpl.h
Source/WebKit/efl/ChangeLog
Source/WebKit/efl/WebCoreSupport/ChromeClientEfl.cpp
Source/WebKit/efl/WebCoreSupport/ChromeClientEfl.h
Source/WebKit/efl/WebCoreSupport/NotificationPresenterClientEfl.cpp
Source/WebKit/efl/WebCoreSupport/NotificationPresenterClientEfl.h
Source/WebKit/mac/ChangeLog
Source/WebKit/mac/WebCoreSupport/WebNotificationClient.h
Source/WebKit/mac/WebCoreSupport/WebNotificationClient.mm
Source/WebKit/mac/WebView/WebNotification.mm
Source/WebKit/mac/WebView/WebNotificationInternal.h
Source/WebKit/mac/WebView/WebView.mm
Source/WebKit/qt/Api/qwebpage.cpp
Source/WebKit/qt/ChangeLog
Source/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp
Source/WebKit/qt/WebCoreSupport/NotificationPresenterClientQt.cpp
Source/WebKit/qt/WebCoreSupport/NotificationPresenterClientQt.h
Source/WebKit/win/ChangeLog
Source/WebKit/win/WebCoreSupport/WebChromeClient.cpp
Source/WebKit/win/WebCoreSupport/WebChromeClient.h
Source/WebKit/win/WebCoreSupport/WebDesktopNotificationsDelegate.cpp
Source/WebKit/win/WebCoreSupport/WebDesktopNotificationsDelegate.h
Source/WebKit/wince/ChangeLog
Source/WebKit/wince/WebCoreSupport/ChromeClientWinCE.h
Source/WebKit2/ChangeLog
Source/WebKit2/Shared/WebProcessCreationParameters.cpp
Source/WebKit2/Shared/WebProcessCreationParameters.h
Source/WebKit2/UIProcess/WebContext.cpp
Source/WebKit2/WebProcess/Notifications/NotificationPermissionRequestManager.cpp
Source/WebKit2/WebProcess/Notifications/WebNotificationManager.cpp
Source/WebKit2/WebProcess/Notifications/WebNotificationManager.h
Source/WebKit2/WebProcess/WebCoreSupport/WebNotificationClient.cpp
Source/WebKit2/WebProcess/WebCoreSupport/WebNotificationClient.h
Source/WebKit2/WebProcess/WebPage/WebPage.cpp
Source/WebKit2/WebProcess/WebProcess.cpp
Source/WebKit2/WebProcess/WebProcess.h
Source/WebKit2/WebProcess/mac/WebProcessMac.mm
Tools/ChangeLog
Tools/DumpRenderTree/chromium/LayoutTestController.cpp
Tools/DumpRenderTree/chromium/NotificationPresenter.cpp
Tools/DumpRenderTree/chromium/TestShell.cpp
Tools/DumpRenderTree/win/DRTDesktopNotificationPresenter.cpp

index bdfd132..acc3fb0 100644 (file)
@@ -1,3 +1,64 @@
+2012-03-13  Jon Lee  <jonlee@apple.com>
+
+        Separate NOTIFICATIONS and LEGACY_NOTIFICATIONS
+        https://bugs.webkit.org/show_bug.cgi?id=80922
+        <rdar://problem/11035082>
+
+        Reviewed by Jian Li.
+
+        You can include either NOTIFICATIONS or LEGACY_NOTIFICATIONS and have a complete API.
+        LEGACY_NOTIFICATIONS should cover all of the previous functionality, and NOTIFICATIONS will cover the
+        new API. Therefore, APIs that are common between the two will have:
+        #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
+
+        This patch initially sets both to be exactly the same. As other bugs with patches begin to migrate to
+        the new API, the defines will begin to split. This allows ports to decide which set of APIs to include.
+
+        * bindings/scripts/InFilesCompiler.pm: Update the script to handle the "|" flag in a conditional.
+        (preferredConditional):
+        (conditionalStringFromAttributeValue):
+        (generateInterfacesHeader):
+        (generateHeadersHeader):
+
+        Update everything to be #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
+        * WebCore.exp.in:
+        * bindings/cpp/WebDOMEventTarget.cpp:
+        (toWebKit):
+        * bindings/js/JSDesktopNotificationsCustom.cpp:
+        * bindings/v8/custom/V8NotificationCenterCustom.cpp:
+        * dom/EventTargetFactory.in:
+        * notifications/Notification.cpp:
+        * notifications/Notification.h:
+        * notifications/Notification.idl:
+        * notifications/NotificationCenter.cpp:
+        * notifications/NotificationCenter.h:
+        * notifications/NotificationCenter.idl:
+        * notifications/NotificationContents.h:
+        * notifications/NotificationController.cpp:
+        * notifications/NotificationController.h:
+        * page/DOMWindow.cpp:
+        (WebCore::DOMWindow::~DOMWindow):
+        (WebCore::DOMWindow::willDetachPage):
+        (WebCore::DOMWindow::disconnectDOMWindowProperties):
+        (WebCore::DOMWindow::clearDOMWindowProperties):
+        (WebCore):
+        * page/DOMWindow.h:
+        (DOMWindow):
+        * page/DOMWindow.idl:
+        * page/Frame.cpp:
+        (WebCore::Frame::willDetachPage):
+        (WebCore::Frame::transferChildFrameToNewDocument):
+        * workers/WorkerContext.cpp:
+        (WebCore::WorkerContext::~WorkerContext):
+        (WebCore):
+        * workers/WorkerContext.h:
+        (WorkerContext):
+        * workers/WorkerContext.idl:
+        * workers/WorkerThread.cpp:
+        (WebCore::WorkerThread::WorkerThread):
+        * workers/WorkerThread.h:
+        (WorkerThread):
+
 2012-03-14  Sheriff Bot  <webkit.review.bot@gmail.com>
 
         Unreviewed, rolling out r110744.
index 23b25b7..171694a 100644 (file)
@@ -2122,7 +2122,7 @@ __ZNK7WebCore7IntSizecv7_NSSizeEv
 _wkCreateVMPressureDispatchOnMainQueue
 #endif
 
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
 __ZN7WebCore12NotificationC1Ev
 __ZN7WebCore12NotificationD1Ev
 __ZN7WebCore12Notification17dispatchShowEventEv
index f0c6098..17344fc 100644 (file)
@@ -56,7 +56,7 @@
 #include "WebDOMSharedWorkerContext.h"
 #endif
 
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
 #include "WebDOMNotification.h"
 #endif
 
@@ -122,7 +122,7 @@ ConvertTo(SharedWorker)
 ConvertTo(SharedWorkerContext)
 #endif
 
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
 ConvertTo(Notification)
 #endif
 
@@ -166,7 +166,7 @@ WebDOMEventTarget toWebKit(WebCore::EventTarget* value)
         return toWebKit(workerContext);
 #endif
 
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
     if (WebCore::Notification* notification = value->toNotification())
         return toWebKit(notification);
 #endif
index 16a962c..a0cad88 100644 (file)
@@ -30,7 +30,7 @@
 
 #include "config.h"
 
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
 
 #include "Document.h"
 #include "JSCustomVoidCallback.h"
@@ -70,4 +70,4 @@ JSValue JSNotificationCenter::requestPermission(ExecState* exec)
 
 } // namespace
 
-#endif // ENABLE(NOTIFICATIONS)
+#endif // ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
index e126068..3dcd772 100644 (file)
@@ -166,6 +166,23 @@ sub toMacroStyle($$)
     die "Ok, you got me. This script is really just a giant hack. (\$camelCase=${camelCase})";
 }
 
+sub preferredConditional()
+{
+    my $object = shift;
+    my $conditional = shift;
+
+    my @conditionals = split('\\|', $conditional);
+    return $conditionals[0];
+}
+
+sub conditionalStringFromAttributeValue()
+{
+    my $object = shift;
+    my $conditional = shift;
+    
+    return "ENABLE(" . join(') || ENABLE(', split('\\|', $conditional)) . ")";
+}
+
 sub generateInterfacesHeader()
 {
     my $object = shift;
@@ -202,17 +219,18 @@ sub generateInterfacesHeader()
     my $macroStyledNamespace = $object->toMacroStyle($namespace);
 
     for my $conditional (sort keys %interfacesByConditional) {
-        print F "#if ENABLE($conditional)\n";
-        print F "#define DOM_${macroStyledNamespace}_INTERFACES_FOR_EACH_$conditional(macro) \\\n";
+        my $preferredConditional = $object->preferredConditional($conditional);
+        print F "#if " . $object->conditionalStringFromAttributeValue($conditional) . "\n";
+        print F "#define DOM_${macroStyledNamespace}_INTERFACES_FOR_EACH_$preferredConditional(macro) \\\n";
 
         for my $interface (sort keys %{ $interfacesByConditional{$conditional} }) {
             next if defined($unconditionalInterfaces{$interface});
             print F "    macro($interface) \\\n";
         }
 
-        print F "// End of DOM_${macroStyledNamespace}_INTERFACES_FOR_EACH_$conditional\n";
+        print F "// End of DOM_${macroStyledNamespace}_INTERFACES_FOR_EACH_$preferredConditional\n";
         print F "#else\n";
-        print F "#define DOM_${macroStyledNamespace}_INTERFACES_FOR_EACH_$conditional(macro)\n";
+        print F "#define DOM_${macroStyledNamespace}_INTERFACES_FOR_EACH_$preferredConditional(macro)\n";
         print F "#endif\n";
         print F "\n";
     }
@@ -224,7 +242,8 @@ sub generateInterfacesHeader()
     }
     print F "    \\\n";
     for my $conditional (sort keys %interfacesByConditional) {
-        print F "    DOM_${macroStyledNamespace}_INTERFACES_FOR_EACH_$conditional(macro) \\\n";
+        my $preferredConditional = $object->preferredConditional($conditional);
+        print F "    DOM_${macroStyledNamespace}_INTERFACES_FOR_EACH_$preferredConditional(macro) \\\n";
     }
 
     print F "\n";
@@ -258,7 +277,7 @@ sub generateHeadersHeader()
         next if defined($includedInterfaces{$interfaceName});
         $includedInterfaces{$interfaceName} = 1;
 
-        print F "#if ENABLE($conditional)\n" if $conditional;
+        print F "#if " . $object->conditionalStringFromAttributeValue($conditional) . "\n" if $conditional;
         print F "#include \"$interfaceName.h\"\n";
         print F "#if USE(JSC)\n";
         print F "#include \"JS$interfaceName.h\"\n";
index 7eec7ef..4830bb0 100644 (file)
@@ -30,7 +30,7 @@
 
 #include "config.h"
 
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
 #include "V8NotificationCenter.h"
 
 #include "ExceptionCode.h"
@@ -107,4 +107,4 @@ v8::Handle<v8::Value> V8NotificationCenter::requestPermissionCallback(const v8::
 
 }  // namespace WebCore
 
-#endif  // ENABLE(NOTIFICATIONS)
+#endif // ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
index 6195873..c8d276e 100644 (file)
@@ -18,7 +18,7 @@ MediaController conditional=VIDEO
 MediaStream conditional=MEDIA_STREAM
 MessagePort
 Node
-Notification conditional=NOTIFICATIONS
+Notification conditional=NOTIFICATIONS|LEGACY_NOTIFICATIONS
 SharedWorker conditional=SHARED_WORKERS
 SharedWorkerContext conditional=SHARED_WORKERS
 SVGElementInstance conditional=SVG
index 5de0e52..603e0cf 100644 (file)
@@ -31,7 +31,7 @@
 
 #include "config.h"
 
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
 
 #include "Notification.h"
 
@@ -262,4 +262,4 @@ void Notification::dispatchErrorEvent()
 
 } // namespace WebCore
 
-#endif // ENABLE(NOTIFICATIONS)
+#endif // ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
index dd0d6ed..b8f337c 100644 (file)
@@ -46,7 +46,7 @@
 #include <wtf/RefPtr.h>
 #include <wtf/text/AtomicStringHash.h>
 
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
 namespace WebCore {
 
 class NotificationCenter;
@@ -164,6 +164,6 @@ private:
 
 } // namespace WebCore
 
-#endif // ENABLE(NOTIFICATIONS)
+#endif // ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
 
 #endif // Notifications_h
index d8cb3cc..e6dd25a 100644 (file)
@@ -32,7 +32,7 @@
 module threads {
 
     interface [
-        Conditional=NOTIFICATIONS,
+        Conditional=NOTIFICATIONS|LEGACY_NOTIFICATIONS,
         ActiveDOMObject,
         EventTarget,
         OmitConstructor
index ff60445..2f2d7d6 100644 (file)
@@ -31,7 +31,7 @@
 
 #include "config.h"
 
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
 
 #include "NotificationCenter.h"
 
@@ -80,4 +80,4 @@ void NotificationCenter::disconnectFrame()
 
 } // namespace WebCore
 
-#endif // ENABLE(NOTIFICATIONS)
+#endif // ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
index 2cccc0d..2cedac8 100644 (file)
@@ -41,7 +41,7 @@
 #include <wtf/RefCounted.h>
 #include <wtf/RefPtr.h>
 
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
 
 namespace WebCore {
 
@@ -90,6 +90,6 @@ private:
 
 } // namespace WebCore
 
-#endif // ENABLE(NOTIFICATIONS)
+#endif // ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
 
 #endif // NotificationCenter_h
index 8be1ecc..7b0fc25 100644 (file)
@@ -32,7 +32,7 @@
 module threads {
 
     interface [
-        Conditional=NOTIFICATIONS,
+        Conditional=NOTIFICATIONS|LEGACY_NOTIFICATIONS,
         ActiveDOMObject,
         OmitConstructor
     ] NotificationCenter {
index 1186c1c..68add50 100644 (file)
@@ -32,7 +32,7 @@
 #ifndef NotificationContents_h
 #define NotificationContents_h
 
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
 
 #include "KURL.h"
 #include <wtf/text/WTFString.h>
@@ -55,6 +55,6 @@ public:
 
 } // namespace WebCore
 
-#endif // ENABLE(NOTIFICATIONS)
+#endif // ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
 
 #endif // NotificationContents_h
index df235d3..e8efb03 100644 (file)
@@ -26,7 +26,7 @@
 #include "config.h"
 #include "NotificationController.h"
 
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
 
 #include "NotificationClient.h"
 #include <wtf/PassOwnPtr.h>
@@ -70,4 +70,4 @@ void provideNotification(Page* page, NotificationClient* client)
 
 } // namespace WebCore
 
-#endif // ENABLE(NOTIFICATIONS)
+#endif // ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
index 7e9d597..a155268 100644 (file)
@@ -26,7 +26,7 @@
 #ifndef NotificationController_h
 #define NotificationController_h
 
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
 
 #include "Page.h"
 #include <wtf/Forward.h>
@@ -57,6 +57,6 @@ private:
 
 } // namespace WebCore
 
-#endif // ENABLE(NOTIFICATIONS)
+#endif // ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
 
 #endif // NotificationController_h
index 2e4762f..c141673 100644 (file)
@@ -418,7 +418,7 @@ DOMWindow::~DOMWindow()
         ASSERT(!m_sessionStorage);
         ASSERT(!m_localStorage);
         ASSERT(!m_applicationCache);
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
         ASSERT(!m_notifications);
 #endif
 #if ENABLE(BLOB)
@@ -478,7 +478,7 @@ void DOMWindow::willDetachPage()
 {
     InspectorInstrumentation::frameWindowDiscarded(m_frame, this);
 
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
     // Clearing Notifications requests involves accessing the client so it must be done
     // before the frame is detached.
     resetNotifications();
@@ -528,7 +528,7 @@ void DOMWindow::disconnectDOMWindowProperties()
     for (HashSet<DOMWindowProperty*>::iterator it = m_properties.begin(); it != stop; ++it)
         (*it)->disconnectFrame();
 
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
     // FIXME: Notifications shouldn't have different disconnection logic than
     // the rest of the DOMWindowProperties.
     // There is currently no way to reconnect them in resumeFromPageCache() so
@@ -571,7 +571,7 @@ void DOMWindow::clearDOMWindowProperties()
     m_sessionStorage = 0;
     m_localStorage = 0;
     m_applicationCache = 0;
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
     // FIXME: Notifications shouldn't have different disconnection logic than
     // the rest of the DOMWindowProperties.
     resetNotifications();
@@ -784,7 +784,7 @@ Storage* DOMWindow::localStorage(ExceptionCode& ec) const
     return m_localStorage.get();
 }
 
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
 NotificationCenter* DOMWindow::webkitNotifications() const
 {
     if (!isCurrentlyDisplayedInFrame())
index 613624f..bd81b48 100644 (file)
@@ -356,7 +356,7 @@ namespace WebCore {
         Storage* sessionStorage(ExceptionCode&) const;
         Storage* localStorage(ExceptionCode&) const;
 
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
         NotificationCenter* webkitNotifications() const;
         // Renders webkitNotifications object safely inoperable, disconnects
         // if from embedder-provided NotificationClient.
@@ -450,7 +450,7 @@ namespace WebCore {
         mutable RefPtr<Storage> m_localStorage;
         mutable RefPtr<DOMApplicationCache> m_applicationCache;
 
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
         mutable RefPtr<NotificationCenter> m_notifications;
 #endif
 
index 14086bf..f2b90ce 100644 (file)
@@ -170,7 +170,7 @@ module window {
         readonly attribute [V8EnabledAtRuntime] Storage localStorage
             getter raises(DOMException);
 
-#if defined(ENABLE_NOTIFICATIONS) && ENABLE_NOTIFICATIONS
+#if (defined(ENABLE_NOTIFICATIONS) && ENABLE_NOTIFICATIONS) || (defined(ENABLE_LEGACY_NOTIFICATIONS) && ENABLE_LEGACY_NOTIFICATIONS)
         readonly attribute [V8EnabledAtRuntime] NotificationCenter webkitNotifications;
 #endif
 
index ad9cab8..b313649 100644 (file)
@@ -687,7 +687,7 @@ void Frame::willDetachPage()
     if (Frame* parent = tree()->parent())
         parent->loader()->checkLoadComplete();
 
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
     if (m_domWindow)
         m_domWindow->resetNotifications();
 #endif
@@ -737,7 +737,7 @@ void Frame::transferChildFrameToNewDocument()
         }
 
         if (m_domWindow) {
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
             m_domWindow->resetNotifications();
 #endif
         }
index debbeba..fb42f31 100644 (file)
@@ -59,7 +59,7 @@
 #include <wtf/RefPtr.h>
 #include <wtf/UnusedParam.h>
 
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
 #include "NotificationCenter.h"
 #endif
 
@@ -104,7 +104,7 @@ WorkerContext::WorkerContext(const KURL& url, const String& userAgent, WorkerThr
 WorkerContext::~WorkerContext()
 {
     ASSERT(currentThread() == thread()->threadID());
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
     m_notifications.clear();
 #endif
 
@@ -294,7 +294,7 @@ void WorkerContext::addMessageToWorkerConsole(MessageSource source, MessageType
         InspectorInstrumentation::addMessageToConsole(this, source, type, level, message, sourceURL, lineNumber);
 }
 
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
 NotificationCenter* WorkerContext::webkitNotifications() const
 {
     if (!m_notifications)
index f045a48..b5d260e 100644 (file)
@@ -105,7 +105,7 @@ namespace WebCore {
         // ScriptExecutionContext
         virtual WorkerEventQueue* eventQueue() const;
 
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
         NotificationCenter* webkitNotifications() const;
 #endif
 
@@ -172,7 +172,7 @@ namespace WebCore {
         OwnPtr<WorkerScriptController> m_script;
         WorkerThread* m_thread;
 
-#if ENABLE_NOTIFICATIONS
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
         mutable RefPtr<NotificationCenter> m_notifications;
 #endif
 #if ENABLE(BLOB)
index 930c2d0..f88b948 100644 (file)
@@ -70,7 +70,7 @@ module threads {
         boolean dispatchEvent(in Event evt)
             raises(EventException);
 
-#if defined(ENABLE_NOTIFICATIONS) && ENABLE_NOTIFICATIONS
+#if (defined(ENABLE_NOTIFICATIONS) && ENABLE_NOTIFICATIONS) || (defined(ENABLE_LEGACY_NOTIFICATIONS) && ENABLE_LEGACY_NOTIFICATIONS)
         // Notification interface
         readonly attribute [V8EnabledAtRuntime] NotificationCenter webkitNotifications;
 #endif
index d2e23a8..da51c2d 100644 (file)
@@ -96,7 +96,7 @@ WorkerThread::WorkerThread(const KURL& scriptURL, const String& userAgent, const
     , m_workerLoaderProxy(workerLoaderProxy)
     , m_workerReportingProxy(workerReportingProxy)
     , m_startupData(WorkerThreadStartupData::create(scriptURL, userAgent, sourceCode, startMode, contentSecurityPolicy, contentSecurityPolicyType))
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
     , m_notificationClient(0)
 #endif
 {
index cbe5a71..60c59d3 100644 (file)
@@ -62,7 +62,7 @@ namespace WebCore {
         // Number of active worker threads.
         static unsigned workerThreadCount();
 
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
         NotificationClient* getNotificationClient() { return m_notificationClient; }
         void setNotificationClient(NotificationClient* client) { m_notificationClient = client; }
 #endif
@@ -93,7 +93,7 @@ namespace WebCore {
 
         OwnPtr<WorkerThreadStartupData> m_startupData;
 
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
         NotificationClient* m_notificationClient;
 #endif
 
index 85a4085..668566d 100644 (file)
@@ -70,7 +70,7 @@
 #include "LayerWebKitThread.h"
 #include "NetworkManager.h"
 #include "NodeRenderStyle.h"
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
 #include "NotificationPresenterImpl.h"
 #endif
 #include "Page.h"
@@ -431,7 +431,7 @@ void WebPagePrivate::init(const WebString& pageGroupName)
     WebCore::provideDeviceOrientationTo(m_page, new DeviceOrientationClientBlackBerry(this));
     WebCore::provideDeviceMotionTo(m_page, new DeviceMotionClientBlackBerry(this));
 
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
     WebCore::provideNotification(m_page, NotificationPresenterImpl::instance());
 #endif
 
index 9a2c6f9..810e669 100644 (file)
@@ -1,3 +1,25 @@
+2012-03-13  Jon Lee  <jonlee@apple.com>
+
+        Separate NOTIFICATIONS and LEGACY_NOTIFICATIONS
+        https://bugs.webkit.org/show_bug.cgi?id=80922
+        <rdar://problem/11035082>
+
+        Reviewed by Jian Li.
+
+        You can include either NOTIFICATIONS or LEGACY_NOTIFICATIONS and have a complete API.
+        LEGACY_NOTIFICATIONS should cover all of the previous functionality, and NOTIFICATIONS will cover the
+        new API. Therefore, APIs that are common between the two will have:
+        #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
+
+        This patch initially sets both to be exactly the same. As other bugs with patches begin to migrate to
+        the new API, the defines will begin to split. This allows ports to decide which set of APIs to include.
+
+        Update everything to be #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
+        * Api/WebPage.cpp:
+        (BlackBerry::WebKit::WebPagePrivate::init):
+        * WebCoreSupport/NotificationPresenterImpl.cpp:
+        * WebCoreSupport/NotificationPresenterImpl.h:
+
 2012-03-14  Nima Ghanavatian  <nghanavatian@rim.com>
 
         [BlackBerry] Syncing up left over bits in Api from our local branch to upstream
index 16c451e..4570f6b 100644 (file)
@@ -19,7 +19,7 @@
 #include "config.h"
 #include "NotificationPresenterImpl.h"
 
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
 #include <Event.h>
 #include <Notification.h>
 #include <NotificationPresenterBlackBerry.h>
@@ -155,4 +155,4 @@ void NotificationPresenterImpl::notificationClicked(const std::string& id)
 
 } // namespace WebKit
 
-#endif // ENABLE(NOTIFICATIONS)
+#endif // ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
index b708e00..25e916a 100644 (file)
@@ -19,7 +19,7 @@
 #ifndef NotificationPresenterImpl_h
 #define NotificationPresenterImpl_h
 
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
 #include <NotificationAckListener.h>
 #include <NotificationClient.h>
 #include <NotificationPresenterBlackBerry.h>
@@ -81,5 +81,5 @@ private:
 
 } // namespace WebKit
 
-#endif // ENABLE(NOTIFICATIONS)
+#endif // ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
 #endif // NotificationPresenterImpl_h
index f779284..5d47fe8 100644 (file)
@@ -1,3 +1,33 @@
+2012-03-13  Jon Lee  <jonlee@apple.com>
+
+        Separate NOTIFICATIONS and LEGACY_NOTIFICATIONS
+        https://bugs.webkit.org/show_bug.cgi?id=80922
+        <rdar://problem/11035082>
+
+        Reviewed by Jian Li.
+
+        You can include either NOTIFICATIONS or LEGACY_NOTIFICATIONS and have a complete API.
+        LEGACY_NOTIFICATIONS should cover all of the previous functionality, and NOTIFICATIONS will cover the
+        new API. Therefore, APIs that are common between the two will have:
+        #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
+
+        This patch initially sets both to be exactly the same. As other bugs with patches begin to migrate to
+        the new API, the defines will begin to split. This allows ports to decide which set of APIs to include.
+
+        Update everything to be #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
+        * src/AssertMatchingEnums.cpp:
+        * src/NotificationPresenterImpl.cpp:
+        * src/NotificationPresenterImpl.h:
+        * src/WebNotification.cpp:
+        * src/WebRuntimeFeatures.cpp:
+        (WebKit::WebRuntimeFeatures::enableNotifications):
+        (WebKit::WebRuntimeFeatures::isNotificationsEnabled):
+        * src/WebViewImpl.cpp:
+        (WebKit::WebViewImpl::WebViewImpl):
+        (WebKit):
+        * src/WebViewImpl.h:
+        (WebViewImpl):
+
 2012-03-14  James Robinson  <jamesr@chromium.org>
 
         [chromium] Deprecate renderDirectlyToWebView parameter of WebViewClient::createGraphicsContext3D()
index ac6fa04..6a54208 100644 (file)
@@ -393,7 +393,7 @@ COMPILE_ASSERT_MATCHING_ENUM(WebVideoFrame::FormatEmpty, VideoFrameChromium::Emp
 COMPILE_ASSERT_MATCHING_ENUM(WebVideoFrame::FormatASCII, VideoFrameChromium::ASCII);
 #endif
 
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
 COMPILE_ASSERT_MATCHING_ENUM(WebNotificationPresenter::PermissionAllowed, NotificationClient::PermissionAllowed);
 COMPILE_ASSERT_MATCHING_ENUM(WebNotificationPresenter::PermissionNotAllowed, NotificationClient::PermissionNotAllowed);
 COMPILE_ASSERT_MATCHING_ENUM(WebNotificationPresenter::PermissionDenied, NotificationClient::PermissionDenied);
index 99a7ea3..683e66f 100644 (file)
@@ -31,7 +31,7 @@
 #include "config.h"
 #include "NotificationPresenterImpl.h"
 
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
 
 #include "KURL.h"
 #include "Notification.h"
@@ -111,4 +111,4 @@ void NotificationPresenterImpl::requestPermission(ScriptExecutionContext* contex
 
 } // namespace WebKit
 
-#endif // ENABLE(NOTIFICATIONS)
+#endif // ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
index cad5b88..c43e1d6 100644 (file)
@@ -37,7 +37,7 @@
 #include <wtf/HashMap.h>
 #include <wtf/PassRefPtr.h>
 
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
 
 namespace WebKit {
 
@@ -66,6 +66,6 @@ private:
 
 } // namespace WebKit
 
-#endif // ENABLE(NOTIFICATIONS)
+#endif // ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
 
 #endif
index 849dc4f..7a63b59 100644 (file)
@@ -31,7 +31,7 @@
 #include "config.h"
 #include "WebNotification.h"
 
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
 
 #include "Event.h"
 #include "Notification.h"
@@ -174,4 +174,4 @@ void WebNotification::assign(WebNotificationPrivate* p)
 
 } // namespace WebKit
 
-#endif // ENABLE(NOTIFICATIONS)
+#endif // ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
index d297a82..80a2bdb 100644 (file)
@@ -116,14 +116,14 @@ bool WebRuntimeFeatures::isSocketsEnabled()
 
 void WebRuntimeFeatures::enableNotifications(bool enable)
 {
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
     RuntimeEnabledFeatures::setWebkitNotificationsEnabled(enable);
 #endif
 }
 
 bool WebRuntimeFeatures::isNotificationsEnabled()
 {
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
     return RuntimeEnabledFeatures::webkitNotificationsEnabled();
 #else
     return false;
index 8ce3565..e598c4c 100644 (file)
@@ -389,7 +389,7 @@ WebViewImpl::WebViewImpl(WebViewClient* client)
 #if ENABLE(INPUT_SPEECH)
     provideSpeechInputTo(m_page.get(), m_speechInputClient.get());
 #endif
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
     provideNotification(m_page.get(), notificationPresenterImpl());
 #endif
 
@@ -2957,7 +2957,7 @@ void WebViewImpl::setOverlayLayer(WebCore::GraphicsLayer* layer)
     }
 }
 
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
 NotificationPresenterImpl* WebViewImpl::notificationPresenterImpl()
 {
     if (!m_notificationPresenter.isInitialized() && m_client)
index ff5818b..ed21f75 100644 (file)
@@ -416,7 +416,7 @@ public:
         m_autofillPopupShowing = false;
     }
 
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
     // Returns the provider of desktop notifications.
     NotificationPresenterImpl* notificationPresenterImpl();
 #endif
@@ -682,7 +682,7 @@ private:
     OwnPtr<SettingsMap> m_inspectorSettingsMap;
     OwnPtr<DragScrollTimer> m_dragScrollTimer;
 
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
     // The provider of desktop notifications;
     NotificationPresenterImpl m_notificationPresenter;
 #endif
index abf52dc..306775a 100644 (file)
@@ -1,3 +1,27 @@
+2012-03-13  Jon Lee  <jonlee@apple.com>
+
+        Separate NOTIFICATIONS and LEGACY_NOTIFICATIONS
+        https://bugs.webkit.org/show_bug.cgi?id=80922
+        <rdar://problem/11035082>
+
+        Reviewed by Jian Li.
+
+        You can include either NOTIFICATIONS or LEGACY_NOTIFICATIONS and have a complete API.
+        LEGACY_NOTIFICATIONS should cover all of the previous functionality, and NOTIFICATIONS will cover the
+        new API. Therefore, APIs that are common between the two will have:
+        #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
+
+        This patch initially sets both to be exactly the same. As other bugs with patches begin to migrate to
+        the new API, the defines will begin to split. This allows ports to decide which set of APIs to include.
+
+        Update everything to be #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
+        * WebCoreSupport/ChromeClientEfl.cpp:
+        (WebCore):
+        * WebCoreSupport/ChromeClientEfl.h:
+        (ChromeClientEfl):
+        * WebCoreSupport/NotificationPresenterClientEfl.cpp:
+        * WebCoreSupport/NotificationPresenterClientEfl.h:
+
 2012-03-13  Adam Barth  <abarth@webkit.org> && Benjamin Poulain  <bpoulain@apple.com>
 
         Always enable ENABLE(CLIENT_BASED_GEOLOCATION)
index 0b00374..dd79b93 100644 (file)
@@ -55,7 +55,7 @@
 #include <Evas.h>
 #include <wtf/text/CString.h>
 
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
 #include "NotificationPresenterClientEfl.h"
 #endif
 
@@ -417,7 +417,7 @@ void ChromeClientEfl::exceededDatabaseQuota(Frame* frame, const String& database
 }
 #endif
 
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
 NotificationClient* ChromeClientEfl::notificationPresenter() const
 {
     notImplemented();
index 25dd35f..9ce9d68 100644 (file)
@@ -28,7 +28,7 @@
 #include "KURL.h"
 #include "PopupMenu.h"
 
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
 #include "NotificationClient.h"
 #endif
 
@@ -114,7 +114,7 @@ public:
     virtual void exceededDatabaseQuota(Frame*, const String&);
 #endif
 
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
     virtual WebCore::NotificationClient* notificationPresenter() const;
 #endif
 
index ba466f5..e337351 100644 (file)
@@ -20,7 +20,7 @@
 #include "config.h"
 #include "NotificationPresenterClientEfl.h"
 
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
 #include "NotImplemented.h"
 
 namespace WebCore {
index 260c442..55174e7 100644 (file)
@@ -20,7 +20,7 @@
 #ifndef NotificationPresenterClientEfl_h
 #define NotificationPresenterClientEfl_h
 
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
 #include "Notification.h"
 #include "NotificationPresenter.h"
 
index 25e4cd6..812fc1c 100644 (file)
@@ -1,3 +1,43 @@
+2012-03-13  Jon Lee  <jonlee@apple.com>
+
+        Separate NOTIFICATIONS and LEGACY_NOTIFICATIONS
+        https://bugs.webkit.org/show_bug.cgi?id=80922
+        <rdar://problem/11035082>
+
+        Reviewed by Jian Li.
+
+        You can include either NOTIFICATIONS or LEGACY_NOTIFICATIONS and have a complete API.
+        LEGACY_NOTIFICATIONS should cover all of the previous functionality, and NOTIFICATIONS will cover the
+        new API. Therefore, APIs that are common between the two will have:
+        #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
+
+        This patch initially sets both to be exactly the same. As other bugs with patches begin to migrate to
+        the new API, the defines will begin to split. This allows ports to decide which set of APIs to include.
+
+        Update everything to be #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
+        * WebCoreSupport/WebNotificationClient.h:
+        * WebCoreSupport/WebNotificationClient.mm:
+        (WebNotificationClient::show):
+        (WebNotificationClient::cancel):
+        (WebNotificationClient::clearNotifications):
+        (WebNotificationClient::notificationObjectDestroyed):
+        (WebNotificationClient::notificationControllerDestroyed):
+        (WebNotificationClient::requestPermission):
+        (WebNotificationClient::checkPermission):
+        * WebView/WebNotification.mm:
+        (-[WebNotification title]):
+        (-[WebNotification body]):
+        (-[WebNotification replaceID]):
+        (-[WebNotification origin]):
+        (-[WebNotification notificationID]):
+        (-[WebNotification dispatchShowEvent]):
+        (-[WebNotification dispatchCloseEvent]):
+        (-[WebNotification dispatchClickEvent]):
+        (-[WebNotification dispatchErrorEvent]):
+        * WebView/WebNotificationInternal.h:
+        * WebView/WebView.mm:
+        (-[WebView _commonInitializationWithFrameName:groupName:]):
+
 2012-03-13  Adam Barth  <abarth@webkit.org> && Benjamin Poulain  <bpoulain@apple.com>
 
         Always enable ENABLE(CLIENT_BASED_GEOLOCATION)
index d68d922..5dfa046 100644 (file)
@@ -25,7 +25,7 @@
 
 #import <WebCore/NotificationClient.h>
 
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
 #import <WebCore/Notification.h>
 #import <wtf/HashMap.h>
 #import <wtf/RefPtr.h>
@@ -57,7 +57,7 @@ private:
     virtual WebCore::NotificationClient::Permission checkPermission(WebCore::ScriptExecutionContext*) OVERRIDE;
 
     WebView *m_webView;
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
     HashMap<RefPtr<WebCore::Notification>, RetainPtr<WebNotification> > m_notificationMap;
     
     typedef HashMap<RefPtr<WebCore::ScriptExecutionContext>, Vector<RetainPtr<WebNotification> > > NotificationContextMap;
index 3fdf0bc..b0ffdfd 100644 (file)
@@ -25,7 +25,7 @@
 
 #import "WebNotificationClient.h"
 
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
 #import "WebDelegateImplementationCaching.h"
 #import "WebNotificationInternal.h"
 #import "WebPreferencesPrivate.h"
@@ -39,7 +39,7 @@
 
 using namespace WebCore;
 
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
 @interface WebNotificationPolicyListener : NSObject <WebAllowDenyPolicyListener>
 {
     RefPtr<VoidCallback> _callback;
@@ -48,7 +48,7 @@ using namespace WebCore;
 @end
 #endif
 
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
 static uint64_t generateNotificationID()
 {
     static uint64_t uniqueNotificationID = 1;
@@ -63,7 +63,7 @@ WebNotificationClient::WebNotificationClient(WebView *webView)
 
 bool WebNotificationClient::show(Notification* notification)
 {
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
     if (![m_webView _notificationProvider])
         return false;
 
@@ -84,7 +84,7 @@ bool WebNotificationClient::show(Notification* notification)
 
 void WebNotificationClient::cancel(Notification* notification)
 {
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
     WebNotification *webNotification = m_notificationMap.get(notification).get();
     if (!webNotification)
         return;
@@ -97,7 +97,7 @@ void WebNotificationClient::cancel(Notification* notification)
 
 void WebNotificationClient::clearNotifications(ScriptExecutionContext* context)
 {
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
     NotificationContextMap::iterator it = m_notificationContextMap.find(context);
     if (it == m_notificationContextMap.end())
         return;
@@ -120,7 +120,7 @@ void WebNotificationClient::clearNotifications(ScriptExecutionContext* context)
 
 void WebNotificationClient::notificationObjectDestroyed(Notification* notification)
 {
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
     RetainPtr<WebNotification> webNotification = m_notificationMap.take(notification);
     if (!webNotification)
         return;
@@ -141,7 +141,7 @@ void WebNotificationClient::notificationObjectDestroyed(Notification* notificati
 
 void WebNotificationClient::notificationControllerDestroyed()
 {
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
     [m_webView _notificationControllerDestroyed];
 #endif
     delete this;
@@ -149,7 +149,7 @@ void WebNotificationClient::notificationControllerDestroyed()
 
 void WebNotificationClient::requestPermission(ScriptExecutionContext* context, PassRefPtr<VoidCallback> callback)
 {
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
     BEGIN_BLOCK_OBJC_EXCEPTIONS;
     
     SEL selector = @selector(webView:decidePolicyForNotificationRequestFromOrigin:listener:);
@@ -173,7 +173,7 @@ void WebNotificationClient::requestPermission(ScriptExecutionContext* context, P
 
 NotificationClient::Permission WebNotificationClient::checkPermission(ScriptExecutionContext* context)
 {
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
     if (!context || !context->isDocument())
         return NotificationClient::PermissionDenied;
     if (![[m_webView preferences] notificationsEnabled])
@@ -197,7 +197,7 @@ NotificationClient::Permission WebNotificationClient::checkPermission(ScriptExec
 #endif
 }
 
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
 @implementation WebNotificationPolicyListener
 - (id)initWithCallback:(PassRefPtr<VoidCallback>)callback
 {
index 557332c..882552b 100644 (file)
@@ -30,7 +30,7 @@
 
 #import "WebNotificationInternal.h"
 
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
 #import "WebSecurityOriginInternal.h"
 #import <WebCore/Notification.h>
 #import <WebCore/ScriptExecutionContext.h>
@@ -44,7 +44,7 @@ OBJC_CLASS WebNotificationInternal;
 @interface WebNotificationPrivate : NSObject
 {
 @public
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
     RefPtr<Notification> _internal;
     uint64_t _notificationID;
 #endif
@@ -54,7 +54,7 @@ OBJC_CLASS WebNotificationInternal;
 @implementation WebNotificationPrivate
 @end
 
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
 @implementation WebNotification (WebNotificationInternal)
 Notification* core(WebNotification *notification)
 {
@@ -83,7 +83,7 @@ Notification* core(WebNotification *notification)
 
 - (NSString *)title
 {
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
     ASSERT(core(self));
     return core(self)->contents().title;
 #else
@@ -93,7 +93,7 @@ Notification* core(WebNotification *notification)
 
 - (NSString *)body
 {
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
     ASSERT(core(self));
     return core(self)->contents().body;
 #else
@@ -103,7 +103,7 @@ Notification* core(WebNotification *notification)
 
 - (NSString *)replaceID
 {
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
     ASSERT(core(self));
     return core(self)->replaceId();
 #else
@@ -113,7 +113,7 @@ Notification* core(WebNotification *notification)
 
 - (WebSecurityOrigin *)origin
 {
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
     ASSERT(core(self));
     return [[[WebSecurityOrigin alloc] _initWithWebCoreSecurityOrigin:core(self)->scriptExecutionContext()->securityOrigin()] autorelease];
 #else
@@ -123,7 +123,7 @@ Notification* core(WebNotification *notification)
 
 - (uint64_t)notificationID
 {
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
     ASSERT(core(self));
     return _private->_notificationID;
 #else
@@ -133,7 +133,7 @@ Notification* core(WebNotification *notification)
 
 - (void)dispatchShowEvent
 {
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
     ASSERT(core(self));
     core(self)->dispatchShowEvent();
 #endif
@@ -141,7 +141,7 @@ Notification* core(WebNotification *notification)
 
 - (void)dispatchCloseEvent
 {
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
     ASSERT(core(self));
     core(self)->dispatchCloseEvent();
 #endif
@@ -149,7 +149,7 @@ Notification* core(WebNotification *notification)
 
 - (void)dispatchClickEvent
 {
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
     ASSERT(core(self));
     core(self)->dispatchClickEvent();
 #endif
@@ -157,7 +157,7 @@ Notification* core(WebNotification *notification)
 
 - (void)dispatchErrorEvent
 {
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
     ASSERT(core(self));
     core(self)->dispatchErrorEvent();
 #endif
index b624069..3f6f562 100644 (file)
@@ -28,7 +28,7 @@
 
 #import "WebNotification.h"
 
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
 
 namespace WebCore {
 class Notification;
index 05fc586..c230e00 100644 (file)
@@ -740,7 +740,7 @@ static NSString *leakOutlookQuirksUserScriptContents()
     pageClients.geolocationClient = new WebGeolocationClient(self);
 #endif
     _private->page = new Page(pageClients);
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
     WebCore::provideNotification(_private->page, new WebNotificationClient(self));
 #endif
 #if ENABLE(DEVICE_ORIENTATION)
index ac50f74..96ff463 100644 (file)
@@ -340,7 +340,7 @@ QWebPagePrivate::QWebPagePrivate(QWebPage *qq)
         WebCore::provideDeviceOrientationTo(page, new DeviceOrientationClientQt);
     WebCore::provideDeviceMotionTo(page, new DeviceMotionClientQt);
 #endif
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
     WebCore::provideNotification(page, NotificationPresenterClientQt::notificationPresenter());
 #endif
 
@@ -363,7 +363,7 @@ QWebPagePrivate::QWebPagePrivate(QWebPage *qq)
 
     PageGroup::setShouldTrackVisitedLinks(true);
     
-#if ENABLE(NOTIFICATIONS)    
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
     NotificationPresenterClientQt::notificationPresenter()->addClient();
 #endif
 }
@@ -387,7 +387,7 @@ QWebPagePrivate::~QWebPagePrivate()
     if (inspector)
         inspector->setPage(0);
 
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
     NotificationPresenterClientQt::notificationPresenter()->removeClient();
 #endif
 }
@@ -2149,7 +2149,7 @@ void QWebPage::setFeaturePermission(QWebFrame* frame, Feature feature, Permissio
 {
     switch (feature) {
     case Notifications:
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
         if (policy == PermissionGrantedByUser)
             NotificationPresenterClientQt::notificationPresenter()->allowNotificationForFrame(frame->d->frame);
 #endif
index a051ea2..8067d19 100644 (file)
@@ -1,3 +1,40 @@
+2012-03-13  Jon Lee  <jonlee@apple.com>
+
+        Separate NOTIFICATIONS and LEGACY_NOTIFICATIONS
+        https://bugs.webkit.org/show_bug.cgi?id=80922
+        <rdar://problem/11035082>
+
+        Reviewed by Jian Li.
+
+        You can include either NOTIFICATIONS or LEGACY_NOTIFICATIONS and have a complete API.
+        LEGACY_NOTIFICATIONS should cover all of the previous functionality, and NOTIFICATIONS will cover the
+        new API. Therefore, APIs that are common between the two will have:
+        #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
+
+        This patch initially sets both to be exactly the same. As other bugs with patches begin to migrate to
+        the new API, the defines will begin to split. This allows ports to decide which set of APIs to include.
+
+        Update everything to be #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
+        * Api/qwebpage.cpp:
+        (QWebPagePrivate::QWebPagePrivate):
+        (QWebPagePrivate::~QWebPagePrivate):
+        (QWebPage::setFeaturePermission):
+        * WebCoreSupport/DumpRenderTreeSupportQt.cpp:
+        (DumpRenderTreeSupportQt::dumpNotification):
+        (DumpRenderTreeSupportQt::simulateDesktopNotificationClick):
+        * WebCoreSupport/NotificationPresenterClientQt.cpp:
+        (WebCore):
+        (WebCore::NotificationWrapper::NotificationWrapper):
+        (WebCore::NotificationWrapper::close):
+        (WebCore::NotificationWrapper::title):
+        (WebCore::NotificationWrapper::message):
+        (WebCore::NotificationWrapper::iconData):
+        (WebCore::NotificationWrapper::openerPageUrl):
+        (WebCore::NotificationWrapper::notificationClicked):
+        (WebCore::NotificationWrapper::notificationClosed):
+        * WebCoreSupport/NotificationPresenterClientQt.h:
+        (WebCore):
+
 2012-03-14  Csaba Osztrogon√°c  <ossy@webkit.org>
 
         Last buildfix for Qt after r110595. :)
index 0b18082..4746a70 100644 (file)
@@ -790,7 +790,7 @@ void DumpRenderTreeSupportQt::dumpSetAcceptsEditing(bool b)
 
 void DumpRenderTreeSupportQt::dumpNotification(bool b)
 {
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
     NotificationPresenterClientQt::dumpNotification = b;
 #endif
 }
@@ -987,7 +987,7 @@ void DumpRenderTreeSupportQt::addUserStyleSheet(QWebPage* page, const QString& s
 
 void DumpRenderTreeSupportQt::simulateDesktopNotificationClick(const QString& title)
 {
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
     NotificationPresenterClientQt::notificationPresenter()->notificationClicked(title);
 #endif
 }
index 0005218..0c5ea16 100644 (file)
@@ -48,7 +48,7 @@
 
 namespace WebCore {
 
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
 
 const double notificationTimeout = 10.0;
 
@@ -70,7 +70,7 @@ NotificationPresenterClientQt* NotificationPresenterClientQt::notificationPresen
 NotificationWrapper::NotificationWrapper()
     : m_closeTimer(this, &NotificationWrapper::close)
 {
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
 
 #ifndef QT_NO_SYSTEMTRAYICON
     m_notificationIcon = nullptr;
@@ -81,14 +81,14 @@ NotificationWrapper::NotificationWrapper()
 
 void NotificationWrapper::close(Timer<NotificationWrapper>*)
 {
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
     NotificationPresenterClientQt::notificationPresenter()->cancel(this);
 #endif
 }
 
 const QString NotificationWrapper::title() const
 {
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
     Notification* notification = NotificationPresenterClientQt::notificationPresenter()->notificationForWrapper(this);
     if (notification)
         return notification->contents().title;
@@ -98,7 +98,7 @@ const QString NotificationWrapper::title() const
 
 const QString NotificationWrapper::message() const
 {
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
     Notification* notification = NotificationPresenterClientQt::notificationPresenter()->notificationForWrapper(this);
     if (notification)
         return notification->contents().body;
@@ -109,7 +109,7 @@ const QString NotificationWrapper::message() const
 const QByteArray NotificationWrapper::iconData() const
 {
     QByteArray iconData;
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
     Notification* notification = NotificationPresenterClientQt::notificationPresenter()->notificationForWrapper(this);
     if (notification) {
         if (notification->iconData())
@@ -122,7 +122,7 @@ const QByteArray NotificationWrapper::iconData() const
 const QUrl NotificationWrapper::openerPageUrl() const
 {
     QUrl url;
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
     Notification* notification = NotificationPresenterClientQt::notificationPresenter()->notificationForWrapper(this);
     if (notification) {
         if (notification->scriptExecutionContext()) 
@@ -134,19 +134,19 @@ const QUrl NotificationWrapper::openerPageUrl() const
 
 void NotificationWrapper::notificationClicked()
 {
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
     NotificationPresenterClientQt::notificationPresenter()->notificationClicked(this);
 #endif
 }
 
 void NotificationWrapper::notificationClosed()
 {
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
     NotificationPresenterClientQt::notificationPresenter()->cancel(this);
 #endif
 }
 
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
 
 NotificationPresenterClientQt::NotificationPresenterClientQt() : m_clientCount(0)
 {
@@ -464,7 +464,7 @@ QWebFrame* NotificationPresenterClientQt::toFrame(ScriptExecutionContext* contex
     return QWebFramePrivate::kit(document->frame());
 }
 
-#endif // ENABLE(NOTIFICATIONS)
+#endif // ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
 }
 
 #include "moc_NotificationPresenterClientQt.cpp"
index 12b06fe..874dd60 100644 (file)
@@ -77,7 +77,7 @@ public:
     Timer<NotificationWrapper> m_closeTimer;
 };
 
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
 
 typedef QHash <Notification*, NotificationWrapper*> NotificationsQueue;
 
index cdaa424..7c9db53 100644 (file)
@@ -1,3 +1,27 @@
+2012-03-13  Jon Lee  <jonlee@apple.com>
+
+        Separate NOTIFICATIONS and LEGACY_NOTIFICATIONS
+        https://bugs.webkit.org/show_bug.cgi?id=80922
+        <rdar://problem/11035082>
+
+        Reviewed by Jian Li.
+
+        You can include either NOTIFICATIONS or LEGACY_NOTIFICATIONS and have a complete API.
+        LEGACY_NOTIFICATIONS should cover all of the previous functionality, and NOTIFICATIONS will cover the
+        new API. Therefore, APIs that are common between the two will have:
+        #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
+
+        This patch initially sets both to be exactly the same. As other bugs with patches begin to migrate to
+        the new API, the defines will begin to split. This allows ports to decide which set of APIs to include.
+
+        Update everything to be #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
+        * WebCoreSupport/WebChromeClient.cpp:
+        (WebChromeClient::WebChromeClient):
+        * WebCoreSupport/WebChromeClient.h:
+        (WebChromeClient):
+        * WebCoreSupport/WebDesktopNotificationsDelegate.cpp:
+        * WebCoreSupport/WebDesktopNotificationsDelegate.h:
+
 2012-03-13  Adam Barth  <abarth@webkit.org> && Benjamin Poulain  <bpoulain@apple.com>
 
         Always enable ENABLE(CLIENT_BASED_GEOLOCATION)
index cca9ec0..4435b48 100644 (file)
@@ -74,7 +74,7 @@ static const size_t maxFilePathsListSize = USHRT_MAX;
 
 WebChromeClient::WebChromeClient(WebView* webView)
     : m_webView(webView)
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
     , m_notificationsDelegate(new WebDesktopNotificationsDelegate(webView))
 #endif
 {
index 63bf5d1..f22d6f3 100644 (file)
@@ -150,7 +150,7 @@ public:
     virtual void exitFullscreenForNode(WebCore::Node*);
 #endif
 
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
     virtual WebCore::NotificationClient* notificationPresenter() const { return reinterpret_cast<WebCore::NotificationClient*>(m_notificationsDelegate.get()); }
 #endif
 
@@ -175,7 +175,7 @@ private:
 
     WebView* m_webView;
 
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
     OwnPtr<WebDesktopNotificationsDelegate> m_notificationsDelegate;
 #endif
 };
index 70ed482..cff7a2b 100644 (file)
@@ -36,7 +36,7 @@
 #include <WebCore/Document.h>
 #include <WebCore/KURL.h>
 
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
 
 using namespace WebCore;
 
@@ -211,4 +211,4 @@ COMPtr<IWebDesktopNotificationsDelegate> WebDesktopNotificationsDelegate::notifi
     return delegate;
 }
 
-#endif  // ENABLE(NOTIFICATIONS)
+#endif // ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
index a1a1185..575c94c 100644 (file)
@@ -32,7 +32,7 @@
 #include <WebCore/Notification.h>
 #include <WebCore/NotificationClient.h>
 
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
 
 interface IWebDesktopNotificationPresenter;
 
index 0ddab91..b561606 100644 (file)
@@ -1,3 +1,23 @@
+2012-03-13  Jon Lee  <jonlee@apple.com>
+
+        Separate NOTIFICATIONS and LEGACY_NOTIFICATIONS
+        https://bugs.webkit.org/show_bug.cgi?id=80922
+        <rdar://problem/11035082>
+
+        Reviewed by Jian Li.
+
+        You can include either NOTIFICATIONS or LEGACY_NOTIFICATIONS and have a complete API.
+        LEGACY_NOTIFICATIONS should cover all of the previous functionality, and NOTIFICATIONS will cover the
+        new API. Therefore, APIs that are common between the two will have:
+        #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
+
+        This patch initially sets both to be exactly the same. As other bugs with patches begin to migrate to
+        the new API, the defines will begin to split. This allows ports to decide which set of APIs to include.
+
+        Update everything to be #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
+        * WebCoreSupport/ChromeClientWinCE.h:
+        (ChromeClientWinCE):
+
 2012-03-13  Adam Barth  <abarth@webkit.org> && Benjamin Poulain  <bpoulain@apple.com>
 
         Always enable ENABLE(CLIENT_BASED_GEOLOCATION)
index db86405..57c2f93 100644 (file)
@@ -131,7 +131,7 @@ public:
     // for this origin.
     virtual void reachedApplicationCacheOriginQuota(WebCore::SecurityOrigin*, int64_t totalSpaceNeeded);
 
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
     virtual WebCore::NotificationClient* notificationPresenter() const;
 #endif
 
index eeb31ed..696bab5 100644 (file)
@@ -1,3 +1,61 @@
+2012-03-13  Jon Lee  <jonlee@apple.com>
+
+        Separate NOTIFICATIONS and LEGACY_NOTIFICATIONS
+        https://bugs.webkit.org/show_bug.cgi?id=80922
+        <rdar://problem/11035082>
+
+        Reviewed by Jian Li.
+
+        You can include either NOTIFICATIONS or LEGACY_NOTIFICATIONS and have a complete API.
+        LEGACY_NOTIFICATIONS should cover all of the previous functionality, and NOTIFICATIONS will cover the
+        new API. Therefore, APIs that are common between the two will have:
+        #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
+
+        This patch initially sets both to be exactly the same. As other bugs with patches begin to migrate to
+        the new API, the defines will begin to split. This allows ports to decide which set of APIs to include.
+
+        Update everything to be #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
+        * Shared/WebProcessCreationParameters.cpp:
+        (WebKit::WebProcessCreationParameters::encode):
+        (WebKit::WebProcessCreationParameters::decode):
+        * Shared/WebProcessCreationParameters.h:
+        (WebProcessCreationParameters):
+        * UIProcess/WebContext.cpp:
+        (WebKit::WebContext::ensureWebProcess):
+        * WebProcess/Notifications/NotificationPermissionRequestManager.cpp:
+        (WebKit):
+        (WebKit::NotificationPermissionRequestManager::startRequest):
+        (WebKit::NotificationPermissionRequestManager::cancelRequest):
+        (WebKit::NotificationPermissionRequestManager::permissionLevel):
+        (WebKit::NotificationPermissionRequestManager::didReceiveNotificationPermissionDecision):
+        * WebProcess/Notifications/WebNotificationManager.cpp:
+        (WebKit):
+        (WebKit::WebNotificationManager::initialize):
+        (WebKit::WebNotificationManager::didUpdateNotificationDecision):
+        (WebKit::WebNotificationManager::didRemoveNotificationDecisions):
+        (WebKit::WebNotificationManager::policyForOrigin):
+        (WebKit::WebNotificationManager::show):
+        (WebKit::WebNotificationManager::cancel):
+        (WebKit::WebNotificationManager::clearNotifications):
+        (WebKit::WebNotificationManager::didDestroyNotification):
+        (WebKit::WebNotificationManager::didShowNotification):
+        (WebKit::WebNotificationManager::didClickNotification):
+        (WebKit::WebNotificationManager::didCloseNotifications):
+        * WebProcess/Notifications/WebNotificationManager.h:
+        (WebNotificationManager):
+        * WebProcess/WebCoreSupport/WebNotificationClient.cpp:
+        * WebProcess/WebCoreSupport/WebNotificationClient.h:
+        * WebProcess/WebPage/WebPage.cpp:
+        (WebKit::WebPage::WebPage):
+        (WebKit::WebPage::updatePreferences):
+        * WebProcess/WebProcess.cpp:
+        (WebKit::WebProcess::WebProcess):
+        (WebKit::WebProcess::didReceiveMessage):
+        * WebProcess/WebProcess.h:
+        (WebProcess):
+        * WebProcess/mac/WebProcessMac.mm:
+        (WebKit::WebProcess::platformInitializeWebProcess):
+
 2012-03-14  Dinu Jacob  <dinu.jacob@nokia.com>
 
         [Qt][WK2] Move code common to both ProxyAuthentication and Authentication context objects into a base class
index c8ecafe..323a351 100644 (file)
@@ -99,7 +99,7 @@ void WebProcessCreationParameters::encode(CoreIPC::ArgumentEncoder* encoder) con
     encoder->encode(cookieStorageDirectory);
 #endif
 
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
     encoder->encode(notificationPermissions);
 #endif
 }
@@ -194,7 +194,7 @@ bool WebProcessCreationParameters::decode(CoreIPC::ArgumentDecoder* decoder, Web
         return false;
 #endif
 
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
     if (!decoder->decode(parameters.notificationPermissions))
         return false;
 #endif
index 9b51f64..6781b04 100644 (file)
@@ -122,7 +122,7 @@ struct WebProcessCreationParameters {
     String cookieStorageDirectory;
 #endif
 
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
     HashMap<String, bool> notificationPermissions;
 #endif
 };
index 77661d8..2ecff9d 100644 (file)
@@ -279,7 +279,7 @@ void WebContext::ensureWebProcess()
 
     parameters.defaultRequestTimeoutInterval = WebURLRequest::defaultTimeoutInterval();
 
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
     m_notificationManagerProxy->populateCopyOfNotificationPermissions(parameters.notificationPermissions);
 #endif
 
index 73e71fb..fe66e56 100644 (file)
@@ -41,7 +41,7 @@ using namespace WebCore;
 
 namespace WebKit {
 
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
 static uint64_t generateRequestID()
 {
     static uint64_t uniqueRequestID = 1;
@@ -61,7 +61,7 @@ NotificationPermissionRequestManager::NotificationPermissionRequestManager(WebPa
 
 void NotificationPermissionRequestManager::startRequest(SecurityOrigin* origin, PassRefPtr<VoidCallback> callback)
 {
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
     if (permissionLevel(origin) != NotificationClient::PermissionNotAllowed) {
         callback->handleEvent();
         return;
@@ -80,7 +80,7 @@ void NotificationPermissionRequestManager::startRequest(SecurityOrigin* origin,
 
 void NotificationPermissionRequestManager::cancelRequest(SecurityOrigin* origin)
 {
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
     uint64_t id = m_originToIDMap.take(origin);
     if (!id)
         return;
@@ -94,7 +94,7 @@ void NotificationPermissionRequestManager::cancelRequest(SecurityOrigin* origin)
 
 NotificationClient::Permission NotificationPermissionRequestManager::permissionLevel(SecurityOrigin* securityOrigin)
 {
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
     if (!m_page->corePage()->settings()->notificationsEnabled())
         return NotificationClient::PermissionDenied;
     
@@ -107,7 +107,7 @@ NotificationClient::Permission NotificationPermissionRequestManager::permissionL
 
 void NotificationPermissionRequestManager::didReceiveNotificationPermissionDecision(uint64_t requestID, bool allowed)
 {
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
     if (!isRequestIDValid(requestID))
         return;
 
index 9e5cf95..8d11f13 100644 (file)
@@ -29,7 +29,7 @@
 #include "WebPage.h"
 #include "WebProcess.h"
 
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
 #include "WebNotification.h"
 #include "WebNotificationManagerProxyMessages.h"
 #include "WebPageProxyMessages.h"
@@ -45,7 +45,7 @@ using namespace WebCore;
 
 namespace WebKit {
 
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
 static uint64_t generateNotificationID()
 {
     static uint64_t uniqueNotificationID = 1;
@@ -69,21 +69,21 @@ void WebNotificationManager::didReceiveMessage(CoreIPC::Connection* connection,
 
 void WebNotificationManager::initialize(const HashMap<String, bool>& permissions)
 {
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
     m_permissionsMap = permissions;
 #endif
 }
 
 void WebNotificationManager::didUpdateNotificationDecision(const String& originString, bool allowed)
 {
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
     m_permissionsMap.set(originString, allowed);
 #endif
 }
 
 void WebNotificationManager::didRemoveNotificationDecisions(const Vector<String>& originStrings)
 {
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
     size_t count = originStrings.size();
     for (size_t i = 0; i < count; ++i)
         m_permissionsMap.remove(originStrings[i]);
@@ -92,7 +92,7 @@ void WebNotificationManager::didRemoveNotificationDecisions(const Vector<String>
 
 NotificationClient::Permission WebNotificationManager::policyForOrigin(WebCore::SecurityOrigin *origin) const
 {
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
     if (!origin)
         return NotificationClient::PermissionNotAllowed;
     
@@ -106,7 +106,7 @@ NotificationClient::Permission WebNotificationManager::policyForOrigin(WebCore::
 
 bool WebNotificationManager::show(Notification* notification, WebPage* page)
 {
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
     if (!notification || !page->corePage()->settings()->notificationsEnabled())
         return true;
     
@@ -126,7 +126,7 @@ bool WebNotificationManager::show(Notification* notification, WebPage* page)
 
 void WebNotificationManager::cancel(Notification* notification, WebPage* page)
 {
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
     if (!notification || !page->corePage()->settings()->notificationsEnabled())
         return;
     
@@ -140,7 +140,7 @@ void WebNotificationManager::cancel(Notification* notification, WebPage* page)
 
 void WebNotificationManager::clearNotifications(WebCore::ScriptExecutionContext* context, WebPage* page)
 {
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
     NotificationContextMap::iterator it = m_notificationContextMap.find(context);
     if (it == m_notificationContextMap.end())
         return;
@@ -161,7 +161,7 @@ void WebNotificationManager::clearNotifications(WebCore::ScriptExecutionContext*
 
 void WebNotificationManager::didDestroyNotification(Notification* notification, WebPage* page)
 {
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
     uint64_t notificationID = m_notificationMap.take(notification);
     if (!notificationID)
         return;
@@ -174,7 +174,7 @@ void WebNotificationManager::didDestroyNotification(Notification* notification,
 
 void WebNotificationManager::didShowNotification(uint64_t notificationID)
 {
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
     if (!isNotificationIDValid(notificationID))
         return;
     
@@ -188,7 +188,7 @@ void WebNotificationManager::didShowNotification(uint64_t notificationID)
 
 void WebNotificationManager::didClickNotification(uint64_t notificationID)
 {
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
     if (!isNotificationIDValid(notificationID))
         return;
 
@@ -202,7 +202,7 @@ void WebNotificationManager::didClickNotification(uint64_t notificationID)
 
 void WebNotificationManager::didCloseNotifications(const Vector<uint64_t>& notificationIDs)
 {
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
     size_t count = notificationIDs.size();
     for (size_t i = 0; i < count; ++i) {
         uint64_t notificationID = notificationIDs[i];
@@ -221,7 +221,7 @@ void WebNotificationManager::didCloseNotifications(const Vector<uint64_t>& notif
 #endif
 }
 
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
 void WebNotificationManager::removeNotificationFromContextMap(uint64_t notificationID, Notification* notification)
 {
     // This is a helper function for managing the hash maps.
index 142767e..2a18d44 100644 (file)
@@ -78,13 +78,13 @@ private:
     void didUpdateNotificationDecision(const String& originString, bool allowed);
     void didRemoveNotificationDecisions(const Vector<String>& originStrings);
     
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
     void removeNotificationFromContextMap(uint64_t notificationID, WebCore::Notification*);
 #endif
 
     WebProcess* m_process;
 
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
     typedef HashMap<RefPtr<WebCore::Notification>, uint64_t> NotificationMap;
     NotificationMap m_notificationMap;
     
index 6433124..8ac78d5 100644 (file)
@@ -26,7 +26,7 @@
 #include "config.h"
 #include "WebNotificationClient.h"
 
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
 
 #include "NotificationPermissionRequestManager.h"
 #include "WebNotificationManager.h"
@@ -91,4 +91,4 @@ NotificationClient::Permission WebNotificationClient::checkPermission(ScriptExec
 
 } // namespace WebKit
 
-#endif // ENABLE(NOTIFICATIONS)
+#endif // ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
index 8a84bea..46eb2a5 100644 (file)
@@ -26,7 +26,7 @@
 #ifndef WebNotificationClient_h
 #define WebNotificationClient_h
 
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
 
 #include <WebCore/NotificationClient.h>
 
@@ -59,6 +59,6 @@ private:
 
 } // namespace WebKit
 
-#endif // ENABLE(NOTIFICATIONS)
+#endif // ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
 
 #endif // WebNotificationClient_h
index c211652..5480a74 100644 (file)
@@ -237,7 +237,7 @@ WebPage::WebPage(uint64_t pageID, const WebPageCreationParameters& parameters)
     
     m_page = adoptPtr(new Page(pageClients));
 
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
     WebCore::provideNotification(m_page.get(), new WebNotificationClient(this));
 #endif
 
@@ -1952,7 +1952,7 @@ void WebPage::updatePreferences(const WebPreferencesStore& store)
     settings->setShouldDisplayTextDescriptions(store.getBoolValueForKey(WebPreferencesKey::shouldDisplayTextDescriptionsKey()));
 #endif
 
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
     settings->setNotificationsEnabled(store.getBoolValueForKey(WebPreferencesKey::notificationsEnabledKey()));
 #endif
 
index 9a8b905..c1ba050 100644 (file)
@@ -141,7 +141,7 @@ WebProcess::WebProcess()
 #endif
     , m_textCheckerState()
     , m_geolocationManager(this)
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
     , m_notificationManager(this)
 #endif
     , m_iconDatabaseProxy(this)
@@ -638,7 +638,7 @@ void WebProcess::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::Mes
         return;
     }
 
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
     if (messageID.is<CoreIPC::MessageClassWebNotificationManager>()) {
         m_notificationManager.didReceiveMessage(connection, messageID, arguments);
         return;
index efa2e68..1a4989f 100644 (file)
@@ -48,7 +48,7 @@
 class QNetworkAccessManager;
 #endif
 
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
 #include "WebNotificationManager.h"
 #endif
 
@@ -133,7 +133,7 @@ public:
     // Geolocation
     WebGeolocationManager& geolocationManager() { return m_geolocationManager; }
     
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
     WebNotificationManager& notificationManager() { return m_notificationManager; }
 #endif
 
@@ -268,7 +268,7 @@ private:
 
     TextCheckerState m_textCheckerState;
     WebGeolocationManager m_geolocationManager;
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
     WebNotificationManager m_notificationManager;
 #endif
     WebIconDatabaseProxy m_iconDatabaseProxy;
index fa0380f..b5658d8 100644 (file)
@@ -251,7 +251,7 @@ void WebProcess::platformInitializeWebProcess(const WebProcessCreationParameters
 
     m_compositingRenderServerPort = parameters.acceleratedCompositingPort.port();
 
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
     m_notificationManager.initialize(parameters.notificationPermissions);
 #endif
 
index 7f0a6b9..8835329 100644 (file)
@@ -1,3 +1,30 @@
+2012-03-13  Jon Lee  <jonlee@apple.com>
+
+        Separate NOTIFICATIONS and LEGACY_NOTIFICATIONS
+        https://bugs.webkit.org/show_bug.cgi?id=80922
+        <rdar://problem/11035082>
+
+        Reviewed by Jian Li.
+
+        You can include either NOTIFICATIONS or LEGACY_NOTIFICATIONS and have a complete API.
+        LEGACY_NOTIFICATIONS should cover all of the previous functionality, and NOTIFICATIONS will cover the
+        new API. Therefore, APIs that are common between the two will have:
+        #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
+
+        This patch initially sets both to be exactly the same. As other bugs with patches begin to migrate to
+        the new API, the defines will begin to split. This allows ports to decide which set of APIs to include.
+
+        Update everything to be #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
+        * DumpRenderTree/chromium/LayoutTestController.cpp:
+        (LayoutTestController::grantDesktopNotificationPermission):
+        (LayoutTestController::simulateDesktopNotificationClick):
+        * DumpRenderTree/chromium/NotificationPresenter.cpp:
+        * DumpRenderTree/chromium/TestShell.cpp:
+        (TestShell::TestShell):
+        (TestShell::resetTestController):
+        * DumpRenderTree/win/DRTDesktopNotificationPresenter.cpp:
+        (DRTDesktopNotificationPresenter::checkNotificationPermission):
+
 2012-03-13  Ojan Vafai  <ojan@chromium.org>
 
         Have webkit-patch rebaseline-test update test_expectations.txt
index 9c68dff..168441e 100644 (file)
@@ -1191,7 +1191,7 @@ void LayoutTestController::grantDesktopNotificationPermission(const CppArgumentL
         result->set(false);
         return;
     }
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
     m_shell->notificationPresenter()->grantPermission(cppVariantToWebString(arguments[0]));
 #endif
     result->set(true);
@@ -1203,7 +1203,7 @@ void LayoutTestController::simulateDesktopNotificationClick(const CppArgumentLis
         result->set(false);
         return;
     }
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
     if (m_shell->notificationPresenter()->simulateClick(cppVariantToWebString(arguments[0])))
         result->set(true);
     else
index 7809821..0c5400f 100644 (file)
@@ -31,7 +31,7 @@
 #include "config.h"
 #include "NotificationPresenter.h"
 
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
 
 #include "WebKit.h"
 #include "platform/WebKitPlatformSupport.h"
@@ -151,4 +151,4 @@ void NotificationPresenter::requestPermission(
     callback->permissionRequestComplete();
 }
 
-#endif // ENABLE(NOTIFICATIONS)
+#endif // ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
index aa66869..09e8676 100644 (file)
@@ -138,7 +138,7 @@ TestShell::TestShell(bool testShellMode)
     m_layoutTestController = adoptPtr(new LayoutTestController(this));
     m_eventSender = adoptPtr(new EventSender(this));
     m_textInputController = adoptPtr(new TextInputController(this));
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
     m_notificationPresenter = adoptPtr(new NotificationPresenter(this));
 #endif
     m_printer = m_testShellMode ? TestEventPrinter::createTestShellPrinter() : TestEventPrinter::createDRTPrinter();
@@ -294,7 +294,7 @@ void TestShell::resetTestController()
     m_layoutTestController->reset();
     m_eventSender->reset();
     m_webViewHost->reset();
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
     m_notificationPresenter->reset();
 #endif
     m_drtDevToolsAgent->reset();
index 3bc166d..830afd3 100644 (file)
@@ -123,7 +123,7 @@ HRESULT STDMETHODCALLTYPE DRTDesktopNotificationPresenter::checkNotificationPerm
         /* [in] */ BSTR origin, 
         /* [out, retval] */ int* result)
 {
-#if ENABLE(NOTIFICATIONS)
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
     JSStringRef jsOrigin = JSStringCreateWithBSTR(origin);
     bool allowed = ::gLayoutTestController->checkDesktopNotificationPermission(jsOrigin);