Changeset 57408 in webkit


Ignore:
Timestamp:
Apr 10, 2010 12:35:01 AM (14 years ago)
Author:
Laszlo Gombos
Message:

2010-04-10 Laszlo Gombos <Laszlo Gombos>

Reviewed by Kenneth Rohde Christiansen.

[Qt] Implement Desktop Notifications API for QtWebKit
https://bugs.webkit.org/show_bug.cgi?id=35503

Map WebKit notifications to Qt's SystemTray API and
implement DRT tracing.

This patch does not implement the security part of
WebKit notifications.

  • Api/qwebpage.cpp: (QWebPagePrivate::QWebPagePrivate):
  • Api/qwebpage.h:
  • Api/qwebpage_p.h:
  • WebCoreSupport/ChromeClientQt.cpp: (WebCore::ChromeClientQt::notificationPresenter):
  • WebCoreSupport/ChromeClientQt.h:
  • WebCoreSupport/NotificationPresenterClientQt.cpp: Added. (qt_dump_notification): (NotificationPresenterClientQt::NotificationPresenterClientQt): (NotificationPresenterClientQt::show): (NotificationPresenterClientQt::cancel): (NotificationPresenterClientQt::notificationObjectDestroyed): (NotificationPresenterClientQt::requestPermission): (NotificationPresenterClientQt::checkPermission):
  • WebCoreSupport/NotificationPresenterClientQt.h: Added.

2010-04-10 Laszlo Gombos <Laszlo Gombos>

Reviewed by Kenneth Rohde Christiansen.

[Qt] Implement Desktop Notifications API for QtWebKit
https://bugs.webkit.org/show_bug.cgi?id=35503

No new tests enabled as notification DRT tests are
disabled at the moment.

  • WebCore.pri: Add files to the build system and turn on the feature by default.
  • WebCore.pro: Add files to the build system
  • bindings/js/JSDesktopNotificationsCustom.cpp: (WebCore::JSNotificationCenter::requestPermission): (WebCore::JSNotification::addEventListener): (WebCore::JSNotification::removeEventListener): Fix build regresssion.

2010-04-10 Laszlo Gombos <Laszlo Gombos>

Reviewed by Kenneth Rohde Christiansen.

[Qt] Implement Desktop Notifications API for QtWebKit
https://bugs.webkit.org/show_bug.cgi?id=35503

DRT stubs for notification. Enables to run and pass
3 (currently disabled) tests.

  • DumpRenderTree/qt/LayoutTestControllerQt.cpp: (LayoutTestController::LayoutTestController): (LayoutTestController::grantDesktopNotificationPermission): (LayoutTestController::checkDesktopNotificationPermission):
  • DumpRenderTree/qt/LayoutTestControllerQt.h:
