Changeset 110784 in webkit


Ignore:
Timestamp:
Mar 14, 2012 4:41:04 PM (12 years ago)
Author:
jonlee@apple.com
Message:

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.

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):

Location:
trunk
Files:
78 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r110782 r110784  
     12012-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
    1622012-03-14  Sheriff Bot  <webkit.review.bot@gmail.com>
    263
  • trunk/Source/WebCore/WebCore.exp.in

    r110706 r110784  
    21232123#endif
    21242124
    2125 #if ENABLE(NOTIFICATIONS)
     2125#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
    21262126__ZN7WebCore12NotificationC1Ev
    21272127__ZN7WebCore12NotificationD1Ev
  • trunk/Source/WebCore/bindings/cpp/WebDOMEventTarget.cpp

    r101145 r110784  
    5757#endif
    5858
    59 #if ENABLE(NOTIFICATIONS)
     59#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
    6060#include "WebDOMNotification.h"
    6161#endif
     
    123123#endif
    124124
    125 #if ENABLE(NOTIFICATIONS)
     125#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
    126126ConvertTo(Notification)
    127127#endif
     
    167167#endif
    168168
    169 #if ENABLE(NOTIFICATIONS)
     169#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
    170170    if (WebCore::Notification* notification = value->toNotification())
    171171        return toWebKit(notification);
  • trunk/Source/WebCore/bindings/js/JSDesktopNotificationsCustom.cpp

    r95901 r110784  
    3131#include "config.h"
    3232
    33 #if ENABLE(NOTIFICATIONS)
     33#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
    3434
    3535#include "Document.h"
     
    7171} // namespace
    7272
    73 #endif // ENABLE(NOTIFICATIONS)
     73#endif // ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
  • trunk/Source/WebCore/bindings/scripts/InFilesCompiler.pm

    r98755 r110784  
    167167}
    168168
     169sub preferredConditional()
     170{
     171    my $object = shift;
     172    my $conditional = shift;
     173
     174    my @conditionals = split('\\|', $conditional);
     175    return $conditionals[0];
     176}
     177
     178sub conditionalStringFromAttributeValue()
     179{
     180    my $object = shift;
     181    my $conditional = shift;
     182   
     183    return "ENABLE(" . join(') || ENABLE(', split('\\|', $conditional)) . ")";
     184}
     185
    169186sub generateInterfacesHeader()
    170187{
     
    203220
    204221    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";
    207225
    208226        for my $interface (sort keys %{ $interfacesByConditional{$conditional} }) {
     
    211229        }
    212230
    213         print F "// End of DOM_${macroStyledNamespace}_INTERFACES_FOR_EACH_$conditional\n";
     231        print F "// End of DOM_${macroStyledNamespace}_INTERFACES_FOR_EACH_$preferredConditional\n";
    214232        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";
    216234        print F "#endif\n";
    217235        print F "\n";
     
    225243    print F "    \\\n";
    226244    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";
    228247    }
    229248
     
    259278        $includedInterfaces{$interfaceName} = 1;
    260279
    261         print F "#if ENABLE($conditional)\n" if $conditional;
     280        print F "#if " . $object->conditionalStringFromAttributeValue($conditional) . "\n" if $conditional;
    262281        print F "#include \"$interfaceName.h\"\n";
    263282        print F "#if USE(JSC)\n";
  • trunk/Source/WebCore/bindings/v8/custom/V8NotificationCenterCustom.cpp

    r99645 r110784  
    3131#include "config.h"
    3232
    33 #if ENABLE(NOTIFICATIONS)
     33#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
    3434#include "V8NotificationCenter.h"
    3535
     
    108108}  // namespace WebCore
    109109
    110 #endif  // ENABLE(NOTIFICATIONS)
     110#endif // ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
  • trunk/Source/WebCore/dom/EventTargetFactory.in

    r110587 r110784  
    1919MessagePort
    2020Node
    21 Notification conditional=NOTIFICATIONS
     21Notification conditional=NOTIFICATIONS|LEGACY_NOTIFICATIONS
    2222SharedWorker conditional=SHARED_WORKERS
    2323SharedWorkerContext conditional=SHARED_WORKERS
  • trunk/Source/WebCore/notifications/Notification.cpp

    r110381 r110784  
    3232#include "config.h"
    3333
    34 #if ENABLE(NOTIFICATIONS)
     34#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
    3535
    3636#include "Notification.h"
     
    263263} // namespace WebCore
    264264
    265 #endif // ENABLE(NOTIFICATIONS)
     265#endif // ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
  • trunk/Source/WebCore/notifications/Notification.h

    r101750 r110784  
    4747#include <wtf/text/AtomicStringHash.h>
    4848
    49 #if ENABLE(NOTIFICATIONS)
     49#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
    5050namespace WebCore {
    5151
     
    165165} // namespace WebCore
    166166
    167 #endif // ENABLE(NOTIFICATIONS)
     167#endif // ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
    168168
    169169#endif // Notifications_h
  • trunk/Source/WebCore/notifications/Notification.idl

    r101750 r110784  
    3333
    3434    interface [
    35         Conditional=NOTIFICATIONS,
     35        Conditional=NOTIFICATIONS|LEGACY_NOTIFICATIONS,
    3636        ActiveDOMObject,
    3737        EventTarget,
  • trunk/Source/WebCore/notifications/NotificationCenter.cpp

    r110381 r110784  
    3232#include "config.h"
    3333
    34 #if ENABLE(NOTIFICATIONS)
     34#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
    3535
    3636#include "NotificationCenter.h"
     
    8181} // namespace WebCore
    8282
    83 #endif // ENABLE(NOTIFICATIONS)
     83#endif // ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
  • trunk/Source/WebCore/notifications/NotificationCenter.h

    r110381 r110784  
    4242#include <wtf/RefPtr.h>
    4343
    44 #if ENABLE(NOTIFICATIONS)
     44#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
    4545
    4646namespace WebCore {
     
    9191} // namespace WebCore
    9292
    93 #endif // ENABLE(NOTIFICATIONS)
     93#endif // ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
    9494
    9595#endif // NotificationCenter_h
  • trunk/Source/WebCore/notifications/NotificationCenter.idl

    r107442 r110784  
    3333
    3434    interface [
    35         Conditional=NOTIFICATIONS,
     35        Conditional=NOTIFICATIONS|LEGACY_NOTIFICATIONS,
    3636        ActiveDOMObject,
    3737        OmitConstructor
  • trunk/Source/WebCore/notifications/NotificationContents.h

    r101307 r110784  
    3333#define NotificationContents_h
    3434
    35 #if ENABLE(NOTIFICATIONS)
     35#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
    3636
    3737#include "KURL.h"
     
    5656} // namespace WebCore
    5757
    58 #endif // ENABLE(NOTIFICATIONS)
     58#endif // ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
    5959
    6060#endif // NotificationContents_h
  • trunk/Source/WebCore/notifications/NotificationController.cpp

    r110381 r110784  
    2727#include "NotificationController.h"
    2828
    29 #if ENABLE(NOTIFICATIONS)
     29#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
    3030
    3131#include "NotificationClient.h"
     
    7171} // namespace WebCore
    7272
    73 #endif // ENABLE(NOTIFICATIONS)
     73#endif // ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
  • trunk/Source/WebCore/notifications/NotificationController.h

    r110381 r110784  
    2727#define NotificationController_h
    2828
    29 #if ENABLE(NOTIFICATIONS)
     29#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
    3030
    3131#include "Page.h"
     
    5858} // namespace WebCore
    5959
    60 #endif // ENABLE(NOTIFICATIONS)
     60#endif // ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
    6161
    6262#endif // NotificationController_h
  • trunk/Source/WebCore/page/DOMWindow.cpp

    r110570 r110784  
    419419        ASSERT(!m_localStorage);
    420420        ASSERT(!m_applicationCache);
    421 #if ENABLE(NOTIFICATIONS)
     421#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
    422422        ASSERT(!m_notifications);
    423423#endif
     
    479479    InspectorInstrumentation::frameWindowDiscarded(m_frame, this);
    480480
    481 #if ENABLE(NOTIFICATIONS)
     481#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
    482482    // Clearing Notifications requests involves accessing the client so it must be done
    483483    // before the frame is detached.
     
    529529        (*it)->disconnectFrame();
    530530
    531 #if ENABLE(NOTIFICATIONS)
     531#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
    532532    // FIXME: Notifications shouldn't have different disconnection logic than
    533533    // the rest of the DOMWindowProperties.
     
    572572    m_localStorage = 0;
    573573    m_applicationCache = 0;
    574 #if ENABLE(NOTIFICATIONS)
     574#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
    575575    // FIXME: Notifications shouldn't have different disconnection logic than
    576576    // the rest of the DOMWindowProperties.
     
    785785}
    786786
    787 #if ENABLE(NOTIFICATIONS)
     787#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
    788788NotificationCenter* DOMWindow::webkitNotifications() const
    789789{
  • trunk/Source/WebCore/page/DOMWindow.h

    r110570 r110784  
    357357        Storage* localStorage(ExceptionCode&) const;
    358358
    359 #if ENABLE(NOTIFICATIONS)
     359#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
    360360        NotificationCenter* webkitNotifications() const;
    361361        // Renders webkitNotifications object safely inoperable, disconnects
     
    451451        mutable RefPtr<DOMApplicationCache> m_applicationCache;
    452452
    453 #if ENABLE(NOTIFICATIONS)
     453#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
    454454        mutable RefPtr<NotificationCenter> m_notifications;
    455455#endif
  • trunk/Source/WebCore/page/DOMWindow.idl

    r109693 r110784  
    171171            getter raises(DOMException);
    172172
    173 #if defined(ENABLE_NOTIFICATIONS) && ENABLE_NOTIFICATIONS
     173#if (defined(ENABLE_NOTIFICATIONS) && ENABLE_NOTIFICATIONS) || (defined(ENABLE_LEGACY_NOTIFICATIONS) && ENABLE_LEGACY_NOTIFICATIONS)
    174174        readonly attribute [V8EnabledAtRuntime] NotificationCenter webkitNotifications;
    175175#endif
  • trunk/Source/WebCore/page/Frame.cpp

    r109931 r110784  
    688688        parent->loader()->checkLoadComplete();
    689689
    690 #if ENABLE(NOTIFICATIONS)
     690#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
    691691    if (m_domWindow)
    692692        m_domWindow->resetNotifications();
     
    738738
    739739        if (m_domWindow) {
    740 #if ENABLE(NOTIFICATIONS)
     740#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
    741741            m_domWindow->resetNotifications();
    742742#endif
  • trunk/Source/WebCore/workers/WorkerContext.cpp

    r110381 r110784  
    6060#include <wtf/UnusedParam.h>
    6161
    62 #if ENABLE(NOTIFICATIONS)
     62#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
    6363#include "NotificationCenter.h"
    6464#endif
     
    105105{
    106106    ASSERT(currentThread() == thread()->threadID());
    107 #if ENABLE(NOTIFICATIONS)
     107#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
    108108    m_notifications.clear();
    109109#endif
     
    295295}
    296296
    297 #if ENABLE(NOTIFICATIONS)
     297#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
    298298NotificationCenter* WorkerContext::webkitNotifications() const
    299299{
  • trunk/Source/WebCore/workers/WorkerContext.h

    r109833 r110784  
    106106        virtual WorkerEventQueue* eventQueue() const;
    107107
    108 #if ENABLE(NOTIFICATIONS)
     108#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
    109109        NotificationCenter* webkitNotifications() const;
    110110#endif
     
    173173        WorkerThread* m_thread;
    174174
    175 #if ENABLE_NOTIFICATIONS
     175#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
    176176        mutable RefPtr<NotificationCenter> m_notifications;
    177177#endif
  • trunk/Source/WebCore/workers/WorkerContext.idl

    r109833 r110784  
    7171            raises(EventException);
    7272
    73 #if defined(ENABLE_NOTIFICATIONS) && ENABLE_NOTIFICATIONS
     73#if (defined(ENABLE_NOTIFICATIONS) && ENABLE_NOTIFICATIONS) || (defined(ENABLE_LEGACY_NOTIFICATIONS) && ENABLE_LEGACY_NOTIFICATIONS)
    7474        // Notification interface
    7575        readonly attribute [V8EnabledAtRuntime] NotificationCenter webkitNotifications;
  • trunk/Source/WebCore/workers/WorkerThread.cpp

    r110381 r110784  
    9797    , m_workerReportingProxy(workerReportingProxy)
    9898    , m_startupData(WorkerThreadStartupData::create(scriptURL, userAgent, sourceCode, startMode, contentSecurityPolicy, contentSecurityPolicyType))
    99 #if ENABLE(NOTIFICATIONS)
     99#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
    100100    , m_notificationClient(0)
    101101#endif
  • trunk/Source/WebCore/workers/WorkerThread.h

    r110381 r110784  
    6363        static unsigned workerThreadCount();
    6464
    65 #if ENABLE(NOTIFICATIONS)
     65#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
    6666        NotificationClient* getNotificationClient() { return m_notificationClient; }
    6767        void setNotificationClient(NotificationClient* client) { m_notificationClient = client; }
     
    9494        OwnPtr<WorkerThreadStartupData> m_startupData;
    9595
    96 #if ENABLE(NOTIFICATIONS)
     96#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
    9797        NotificationClient* m_notificationClient;
    9898#endif
  • trunk/Source/WebKit/blackberry/Api/WebPage.cpp

    r110712 r110784  
    7171#include "NetworkManager.h"
    7272#include "NodeRenderStyle.h"
    73 #if ENABLE(NOTIFICATIONS)
     73#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
    7474#include "NotificationPresenterImpl.h"
    7575#endif
     
    432432    WebCore::provideDeviceMotionTo(m_page, new DeviceMotionClientBlackBerry(this));
    433433
    434 #if ENABLE(NOTIFICATIONS)
     434#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
    435435    WebCore::provideNotification(m_page, NotificationPresenterImpl::instance());
    436436#endif
  • trunk/Source/WebKit/blackberry/ChangeLog

    r110712 r110784  
     12012-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
    1232012-03-14  Nima Ghanavatian  <nghanavatian@rim.com>
    224
  • trunk/Source/WebKit/blackberry/WebCoreSupport/NotificationPresenterImpl.cpp

    r110381 r110784  
    2020#include "NotificationPresenterImpl.h"
    2121
    22 #if ENABLE(NOTIFICATIONS)
     22#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
    2323#include <Event.h>
    2424#include <Notification.h>
     
    156156} // namespace WebKit
    157157
    158 #endif // ENABLE(NOTIFICATIONS)
     158#endif // ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
  • trunk/Source/WebKit/blackberry/WebCoreSupport/NotificationPresenterImpl.h

    r110381 r110784  
    2020#define NotificationPresenterImpl_h
    2121
    22 #if ENABLE(NOTIFICATIONS)
     22#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
    2323#include <NotificationAckListener.h>
    2424#include <NotificationClient.h>
     
    8282} // namespace WebKit
    8383
    84 #endif // ENABLE(NOTIFICATIONS)
     84#endif // ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
    8585#endif // NotificationPresenterImpl_h
  • trunk/Source/WebKit/chromium/ChangeLog

    r110773 r110784  
     12012-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
    1312012-03-14  James Robinson  <jamesr@chromium.org>
    232
  • trunk/Source/WebKit/chromium/src/AssertMatchingEnums.cpp

    r110381 r110784  
    394394#endif
    395395
    396 #if ENABLE(NOTIFICATIONS)
     396#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
    397397COMPILE_ASSERT_MATCHING_ENUM(WebNotificationPresenter::PermissionAllowed, NotificationClient::PermissionAllowed);
    398398COMPILE_ASSERT_MATCHING_ENUM(WebNotificationPresenter::PermissionNotAllowed, NotificationClient::PermissionNotAllowed);
  • trunk/Source/WebKit/chromium/src/NotificationPresenterImpl.cpp

    r110381 r110784  
    3232#include "NotificationPresenterImpl.h"
    3333
    34 #if ENABLE(NOTIFICATIONS)
     34#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
    3535
    3636#include "KURL.h"
     
    112112} // namespace WebKit
    113113
    114 #endif // ENABLE(NOTIFICATIONS)
     114#endif // ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
  • trunk/Source/WebKit/chromium/src/NotificationPresenterImpl.h

    r110381 r110784  
    3838#include <wtf/PassRefPtr.h>
    3939
    40 #if ENABLE(NOTIFICATIONS)
     40#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
    4141
    4242namespace WebKit {
     
    6767} // namespace WebKit
    6868
    69 #endif // ENABLE(NOTIFICATIONS)
     69#endif // ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
    7070
    7171#endif
  • trunk/Source/WebKit/chromium/src/WebNotification.cpp

    r102044 r110784  
    3232#include "WebNotification.h"
    3333
    34 #if ENABLE(NOTIFICATIONS)
     34#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
    3535
    3636#include "Event.h"
     
    175175} // namespace WebKit
    176176
    177 #endif // ENABLE(NOTIFICATIONS)
     177#endif // ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
  • trunk/Source/WebKit/chromium/src/WebRuntimeFeatures.cpp

    r109667 r110784  
    117117void WebRuntimeFeatures::enableNotifications(bool enable)
    118118{
    119 #if ENABLE(NOTIFICATIONS)
     119#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
    120120    RuntimeEnabledFeatures::setWebkitNotificationsEnabled(enable);
    121121#endif
     
    124124bool WebRuntimeFeatures::isNotificationsEnabled()
    125125{
    126 #if ENABLE(NOTIFICATIONS)
     126#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
    127127    return RuntimeEnabledFeatures::webkitNotificationsEnabled();
    128128#else
  • trunk/Source/WebKit/chromium/src/WebViewImpl.cpp

    r110706 r110784  
    390390    provideSpeechInputTo(m_page.get(), m_speechInputClient.get());
    391391#endif
    392 #if ENABLE(NOTIFICATIONS)
     392#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
    393393    provideNotification(m_page.get(), notificationPresenterImpl());
    394394#endif
     
    29582958}
    29592959
    2960 #if ENABLE(NOTIFICATIONS)
     2960#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
    29612961NotificationPresenterImpl* WebViewImpl::notificationPresenterImpl()
    29622962{
  • trunk/Source/WebKit/chromium/src/WebViewImpl.h

    r110706 r110784  
    417417    }
    418418
    419 #if ENABLE(NOTIFICATIONS)
     419#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
    420420    // Returns the provider of desktop notifications.
    421421    NotificationPresenterImpl* notificationPresenterImpl();
     
    683683    OwnPtr<DragScrollTimer> m_dragScrollTimer;
    684684
    685 #if ENABLE(NOTIFICATIONS)
     685#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
    686686    // The provider of desktop notifications;
    687687    NotificationPresenterImpl m_notificationPresenter;
  • trunk/Source/WebKit/efl/ChangeLog

    r110595 r110784  
     12012-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
    1252012-03-13  Adam Barth  <abarth@webkit.org> && Benjamin Poulain  <bpoulain@apple.com>
    226
  • trunk/Source/WebKit/efl/WebCoreSupport/ChromeClientEfl.cpp

    r110595 r110784  
    5656#include <wtf/text/CString.h>
    5757
    58 #if ENABLE(NOTIFICATIONS)
     58#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
    5959#include "NotificationPresenterClientEfl.h"
    6060#endif
     
    418418#endif
    419419
    420 #if ENABLE(NOTIFICATIONS)
     420#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
    421421NotificationClient* ChromeClientEfl::notificationPresenter() const
    422422{
  • trunk/Source/WebKit/efl/WebCoreSupport/ChromeClientEfl.h

    r110595 r110784  
    2929#include "PopupMenu.h"
    3030
    31 #if ENABLE(NOTIFICATIONS)
     31#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
    3232#include "NotificationClient.h"
    3333#endif
     
    115115#endif
    116116
    117 #if ENABLE(NOTIFICATIONS)
     117#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
    118118    virtual WebCore::NotificationClient* notificationPresenter() const;
    119119#endif
  • trunk/Source/WebKit/efl/WebCoreSupport/NotificationPresenterClientEfl.cpp

    r103975 r110784  
    2121#include "NotificationPresenterClientEfl.h"
    2222
    23 #if ENABLE(NOTIFICATIONS)
     23#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
    2424#include "NotImplemented.h"
    2525
  • trunk/Source/WebKit/efl/WebCoreSupport/NotificationPresenterClientEfl.h

    r103975 r110784  
    2121#define NotificationPresenterClientEfl_h
    2222
    23 #if ENABLE(NOTIFICATIONS)
     23#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
    2424#include "Notification.h"
    2525#include "NotificationPresenter.h"
  • trunk/Source/WebKit/mac/ChangeLog

    r110595 r110784  
     12012-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
    1412012-03-13  Adam Barth  <abarth@webkit.org> && Benjamin Poulain  <bpoulain@apple.com>
    242
  • trunk/Source/WebKit/mac/WebCoreSupport/WebNotificationClient.h

    r110381 r110784  
    2626#import <WebCore/NotificationClient.h>
    2727
    28 #if ENABLE(NOTIFICATIONS)
     28#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
    2929#import <WebCore/Notification.h>
    3030#import <wtf/HashMap.h>
     
    5858
    5959    WebView *m_webView;
    60 #if ENABLE(NOTIFICATIONS)
     60#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
    6161    HashMap<RefPtr<WebCore::Notification>, RetainPtr<WebNotification> > m_notificationMap;
    6262   
  • trunk/Source/WebKit/mac/WebCoreSupport/WebNotificationClient.mm

    r110381 r110784  
    2626#import "WebNotificationClient.h"
    2727
    28 #if ENABLE(NOTIFICATIONS)
     28#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
    2929#import "WebDelegateImplementationCaching.h"
    3030#import "WebNotificationInternal.h"
     
    4040using namespace WebCore;
    4141
    42 #if ENABLE(NOTIFICATIONS)
     42#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
    4343@interface WebNotificationPolicyListener : NSObject <WebAllowDenyPolicyListener>
    4444{
     
    4949#endif
    5050
    51 #if ENABLE(NOTIFICATIONS)
     51#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
    5252static uint64_t generateNotificationID()
    5353{
     
    6464bool WebNotificationClient::show(Notification* notification)
    6565{
    66 #if ENABLE(NOTIFICATIONS)
     66#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
    6767    if (![m_webView _notificationProvider])
    6868        return false;
     
    8585void WebNotificationClient::cancel(Notification* notification)
    8686{
    87 #if ENABLE(NOTIFICATIONS)
     87#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
    8888    WebNotification *webNotification = m_notificationMap.get(notification).get();
    8989    if (!webNotification)
     
    9898void WebNotificationClient::clearNotifications(ScriptExecutionContext* context)
    9999{
    100 #if ENABLE(NOTIFICATIONS)
     100#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
    101101    NotificationContextMap::iterator it = m_notificationContextMap.find(context);
    102102    if (it == m_notificationContextMap.end())
     
    121121void WebNotificationClient::notificationObjectDestroyed(Notification* notification)
    122122{
    123 #if ENABLE(NOTIFICATIONS)
     123#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
    124124    RetainPtr<WebNotification> webNotification = m_notificationMap.take(notification);
    125125    if (!webNotification)
     
    142142void WebNotificationClient::notificationControllerDestroyed()
    143143{
    144 #if ENABLE(NOTIFICATIONS)
     144#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
    145145    [m_webView _notificationControllerDestroyed];
    146146#endif
     
    150150void WebNotificationClient::requestPermission(ScriptExecutionContext* context, PassRefPtr<VoidCallback> callback)
    151151{
    152 #if ENABLE(NOTIFICATIONS)
     152#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
    153153    BEGIN_BLOCK_OBJC_EXCEPTIONS;
    154154   
     
    174174NotificationClient::Permission WebNotificationClient::checkPermission(ScriptExecutionContext* context)
    175175{
    176 #if ENABLE(NOTIFICATIONS)
     176#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
    177177    if (!context || !context->isDocument())
    178178        return NotificationClient::PermissionDenied;
     
    198198}
    199199
    200 #if ENABLE(NOTIFICATIONS)
     200#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
    201201@implementation WebNotificationPolicyListener
    202202- (id)initWithCallback:(PassRefPtr<VoidCallback>)callback
  • trunk/Source/WebKit/mac/WebView/WebNotification.mm

    r109766 r110784  
    3131#import "WebNotificationInternal.h"
    3232
    33 #if ENABLE(NOTIFICATIONS)
     33#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
    3434#import "WebSecurityOriginInternal.h"
    3535#import <WebCore/Notification.h>
     
    4545{
    4646@public
    47 #if ENABLE(NOTIFICATIONS)
     47#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
    4848    RefPtr<Notification> _internal;
    4949    uint64_t _notificationID;
     
    5555@end
    5656
    57 #if ENABLE(NOTIFICATIONS)
     57#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
    5858@implementation WebNotification (WebNotificationInternal)
    5959Notification* core(WebNotification *notification)
     
    8484- (NSString *)title
    8585{
    86 #if ENABLE(NOTIFICATIONS)
     86#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
    8787    ASSERT(core(self));
    8888    return core(self)->contents().title;
     
    9494- (NSString *)body
    9595{
    96 #if ENABLE(NOTIFICATIONS)
     96#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
    9797    ASSERT(core(self));
    9898    return core(self)->contents().body;
     
    104104- (NSString *)replaceID
    105105{
    106 #if ENABLE(NOTIFICATIONS)
     106#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
    107107    ASSERT(core(self));
    108108    return core(self)->replaceId();
     
    114114- (WebSecurityOrigin *)origin
    115115{
    116 #if ENABLE(NOTIFICATIONS)
     116#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
    117117    ASSERT(core(self));
    118118    return [[[WebSecurityOrigin alloc] _initWithWebCoreSecurityOrigin:core(self)->scriptExecutionContext()->securityOrigin()] autorelease];
     
    124124- (uint64_t)notificationID
    125125{
    126 #if ENABLE(NOTIFICATIONS)
     126#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
    127127    ASSERT(core(self));
    128128    return _private->_notificationID;
     
    134134- (void)dispatchShowEvent
    135135{
    136 #if ENABLE(NOTIFICATIONS)
     136#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
    137137    ASSERT(core(self));
    138138    core(self)->dispatchShowEvent();
     
    142142- (void)dispatchCloseEvent
    143143{
    144 #if ENABLE(NOTIFICATIONS)
     144#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
    145145    ASSERT(core(self));
    146146    core(self)->dispatchCloseEvent();
     
    150150- (void)dispatchClickEvent
    151151{
    152 #if ENABLE(NOTIFICATIONS)
     152#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
    153153    ASSERT(core(self));
    154154    core(self)->dispatchClickEvent();
     
    158158- (void)dispatchErrorEvent
    159159{
    160 #if ENABLE(NOTIFICATIONS)
     160#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
    161161    ASSERT(core(self));
    162162    core(self)->dispatchErrorEvent();
  • trunk/Source/WebKit/mac/WebView/WebNotificationInternal.h

    r108409 r110784  
    2929#import "WebNotification.h"
    3030
    31 #if ENABLE(NOTIFICATIONS)
     31#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
    3232
    3333namespace WebCore {
  • trunk/Source/WebKit/mac/WebView/WebView.mm

    r110595 r110784  
    741741#endif
    742742    _private->page = new Page(pageClients);
    743 #if ENABLE(NOTIFICATIONS)
     743#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
    744744    WebCore::provideNotification(_private->page, new WebNotificationClient(self));
    745745#endif
  • trunk/Source/WebKit/qt/Api/qwebpage.cpp

    r110677 r110784  
    341341    WebCore::provideDeviceMotionTo(page, new DeviceMotionClientQt);
    342342#endif
    343 #if ENABLE(NOTIFICATIONS)
     343#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
    344344    WebCore::provideNotification(page, NotificationPresenterClientQt::notificationPresenter());
    345345#endif
     
    364364    PageGroup::setShouldTrackVisitedLinks(true);
    365365   
    366 #if ENABLE(NOTIFICATIONS)    
     366#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
    367367    NotificationPresenterClientQt::notificationPresenter()->addClient();
    368368#endif
     
    388388        inspector->setPage(0);
    389389
    390 #if ENABLE(NOTIFICATIONS)
     390#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
    391391    NotificationPresenterClientQt::notificationPresenter()->removeClient();
    392392#endif
     
    21502150    switch (feature) {
    21512151    case Notifications:
    2152 #if ENABLE(NOTIFICATIONS)
     2152#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
    21532153        if (policy == PermissionGrantedByUser)
    21542154            NotificationPresenterClientQt::notificationPresenter()->allowNotificationForFrame(frame->d->frame);
  • trunk/Source/WebKit/qt/ChangeLog

    r110677 r110784  
     12012-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
    1382012-03-14  Csaba Osztrogonác  <ossy@webkit.org>
    239
  • trunk/Source/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp

    r110604 r110784  
    791791void DumpRenderTreeSupportQt::dumpNotification(bool b)
    792792{
    793 #if ENABLE(NOTIFICATIONS)
     793#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
    794794    NotificationPresenterClientQt::dumpNotification = b;
    795795#endif
     
    988988void DumpRenderTreeSupportQt::simulateDesktopNotificationClick(const QString& title)
    989989{
    990 #if ENABLE(NOTIFICATIONS)
     990#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
    991991    NotificationPresenterClientQt::notificationPresenter()->notificationClicked(title);
    992992#endif
  • trunk/Source/WebKit/qt/WebCoreSupport/NotificationPresenterClientQt.cpp

    r110381 r110784  
    4949namespace WebCore {
    5050
    51 #if ENABLE(NOTIFICATIONS)
     51#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
    5252
    5353const double notificationTimeout = 10.0;
     
    7171    : m_closeTimer(this, &NotificationWrapper::close)
    7272{
    73 #if ENABLE(NOTIFICATIONS)
     73#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
    7474
    7575#ifndef QT_NO_SYSTEMTRAYICON
     
    8282void NotificationWrapper::close(Timer<NotificationWrapper>*)
    8383{
    84 #if ENABLE(NOTIFICATIONS)
     84#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
    8585    NotificationPresenterClientQt::notificationPresenter()->cancel(this);
    8686#endif
     
    8989const QString NotificationWrapper::title() const
    9090{
    91 #if ENABLE(NOTIFICATIONS)
     91#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
    9292    Notification* notification = NotificationPresenterClientQt::notificationPresenter()->notificationForWrapper(this);
    9393    if (notification)
     
    9999const QString NotificationWrapper::message() const
    100100{
    101 #if ENABLE(NOTIFICATIONS)
     101#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
    102102    Notification* notification = NotificationPresenterClientQt::notificationPresenter()->notificationForWrapper(this);
    103103    if (notification)
     
    110110{
    111111    QByteArray iconData;
    112 #if ENABLE(NOTIFICATIONS)
     112#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
    113113    Notification* notification = NotificationPresenterClientQt::notificationPresenter()->notificationForWrapper(this);
    114114    if (notification) {
     
    123123{
    124124    QUrl url;
    125 #if ENABLE(NOTIFICATIONS)
     125#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
    126126    Notification* notification = NotificationPresenterClientQt::notificationPresenter()->notificationForWrapper(this);
    127127    if (notification) {
     
    135135void NotificationWrapper::notificationClicked()
    136136{
    137 #if ENABLE(NOTIFICATIONS)
     137#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
    138138    NotificationPresenterClientQt::notificationPresenter()->notificationClicked(this);
    139139#endif
     
    142142void NotificationWrapper::notificationClosed()
    143143{
    144 #if ENABLE(NOTIFICATIONS)
     144#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
    145145    NotificationPresenterClientQt::notificationPresenter()->cancel(this);
    146146#endif
    147147}
    148148
    149 #if ENABLE(NOTIFICATIONS)
     149#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
    150150
    151151NotificationPresenterClientQt::NotificationPresenterClientQt() : m_clientCount(0)
     
    465465}
    466466
    467 #endif // ENABLE(NOTIFICATIONS)
     467#endif // ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
    468468}
    469469
  • trunk/Source/WebKit/qt/WebCoreSupport/NotificationPresenterClientQt.h

    r110381 r110784  
    7878};
    7979
    80 #if ENABLE(NOTIFICATIONS)
     80#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
    8181
    8282typedef QHash <Notification*, NotificationWrapper*> NotificationsQueue;
  • trunk/Source/WebKit/win/ChangeLog

    r110595 r110784  
     12012-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
    1252012-03-13  Adam Barth  <abarth@webkit.org> && Benjamin Poulain  <bpoulain@apple.com>
    226
  • trunk/Source/WebKit/win/WebCoreSupport/WebChromeClient.cpp

    r102874 r110784  
    7575WebChromeClient::WebChromeClient(WebView* webView)
    7676    : m_webView(webView)
    77 #if ENABLE(NOTIFICATIONS)
     77#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
    7878    , m_notificationsDelegate(new WebDesktopNotificationsDelegate(webView))
    7979#endif
  • trunk/Source/WebKit/win/WebCoreSupport/WebChromeClient.h

    r110595 r110784  
    151151#endif
    152152
    153 #if ENABLE(NOTIFICATIONS)
     153#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
    154154    virtual WebCore::NotificationClient* notificationPresenter() const { return reinterpret_cast<WebCore::NotificationClient*>(m_notificationsDelegate.get()); }
    155155#endif
     
    176176    WebView* m_webView;
    177177
    178 #if ENABLE(NOTIFICATIONS)
     178#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
    179179    OwnPtr<WebDesktopNotificationsDelegate> m_notificationsDelegate;
    180180#endif
  • trunk/Source/WebKit/win/WebCoreSupport/WebDesktopNotificationsDelegate.cpp

    r110381 r110784  
    3737#include <WebCore/KURL.h>
    3838
    39 #if ENABLE(NOTIFICATIONS)
     39#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
    4040
    4141using namespace WebCore;
     
    212212}
    213213
    214 #endif  // ENABLE(NOTIFICATIONS)
     214#endif // ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
  • trunk/Source/WebKit/win/WebCoreSupport/WebDesktopNotificationsDelegate.h

    r110381 r110784  
    3333#include <WebCore/NotificationClient.h>
    3434
    35 #if ENABLE(NOTIFICATIONS)
     35#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
    3636
    3737interface IWebDesktopNotificationPresenter;
  • trunk/Source/WebKit/wince/ChangeLog

    r110595 r110784  
     12012-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
    1212012-03-13  Adam Barth  <abarth@webkit.org> && Benjamin Poulain  <bpoulain@apple.com>
    222
  • trunk/Source/WebKit/wince/WebCoreSupport/ChromeClientWinCE.h

    r110595 r110784  
    132132    virtual void reachedApplicationCacheOriginQuota(WebCore::SecurityOrigin*, int64_t totalSpaceNeeded);
    133133
    134 #if ENABLE(NOTIFICATIONS)
     134#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
    135135    virtual WebCore::NotificationClient* notificationPresenter() const;
    136136#endif
  • trunk/Source/WebKit2/ChangeLog

    r110781 r110784  
     12012-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
    1592012-03-14  Dinu Jacob  <dinu.jacob@nokia.com>
    260
  • trunk/Source/WebKit2/Shared/WebProcessCreationParameters.cpp

    r110425 r110784  
    100100#endif
    101101
    102 #if ENABLE(NOTIFICATIONS)
     102#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
    103103    encoder->encode(notificationPermissions);
    104104#endif
     
    195195#endif
    196196
    197 #if ENABLE(NOTIFICATIONS)
     197#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
    198198    if (!decoder->decode(parameters.notificationPermissions))
    199199        return false;
  • trunk/Source/WebKit2/Shared/WebProcessCreationParameters.h

    r110425 r110784  
    123123#endif
    124124
    125 #if ENABLE(NOTIFICATIONS)
     125#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
    126126    HashMap<String, bool> notificationPermissions;
    127127#endif
  • trunk/Source/WebKit2/UIProcess/WebContext.cpp

    r110425 r110784  
    280280    parameters.defaultRequestTimeoutInterval = WebURLRequest::defaultTimeoutInterval();
    281281
    282 #if ENABLE(NOTIFICATIONS)
     282#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
    283283    m_notificationManagerProxy->populateCopyOfNotificationPermissions(parameters.notificationPermissions);
    284284#endif
  • trunk/Source/WebKit2/WebProcess/Notifications/NotificationPermissionRequestManager.cpp

    r110381 r110784  
    4242namespace WebKit {
    4343
    44 #if ENABLE(NOTIFICATIONS)
     44#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
    4545static uint64_t generateRequestID()
    4646{
     
    6262void NotificationPermissionRequestManager::startRequest(SecurityOrigin* origin, PassRefPtr<VoidCallback> callback)
    6363{
    64 #if ENABLE(NOTIFICATIONS)
     64#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
    6565    if (permissionLevel(origin) != NotificationClient::PermissionNotAllowed) {
    6666        callback->handleEvent();
     
    8181void NotificationPermissionRequestManager::cancelRequest(SecurityOrigin* origin)
    8282{
    83 #if ENABLE(NOTIFICATIONS)
     83#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
    8484    uint64_t id = m_originToIDMap.take(origin);
    8585    if (!id)
     
    9595NotificationClient::Permission NotificationPermissionRequestManager::permissionLevel(SecurityOrigin* securityOrigin)
    9696{
    97 #if ENABLE(NOTIFICATIONS)
     97#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
    9898    if (!m_page->corePage()->settings()->notificationsEnabled())
    9999        return NotificationClient::PermissionDenied;
     
    108108void NotificationPermissionRequestManager::didReceiveNotificationPermissionDecision(uint64_t requestID, bool allowed)
    109109{
    110 #if ENABLE(NOTIFICATIONS)
     110#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
    111111    if (!isRequestIDValid(requestID))
    112112        return;
  • trunk/Source/WebKit2/WebProcess/Notifications/WebNotificationManager.cpp

    r110381 r110784  
    3030#include "WebProcess.h"
    3131
    32 #if ENABLE(NOTIFICATIONS)
     32#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
    3333#include "WebNotification.h"
    3434#include "WebNotificationManagerProxyMessages.h"
     
    4646namespace WebKit {
    4747
    48 #if ENABLE(NOTIFICATIONS)
     48#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
    4949static uint64_t generateNotificationID()
    5050{
     
    7070void WebNotificationManager::initialize(const HashMap<String, bool>& permissions)
    7171{
    72 #if ENABLE(NOTIFICATIONS)
     72#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
    7373    m_permissionsMap = permissions;
    7474#endif
     
    7777void WebNotificationManager::didUpdateNotificationDecision(const String& originString, bool allowed)
    7878{
    79 #if ENABLE(NOTIFICATIONS)
     79#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
    8080    m_permissionsMap.set(originString, allowed);
    8181#endif
     
    8484void WebNotificationManager::didRemoveNotificationDecisions(const Vector<String>& originStrings)
    8585{
    86 #if ENABLE(NOTIFICATIONS)
     86#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
    8787    size_t count = originStrings.size();
    8888    for (size_t i = 0; i < count; ++i)
     
    9393NotificationClient::Permission WebNotificationManager::policyForOrigin(WebCore::SecurityOrigin *origin) const
    9494{
    95 #if ENABLE(NOTIFICATIONS)
     95#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
    9696    if (!origin)
    9797        return NotificationClient::PermissionNotAllowed;
     
    107107bool WebNotificationManager::show(Notification* notification, WebPage* page)
    108108{
    109 #if ENABLE(NOTIFICATIONS)
     109#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
    110110    if (!notification || !page->corePage()->settings()->notificationsEnabled())
    111111        return true;
     
    127127void WebNotificationManager::cancel(Notification* notification, WebPage* page)
    128128{
    129 #if ENABLE(NOTIFICATIONS)
     129#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
    130130    if (!notification || !page->corePage()->settings()->notificationsEnabled())
    131131        return;
     
    141141void WebNotificationManager::clearNotifications(WebCore::ScriptExecutionContext* context, WebPage* page)
    142142{
    143 #if ENABLE(NOTIFICATIONS)
     143#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
    144144    NotificationContextMap::iterator it = m_notificationContextMap.find(context);
    145145    if (it == m_notificationContextMap.end())
     
    162162void WebNotificationManager::didDestroyNotification(Notification* notification, WebPage* page)
    163163{
    164 #if ENABLE(NOTIFICATIONS)
     164#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
    165165    uint64_t notificationID = m_notificationMap.take(notification);
    166166    if (!notificationID)
     
    175175void WebNotificationManager::didShowNotification(uint64_t notificationID)
    176176{
    177 #if ENABLE(NOTIFICATIONS)
     177#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
    178178    if (!isNotificationIDValid(notificationID))
    179179        return;
     
    189189void WebNotificationManager::didClickNotification(uint64_t notificationID)
    190190{
    191 #if ENABLE(NOTIFICATIONS)
     191#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
    192192    if (!isNotificationIDValid(notificationID))
    193193        return;
     
    203203void WebNotificationManager::didCloseNotifications(const Vector<uint64_t>& notificationIDs)
    204204{
    205 #if ENABLE(NOTIFICATIONS)
     205#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
    206206    size_t count = notificationIDs.size();
    207207    for (size_t i = 0; i < count; ++i) {
     
    222222}
    223223
    224 #if ENABLE(NOTIFICATIONS)
     224#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
    225225void WebNotificationManager::removeNotificationFromContextMap(uint64_t notificationID, Notification* notification)
    226226{
  • trunk/Source/WebKit2/WebProcess/Notifications/WebNotificationManager.h

    r110381 r110784  
    7979    void didRemoveNotificationDecisions(const Vector<String>& originStrings);
    8080   
    81 #if ENABLE(NOTIFICATIONS)
     81#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
    8282    void removeNotificationFromContextMap(uint64_t notificationID, WebCore::Notification*);
    8383#endif
     
    8585    WebProcess* m_process;
    8686
    87 #if ENABLE(NOTIFICATIONS)
     87#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
    8888    typedef HashMap<RefPtr<WebCore::Notification>, uint64_t> NotificationMap;
    8989    NotificationMap m_notificationMap;
  • trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebNotificationClient.cpp

    r110381 r110784  
    2727#include "WebNotificationClient.h"
    2828
    29 #if ENABLE(NOTIFICATIONS)
     29#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
    3030
    3131#include "NotificationPermissionRequestManager.h"
     
    9292} // namespace WebKit
    9393
    94 #endif // ENABLE(NOTIFICATIONS)
     94#endif // ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
  • trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebNotificationClient.h

    r110381 r110784  
    2727#define WebNotificationClient_h
    2828
    29 #if ENABLE(NOTIFICATIONS)
     29#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
    3030
    3131#include <WebCore/NotificationClient.h>
     
    6060} // namespace WebKit
    6161
    62 #endif // ENABLE(NOTIFICATIONS)
     62#endif // ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
    6363
    6464#endif // WebNotificationClient_h
  • trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp

    r110743 r110784  
    238238    m_page = adoptPtr(new Page(pageClients));
    239239
    240 #if ENABLE(NOTIFICATIONS)
     240#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
    241241    WebCore::provideNotification(m_page.get(), new WebNotificationClient(this));
    242242#endif
     
    19531953#endif
    19541954
    1955 #if ENABLE(NOTIFICATIONS)
     1955#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
    19561956    settings->setNotificationsEnabled(store.getBoolValueForKey(WebPreferencesKey::notificationsEnabledKey()));
    19571957#endif
  • trunk/Source/WebKit2/WebProcess/WebProcess.cpp

    r108125 r110784  
    142142    , m_textCheckerState()
    143143    , m_geolocationManager(this)
    144 #if ENABLE(NOTIFICATIONS)
     144#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
    145145    , m_notificationManager(this)
    146146#endif
     
    639639    }
    640640
    641 #if ENABLE(NOTIFICATIONS)
     641#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
    642642    if (messageID.is<CoreIPC::MessageClassWebNotificationManager>()) {
    643643        m_notificationManager.didReceiveMessage(connection, messageID, arguments);
  • trunk/Source/WebKit2/WebProcess/WebProcess.h

    r105475 r110784  
    4949#endif
    5050
    51 #if ENABLE(NOTIFICATIONS)
     51#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
    5252#include "WebNotificationManager.h"
    5353#endif
     
    134134    WebGeolocationManager& geolocationManager() { return m_geolocationManager; }
    135135   
    136 #if ENABLE(NOTIFICATIONS)
     136#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
    137137    WebNotificationManager& notificationManager() { return m_notificationManager; }
    138138#endif
     
    269269    TextCheckerState m_textCheckerState;
    270270    WebGeolocationManager m_geolocationManager;
    271 #if ENABLE(NOTIFICATIONS)
     271#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
    272272    WebNotificationManager m_notificationManager;
    273273#endif
  • trunk/Source/WebKit2/WebProcess/mac/WebProcessMac.mm

    r110425 r110784  
    252252    m_compositingRenderServerPort = parameters.acceleratedCompositingPort.port();
    253253
    254 #if ENABLE(NOTIFICATIONS)
     254#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
    255255    m_notificationManager.initialize(parameters.notificationPermissions);
    256256#endif
  • trunk/Tools/ChangeLog

    r110783 r110784  
     12012-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
    1282012-03-13  Ojan Vafai  <ojan@chromium.org>
    229
  • trunk/Tools/DumpRenderTree/chromium/LayoutTestController.cpp

    r109288 r110784  
    11921192        return;
    11931193    }
    1194 #if ENABLE(NOTIFICATIONS)
     1194#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
    11951195    m_shell->notificationPresenter()->grantPermission(cppVariantToWebString(arguments[0]));
    11961196#endif
     
    12041204        return;
    12051205    }
    1206 #if ENABLE(NOTIFICATIONS)
     1206#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
    12071207    if (m_shell->notificationPresenter()->simulateClick(cppVariantToWebString(arguments[0])))
    12081208        result->set(true);
  • trunk/Tools/DumpRenderTree/chromium/NotificationPresenter.cpp

    r102044 r110784  
    3232#include "NotificationPresenter.h"
    3333
    34 #if ENABLE(NOTIFICATIONS)
     34#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
    3535
    3636#include "WebKit.h"
     
    152152}
    153153
    154 #endif // ENABLE(NOTIFICATIONS)
     154#endif // ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
  • trunk/Tools/DumpRenderTree/chromium/TestShell.cpp

    r110032 r110784  
    139139    m_eventSender = adoptPtr(new EventSender(this));
    140140    m_textInputController = adoptPtr(new TextInputController(this));
    141 #if ENABLE(NOTIFICATIONS)
     141#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
    142142    m_notificationPresenter = adoptPtr(new NotificationPresenter(this));
    143143#endif
     
    295295    m_eventSender->reset();
    296296    m_webViewHost->reset();
    297 #if ENABLE(NOTIFICATIONS)
     297#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
    298298    m_notificationPresenter->reset();
    299299#endif
  • trunk/Tools/DumpRenderTree/win/DRTDesktopNotificationPresenter.cpp

    r110381 r110784  
    124124        /* [out, retval] */ int* result)
    125125{
    126 #if ENABLE(NOTIFICATIONS)
     126#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
    127127    JSStringRef jsOrigin = JSStringCreateWithBSTR(origin);
    128128    bool allowed = ::gLayoutTestController->checkDesktopNotificationPermission(jsOrigin);
Note: See TracChangeset for help on using the changeset viewer.