Location:
trunk
Files:
2 added
13 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r57405 r57408  
     12010-04-10  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
     2
     3        Reviewed by Kenneth Rohde Christiansen.
     4
     5        [Qt] Implement Desktop Notifications API for QtWebKit
     6        https://bugs.webkit.org/show_bug.cgi?id=35503
     7
     8        No new tests enabled as notification DRT tests are
     9        disabled at the moment.
     10
     11        * WebCore.pri: Add files to the build system and turn
     12        on the feature by default.
     13
     14        * WebCore.pro: Add files to the build system
     15
     16        * bindings/js/JSDesktopNotificationsCustom.cpp:
     17        (WebCore::JSNotificationCenter::requestPermission):
     18        (WebCore::JSNotification::addEventListener):
     19        (WebCore::JSNotification::removeEventListener):
     20        Fix build regresssion.
     21
    1222010-04-09  Pavel Feldman  <pfeldman@chromium.org>
    223
  • trunk/WebCore/WebCore.pri

    r57316 r57408  
    5757!contains(DEFINES, ENABLE_PROGRESS_TAG=.): DEFINES += ENABLE_PROGRESS_TAG=1
    5858!contains(DEFINES, ENABLE_BLOB_SLICE=.): DEFINES += ENABLE_BLOB_SLICE=0
     59!contains(DEFINES, ENABLE_NOTIFICATIONS=.): DEFINES += ENABLE_NOTIFICATIONS=1
    5960
    6061greaterThan(QT_MINOR_VERSION, 5) {
     
    158159contains(DEFINES, ENABLE_TOUCH_EVENTS=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_TOUCH_EVENTS=1
    159160contains(DEFINES, ENABLE_TILED_BACKING_STORE=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_TILED_BACKING_STORE=1
     161contains(DEFINES, ENABLE_NOTIFICATIONS=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_NOTIFICATIONS=1
    160162
    161163
     
    402404    inspector/JavaScriptCallFrame.idl \
    403405    loader/appcache/DOMApplicationCache.idl \
     406    notifications/Notification.idl \
     407    notifications/NotificationCenter.idl \
    404408    page/BarInfo.idl \
    405409    page/Console.idl \
  • trunk/WebCore/WebCore.pro

    r57320 r57408  
    296296    bindings/js/JSDataGridDataSource.cpp \
    297297    bindings/js/JSDebugWrapperSet.cpp \
     298    bindings/js/JSDesktopNotificationsCustom.cpp \
    298299    bindings/js/JSDocumentCustom.cpp \
    299300    bindings/js/JSDocumentFragmentCustom.cpp \
     
    760761    loader/TextResourceDecoder.cpp \
    761762    loader/ThreadableLoader.cpp \
     763    notifications/Notification.cpp \
     764    notifications/NotificationCenter.cpp \
    762765    page/animation/AnimationBase.cpp \
    763766    page/animation/AnimationController.cpp \
     
    14841487    loader/ThreadableLoader.h \
    14851488    loader/WorkerThreadableLoader.h \
     1489    notifications/Notification.h \
     1490    notifications/NotificationCenter.h \
     1491    notifications/NotificationPresenter.h \
     1492    notifications/NotificationContents.h \
    14861493    page/animation/AnimationBase.h \
    14871494    page/animation/AnimationController.h \
     
    20262033    $$PWD/../WebKit/qt/WebCoreSupport/QtFallbackWebPopup.h \
    20272034    $$PWD/../WebKit/qt/WebCoreSupport/FrameLoaderClientQt.h \
     2035    $$PWD/../WebKit/qt/WebCoreSupport/NotificationPresenterClientQt.h \
    20282036    $$PWD/platform/network/qt/DnsPrefetchHelper.h
    20292037
     
    21122120    ../WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp \
    21132121    ../WebKit/qt/WebCoreSupport/InspectorClientQt.cpp \
     2122    ../WebKit/qt/WebCoreSupport/NotificationPresenterClientQt.cpp \
    21142123    ../WebKit/qt/Api/qwebframe.cpp \
    21152124    ../WebKit/qt/Api/qgraphicswebview.cpp \
  • trunk/WebCore/bindings/js/JSDesktopNotificationsCustom.cpp

    r49963 r57408  
    5656        return throwError(exec, TypeError);
    5757
    58     PassRefPtr<JSCustomVoidCallback> callback = JSCustomVoidCallback::create(args.at(0).getObject(), static_cast<Document*>(context)->frame());
     58    PassRefPtr<JSCustomVoidCallback> callback = JSCustomVoidCallback::create(args.at(0).getObject(), toJSDOMGlobalObject(static_cast<Document*>(context), exec));
    5959
    6060    impl()->requestPermission(callback);
     
    6868        return jsUndefined();
    6969
    70     impl()->addEventListener(args.at(0).toString(exec), JSEventListener::create(asObject(listener)), false, currentWorld(exec)), args.at(2).toBoolean(exec));
     70    impl()->addEventListener(args.at(0).toString(exec), JSEventListener::create(asObject(listener), this, false, currentWorld(exec)), args.at(2).toBoolean(exec));
    7171    return jsUndefined();
    7272}
     
    7878        return jsUndefined();
    7979
    80     impl()->removeEventListener(args.at(0).toString(exec), JSEventListener::create(asObject(listener), false, currentWorld(exec)).get(), args.at(2).toBoolean(exec));
     80    impl()->removeEventListener(args.at(0).toString(exec), JSEventListener::create(asObject(listener), this, false, currentWorld(exec)).get(), args.at(2).toBoolean(exec));
    8181    return jsUndefined();
    8282}
  • trunk/WebKit/qt/Api/qwebpage.cpp

    r57327 r57408  
    8181#include "runtime/InitializeThreading.h"
    8282#include "PageGroup.h"
     83#include "NotificationPresenterClientQt.h"
    8384#include "QWebPageClient.h"
    8485#include "WorkerThread.h"
     
    490491
    491492    PageGroup::setShouldTrackVisitedLinks(true);
     493   
     494#if ENABLE(NOTIFICATIONS)   
     495    notificationPresenterClient = new NotificationPresenterClientQt();
     496#endif
    492497}
    493498
     
    502507    delete settings;
    503508    delete page;
     509   
     510#if ENABLE(NOTIFICATIONS)
     511    delete notificationPresenterClient;
     512#endif
    504513}
    505514
  • trunk/WebKit/qt/Api/qwebpage.h

    r57327 r57408  
    5656    class InspectorClientQt;
    5757    class InspectorFrontendClientQt;
     58    class NotificationPresenterClientQt;
    5859    class ResourceHandle;
    5960    class HitTestResult;
     
    370371    friend class WebCore::InspectorClientQt;
    371372    friend class WebCore::InspectorFrontendClientQt;
     373    friend class WebCore::NotificationPresenterClientQt;
    372374    friend class WebCore::ResourceHandle;
    373375    friend class WebCore::QNetworkReplyHandler;
  • trunk/WebKit/qt/Api/qwebpage_p.h

    r56740 r57408  
    4545    class Element;
    4646    class InspectorController;
     47    class NotificationPresenterClientQt;
    4748    class Node;
    4849    class Page;
     
    186187    bool inspectorIsInternalOnly; // True if created through the Inspect context menu action
    187188    Qt::DropAction m_lastDropAction;
     189   
     190    WebCore::NotificationPresenterClientQt* notificationPresenterClient;
    188191
    189192    QString viewMode;
  • trunk/WebKit/qt/ChangeLog

    r57397 r57408  
     12010-04-10  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
     2
     3        Reviewed by Kenneth Rohde Christiansen.
     4
     5        [Qt] Implement Desktop Notifications API for QtWebKit
     6        https://bugs.webkit.org/show_bug.cgi?id=35503
     7
     8        Map WebKit notifications to Qt's SystemTray API and
     9        implement DRT tracing.
     10
     11        This patch does not implement the security part of
     12        WebKit notifications.
     13
     14        * Api/qwebpage.cpp:
     15        (QWebPagePrivate::QWebPagePrivate):
     16        * Api/qwebpage.h:
     17        * Api/qwebpage_p.h:
     18        * WebCoreSupport/ChromeClientQt.cpp:
     19        (WebCore::ChromeClientQt::notificationPresenter):
     20        * WebCoreSupport/ChromeClientQt.h:
     21        * WebCoreSupport/NotificationPresenterClientQt.cpp: Added.
     22        (qt_dump_notification):
     23        (NotificationPresenterClientQt::NotificationPresenterClientQt):
     24        (NotificationPresenterClientQt::show):
     25        (NotificationPresenterClientQt::cancel):
     26        (NotificationPresenterClientQt::notificationObjectDestroyed):
     27        (NotificationPresenterClientQt::requestPermission):
     28        (NotificationPresenterClientQt::checkPermission):
     29        * WebCoreSupport/NotificationPresenterClientQt.h: Added.
     30
    1312010-04-09  Tasuku Suzuki  <tasuku.suzuki@nokia.com>
    232
  • trunk/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp

    r57357 r57408  
    3838#include "HitTestResult.h"
    3939#include "Icon.h"
     40#include "NotificationPresenterClientQt.h"
    4041#include "NotImplemented.h"
    4142#include "ScrollbarTheme.h"
     
    471472    // FIXME: Free some space.
    472473    notImplemented();
     474}
     475#endif
     476
     477#if ENABLE(NOTIFICATIONS)
     478NotificationPresenter* ChromeClientQt::notificationPresenter() const
     479{
     480    return m_webPage->d->notificationPresenterClient;
    473481}
    474482#endif
  • trunk/WebKit/qt/WebCoreSupport/ChromeClientQt.h

    r56851 r57408  
    129129#endif
    130130
     131#if ENABLE(NOTIFICATIONS)
     132        virtual NotificationPresenter* notificationPresenter() const;
     133#endif
     134
    131135#if USE(ACCELERATED_COMPOSITING)
    132136        // see ChromeClient.h
  • trunk/WebKitTools/ChangeLog

    r57407 r57408  
     12010-04-10  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
     2
     3        Reviewed by Kenneth Rohde Christiansen.
     4
     5        [Qt] Implement Desktop Notifications API for QtWebKit
     6        https://bugs.webkit.org/show_bug.cgi?id=35503
     7
     8        DRT stubs for notification. Enables to run and pass
     9        3 (currently disabled) tests.
     10
     11        * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
     12        (LayoutTestController::LayoutTestController):
     13        (LayoutTestController::grantDesktopNotificationPermission):
     14        (LayoutTestController::checkDesktopNotificationPermission):
     15        * DumpRenderTree/qt/LayoutTestControllerQt.h:
     16
    1172010-04-09  Dumitru Daniliuc  <dumi@chromium.org>
    218
  • trunk/WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.cpp

    r57294 r57408  
    6060extern void qt_drt_webinspector_close(QWebPage *page);
    6161extern void qt_drt_enableCaretBrowsing(QWebPage* page, bool value);
     62extern void qt_dump_notification(bool b);
    6263
    6364LayoutTestController::LayoutTestController(WebCore::DumpRenderTree* drt)
     
    6667{
    6768    reset();
     69    qt_dump_notification(true);
    6870}
    6971
     
    197199}
    198200
     201void LayoutTestController::grantDesktopNotificationPermission(const QString& origin)
     202{
     203    // FIXME: Implement for notification security
     204}
     205
     206bool LayoutTestController::checkDesktopNotificationPermission(const QString& origin)
     207{
     208    // FIXME: Implement for notification security
     209    return true;
     210}
     211
    199212void LayoutTestController::display()
    200213{
  • trunk/WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.h

    r57277 r57408  
    111111    void setCloseRemainingWindowsWhenComplete(bool = false) {}
    112112    int windowCount();
     113    void grantDesktopNotificationPermission(const QString& origin);
     114    bool checkDesktopNotificationPermission(const QString& origin);
    113115    void display();
    114116    void clearBackForwardList();
Note: See TracChangeset for help on using the changeset viewer.