Rename NotificationPresenter to NotificationClient
authorjonlee@apple.com <jonlee@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 10 Mar 2012 18:42:05 +0000 (18:42 +0000)
committerjonlee@apple.com <jonlee@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 10 Mar 2012 18:42:05 +0000 (18:42 +0000)
https://bugs.webkit.org/show_bug.cgi?id=80488
<rdar://problem/10965558>

Reviewed by Kentaro Hara.

Source/WebCore:

* notifications/NotificationCenter.h: Renamed from notifications/NotificationPresenter.h.

Refactor to use renamed WebCore::NotificationClient.
* GNUmakefile.list.am:
* Target.pri:
* WebCore.exp.in:
* WebCore.gypi:
* WebCore.vcproj/WebCore.vcproj:
* WebCore.xcodeproj/project.pbxproj:
* notifications/Notification.cpp:
(WebCore::Notification::Notification):
(WebCore::Notification::show):
(WebCore::Notification::cancel):
(WebCore::Notification::contextDestroyed):
(WebCore::Notification::finishLoading):
* notifications/NotificationCenter.cpp:
(WebCore::NotificationCenter::create):
(WebCore::NotificationCenter::NotificationCenter):
(WebCore::NotificationCenter::checkPermission):
(WebCore::NotificationCenter::requestPermission):
(WebCore::NotificationCenter::disconnectFrame):
* notifications/NotificationController.cpp:
(WebCore::NotificationController::NotificationController):
(WebCore::NotificationController::create):
(WebCore::NotificationController::clientFrom):
(WebCore::provideNotification):
* notifications/NotificationController.h:
(WebCore):
(NotificationController):
(WebCore::NotificationController::client):
* page/DOMWindow.cpp:
(WebCore::DOMWindow::webkitNotifications):
* page/DOMWindow.h:
(DOMWindow):
* workers/WorkerContext.cpp:
(WebCore::WorkerContext::webkitNotifications):
* workers/WorkerThread.cpp:
(WebCore::WorkerThread::WorkerThread):
* workers/WorkerThread.h:
(WebCore):
(WebCore::WorkerThread::getNotificationClient):
(WebCore::WorkerThread::setNotificationClient):
(WorkerThread):

Source/WebKit/blackberry:

Refactor to use renamed WebCore::NotificationClient.
* WebCoreSupport/NotificationPresenterImpl.cpp:
(WebCore::NotificationPresenterImpl::instance):
(WebCore::NotificationPresenterImpl::show):
(WebCore::NotificationPresenterImpl::checkPermission):
* WebCoreSupport/NotificationPresenterImpl.h:
(NotificationPresenterImpl):

Source/WebKit/chromium:

Refactor to use renamed WebCore::NotificationClient.
* src/AssertMatchingEnums.cpp:
* src/NotificationPresenterImpl.cpp:
(WebKit::NotificationPresenterImpl::checkPermission):
* src/NotificationPresenterImpl.h:
(NotificationPresenterImpl):

Source/WebKit/efl:

Refactor to use renamed WebCore::NotificationClient.
* WebCoreSupport/ChromeClientEfl.cpp:
(WebCore::ChromeClientEfl::notificationPresenter):
* WebCoreSupport/ChromeClientEfl.h:
(ChromeClientEfl):

Source/WebKit/mac:

Refactor to use renamed WebCore::NotificationClient.
* WebCoreSupport/WebNotificationClient.h:
* WebCoreSupport/WebNotificationClient.mm:
(WebNotificationClient::checkPermission):
* WebView/WebViewPrivate.h:

Source/WebKit/qt:

Refactor to use renamed WebCore::NotificationClient.
* WebCoreSupport/NotificationPresenterClientQt.cpp:
(WebCore::NotificationPresenterClientQt::checkPermission):
(WebCore::NotificationPresenterClientQt::allowNotificationForFrame):
* WebCoreSupport/NotificationPresenterClientQt.h:
(NotificationPresenterClientQt):

Source/WebKit/win:

Refactor to use renamed WebCore::NotificationClient.
* WebCoreSupport/WebChromeClient.h:
(WebChromeClient::notificationPresenter):
* WebCoreSupport/WebDesktopNotificationsDelegate.cpp:
(WebDesktopNotificationsDelegate::checkPermission):
* WebCoreSupport/WebDesktopNotificationsDelegate.h:
(WebDesktopNotificationsDelegate):

Source/WebKit/wince:

Refactor to use renamed WebCore::NotificationClient.
* WebCoreSupport/ChromeClientWinCE.h:
(ChromeClientWinCE):

Source/WebKit2:

Refactor to use renamed WebCore::NotificationClient.
* UIProcess/Notifications/WebNotificationManagerProxy.h:
* WebProcess/Notifications/NotificationPermissionRequestManager.cpp:
(WebKit::NotificationPermissionRequestManager::startRequest):
(WebKit::NotificationPermissionRequestManager::permissionLevel):
* WebProcess/Notifications/NotificationPermissionRequestManager.h:
(NotificationPermissionRequestManager):
* WebProcess/Notifications/WebNotificationManager.cpp:
(WebKit::WebNotificationManager::policyForOrigin):
* WebProcess/Notifications/WebNotificationManager.h:
(WebNotificationManager):
* WebProcess/WebCoreSupport/WebNotificationClient.cpp:
(WebKit::WebNotificationClient::checkPermission):
* WebProcess/WebCoreSupport/WebNotificationClient.h:
(WebNotificationClient):

Tools:

Refactor to use renamed WebCore::NotificationClient.
* DumpRenderTree/win/DRTDesktopNotificationPresenter.cpp:
(DRTDesktopNotificationPresenter::checkNotificationPermission):

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

51 files changed:
Source/WebCore/ChangeLog
Source/WebCore/GNUmakefile.list.am
Source/WebCore/Target.pri
Source/WebCore/WebCore.exp.in
Source/WebCore/WebCore.gypi
Source/WebCore/WebCore.vcproj/WebCore.vcproj
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/notifications/Notification.cpp
Source/WebCore/notifications/NotificationCenter.cpp
Source/WebCore/notifications/NotificationCenter.h
Source/WebCore/notifications/NotificationClient.h [moved from Source/WebCore/notifications/NotificationPresenter.h with 92% similarity]
Source/WebCore/notifications/NotificationController.cpp
Source/WebCore/notifications/NotificationController.h
Source/WebCore/page/DOMWindow.cpp
Source/WebCore/page/DOMWindow.h
Source/WebCore/workers/WorkerContext.cpp
Source/WebCore/workers/WorkerThread.cpp
Source/WebCore/workers/WorkerThread.h
Source/WebKit/blackberry/ChangeLog
Source/WebKit/blackberry/WebCoreSupport/NotificationPresenterImpl.cpp
Source/WebKit/blackberry/WebCoreSupport/NotificationPresenterImpl.h
Source/WebKit/chromium/ChangeLog
Source/WebKit/chromium/src/AssertMatchingEnums.cpp
Source/WebKit/chromium/src/NotificationPresenterImpl.cpp
Source/WebKit/chromium/src/NotificationPresenterImpl.h
Source/WebKit/efl/ChangeLog
Source/WebKit/efl/WebCoreSupport/ChromeClientEfl.cpp
Source/WebKit/efl/WebCoreSupport/ChromeClientEfl.h
Source/WebKit/mac/ChangeLog
Source/WebKit/mac/WebCoreSupport/WebNotificationClient.h
Source/WebKit/mac/WebCoreSupport/WebNotificationClient.mm
Source/WebKit/mac/WebView/WebViewPrivate.h
Source/WebKit/qt/ChangeLog
Source/WebKit/qt/WebCoreSupport/NotificationPresenterClientQt.cpp
Source/WebKit/qt/WebCoreSupport/NotificationPresenterClientQt.h
Source/WebKit/win/ChangeLog
Source/WebKit/win/WebCoreSupport/WebChromeClient.h
Source/WebKit/win/WebCoreSupport/WebDesktopNotificationsDelegate.cpp
Source/WebKit/win/WebCoreSupport/WebDesktopNotificationsDelegate.h
Source/WebKit/wince/ChangeLog
Source/WebKit/wince/WebCoreSupport/ChromeClientWinCE.h
Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/Notifications/WebNotificationManagerProxy.h
Source/WebKit2/WebProcess/Notifications/NotificationPermissionRequestManager.cpp
Source/WebKit2/WebProcess/Notifications/NotificationPermissionRequestManager.h
Source/WebKit2/WebProcess/Notifications/WebNotificationManager.cpp
Source/WebKit2/WebProcess/Notifications/WebNotificationManager.h
Source/WebKit2/WebProcess/WebCoreSupport/WebNotificationClient.cpp
Source/WebKit2/WebProcess/WebCoreSupport/WebNotificationClient.h
Tools/ChangeLog
Tools/DumpRenderTree/win/DRTDesktopNotificationPresenter.cpp

index 527d170..6503b3e 100644 (file)
@@ -1,3 +1,55 @@
+2012-03-09  Jon Lee  <jonlee@apple.com>
+
+        Rename NotificationPresenter to NotificationClient
+        https://bugs.webkit.org/show_bug.cgi?id=80488
+        <rdar://problem/10965558>
+
+        Reviewed by Kentaro Hara.
+
+        * notifications/NotificationCenter.h: Renamed from notifications/NotificationPresenter.h.
+
+        Refactor to use renamed WebCore::NotificationClient.
+        * GNUmakefile.list.am:
+        * Target.pri:
+        * WebCore.exp.in:
+        * WebCore.gypi:
+        * WebCore.vcproj/WebCore.vcproj:
+        * WebCore.xcodeproj/project.pbxproj:
+        * notifications/Notification.cpp:
+        (WebCore::Notification::Notification):
+        (WebCore::Notification::show):
+        (WebCore::Notification::cancel):
+        (WebCore::Notification::contextDestroyed):
+        (WebCore::Notification::finishLoading):
+        * notifications/NotificationCenter.cpp:
+        (WebCore::NotificationCenter::create):
+        (WebCore::NotificationCenter::NotificationCenter):
+        (WebCore::NotificationCenter::checkPermission):
+        (WebCore::NotificationCenter::requestPermission):
+        (WebCore::NotificationCenter::disconnectFrame):
+        * notifications/NotificationController.cpp:
+        (WebCore::NotificationController::NotificationController):
+        (WebCore::NotificationController::create):
+        (WebCore::NotificationController::clientFrom):
+        (WebCore::provideNotification):
+        * notifications/NotificationController.h:
+        (WebCore):
+        (NotificationController):
+        (WebCore::NotificationController::client):
+        * page/DOMWindow.cpp:
+        (WebCore::DOMWindow::webkitNotifications):
+        * page/DOMWindow.h:
+        (DOMWindow):
+        * workers/WorkerContext.cpp:
+        (WebCore::WorkerContext::webkitNotifications):
+        * workers/WorkerThread.cpp:
+        (WebCore::WorkerThread::WorkerThread):
+        * workers/WorkerThread.h:
+        (WebCore):
+        (WebCore::WorkerThread::getNotificationClient):
+        (WebCore::WorkerThread::setNotificationClient):
+        (WorkerThread):
+
 2012-03-10  Julien Chaffraix  <jchaffraix@webkit.org>
 
         RenderObject with 'resize' different from 'none' should have a RenderLayer
index 4569419..2bd1f65 100644 (file)
@@ -2822,12 +2822,12 @@ webcore_sources += \
        Source/WebCore/mathml/MathMLTextElement.h \
        Source/WebCore/notifications/NotificationCenter.cpp \
        Source/WebCore/notifications/NotificationCenter.h \
+       Source/WebCore/notifications/NotificationClient.h \
        Source/WebCore/notifications/NotificationContents.h \
        Source/WebCore/notifications/NotificationController.cpp \
        Source/WebCore/notifications/NotificationController.h \
        Source/WebCore/notifications/Notification.cpp \
        Source/WebCore/notifications/Notification.h \
-       Source/WebCore/notifications/NotificationPresenter.h \
        Source/WebCore/page/animation/AnimationBase.cpp \
        Source/WebCore/page/animation/AnimationBase.h \
        Source/WebCore/page/animation/AnimationController.cpp \
index f8f2b5a..56c17f3 100644 (file)
@@ -2078,7 +2078,7 @@ HEADERS += \
     mathml/MathMLTextElement.h \
     notifications/Notification.h \
     notifications/NotificationCenter.h \
-    notifications/NotificationPresenter.h \
+    notifications/NotificationClient.h \
     notifications/NotificationContents.h \
     notifications/NotificationController.h \
     page/animation/AnimationBase.h \
index 7cadbcf..590b7c5 100644 (file)
@@ -597,11 +597,6 @@ __ZN7WebCore19TextResourceDecoder6decodeEPKcm
 __ZN7WebCore19TextResourceDecoderC1ERKN3WTF6StringERKNS_12TextEncodingEb
 __ZN7WebCore19TextResourceDecoderD1Ev
 __ZN7WebCore19applicationIsSafariEv
-
-#if ENABLE(NOTIFICATIONS)
-__ZN7WebCore19provideNotificationEPNS_4PageEPNS_21NotificationPresenterE
-#endif
-
 __ZN7WebCore20DisplaySleepDisablerC1EPKc
 __ZN7WebCore20DisplaySleepDisablerD1Ev
 __ZN7WebCore20NodeRenderingContextC1EPNS_4NodeE
@@ -2128,6 +2123,7 @@ __ZN7WebCore12Notification17dispatchShowEventEv
 __ZN7WebCore12Notification18dispatchClickEventEv
 __ZN7WebCore12Notification18dispatchCloseEventEv
 __ZN7WebCore12Notification18dispatchErrorEventEv
+__ZN7WebCore19provideNotificationEPNS_4PageEPNS_18NotificationClientE
 #endif
 
 #if ENABLE(THREADED_SCROLLING)
index 0478cfa..7685726 100644 (file)
             'Modules/webdatabase/SQLTransactionErrorCallback.h',
             'Modules/webdatabase/StorageTracker.h',
             'Modules/webdatabase/StorageTrackerClient.h',
+            'notifications/NotificationClient.h',
             'notifications/NotificationContents.h',
             'notifications/NotificationController.h',
-            'notifications/NotificationPresenter.h',
             'page/Chrome.h',
             'page/ChromeClient.h',
             'page/Console.h',
index 301c066..3ad09cf 100755 (executable)
                                >
                        </File>
                        <File
-                               RelativePath="..\notifications\NotificationContents.h"
+                               RelativePath="..\notifications\NotificationClient.h"
                                >
                        </File>
                        <File
-                               RelativePath="..\notifications\NotificationPresenter.h"
+                               RelativePath="..\notifications\NotificationContents.h"
                                >
                        </File>
                </Filter>
index fd69dc5..2e9059e 100644 (file)
                31FB1A6C120A5D6900DC02A0 /* JSDeviceMotionEventCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 31FB1A6B120A5D6900DC02A0 /* JSDeviceMotionEventCustom.cpp */; };
                3314ACEB10892086000F0E56 /* JSExceptionBase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3314ACE910892086000F0E56 /* JSExceptionBase.cpp */; };
                3314ACEC10892086000F0E56 /* JSExceptionBase.h in Headers */ = {isa = PBXBuildFile; fileRef = 3314ACEA10892086000F0E56 /* JSExceptionBase.h */; };
-               33503C9A10179A74003B47E1 /* NotificationPresenter.h in Headers */ = {isa = PBXBuildFile; fileRef = 33503C9910179A74003B47E1 /* NotificationPresenter.h */; settings = {ATTRIBUTES = (Private, ); }; };
+               33503C9A10179A74003B47E1 /* NotificationClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 33503C9910179A74003B47E1 /* NotificationClient.h */; settings = {ATTRIBUTES = (Private, ); }; };
                33503CA310179AD7003B47E1 /* JSNotification.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 33503C9F10179AD7003B47E1 /* JSNotification.cpp */; };
                33503CA410179AD7003B47E1 /* JSNotification.h in Headers */ = {isa = PBXBuildFile; fileRef = 33503CA010179AD7003B47E1 /* JSNotification.h */; };
                33503CA510179AD7003B47E1 /* JSNotificationCenter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 33503CA110179AD7003B47E1 /* JSNotificationCenter.cpp */; };
                3314ACEA10892086000F0E56 /* JSExceptionBase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSExceptionBase.h; sourceTree = "<group>"; };
                333F704E0FB49CA2008E12A6 /* Notification.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = Notification.idl; path = notifications/Notification.idl; sourceTree = "<group>"; };
                333F704F0FB49CA2008E12A6 /* Notification.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Notification.h; path = notifications/Notification.h; sourceTree = "<group>"; };
-               33503C9910179A74003B47E1 /* NotificationPresenter.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.h; fileEncoding = 4; name = NotificationPresenter.h; path = notifications/NotificationPresenter.h; sourceTree = "<group>"; };
+               33503C9910179A74003B47E1 /* NotificationClient.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.h; fileEncoding = 4; name = NotificationClient.h; path = notifications/NotificationClient.h; sourceTree = "<group>"; };
                33503C9F10179AD7003B47E1 /* JSNotification.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSNotification.cpp; sourceTree = "<group>"; };
                33503CA010179AD7003B47E1 /* JSNotification.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSNotification.h; sourceTree = "<group>"; };
                33503CA110179AD7003B47E1 /* JSNotificationCenter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSNotificationCenter.cpp; sourceTree = "<group>"; };
                                3390CA510FFC157B00921962 /* NotificationCenter.cpp */,
                                3390CA520FFC157B00921962 /* NotificationCenter.h */,
                                3390CA530FFC157B00921962 /* NotificationCenter.idl */,
+                               33503C9910179A74003B47E1 /* NotificationClient.h */,
                                3390CA540FFC157B00921962 /* NotificationContents.h */,
                                3128CA67147331520074C72A /* NotificationController.cpp */,
                                3128CA6A147331630074C72A /* NotificationController.h */,
-                               33503C9910179A74003B47E1 /* NotificationPresenter.h */,
                        );
                        name = notifications;
                        sourceTree = "<group>";
                                3390CA560FFC157B00921962 /* NotificationCenter.h in Headers */,
                                3390CA580FFC157B00921962 /* NotificationContents.h in Headers */,
                                3128CA6B147331630074C72A /* NotificationController.h in Headers */,
-                               33503C9A10179A74003B47E1 /* NotificationPresenter.h in Headers */,
+                               33503C9A10179A74003B47E1 /* NotificationClient.h in Headers */,
                                98EB1F951313FE0500D0E1EA /* NotImplemented.h in Headers */,
                                1A569D0B0D7E2B82007C3983 /* NP_jsobject.h in Headers */,
                                1A927FD21416A15B003A83C8 /* npapi.h in Headers */,
index 74964dc..5de0e52 100644 (file)
@@ -39,8 +39,8 @@
 #include "ErrorEvent.h"
 #include "EventNames.h"
 #include "NotificationCenter.h"
+#include "NotificationClient.h"
 #include "NotificationContents.h"
-#include "NotificationPresenter.h"
 #include "ResourceRequest.h"
 #include "ResourceResponse.h"
 #include "ThreadableLoader.h"
@@ -59,8 +59,8 @@ Notification::Notification(const KURL& url, ScriptExecutionContext* context, Exc
     , m_state(Idle)
     , m_notificationCenter(provider)
 {
-    ASSERT(m_notificationCenter->presenter());
-    if (m_notificationCenter->presenter()->checkPermission(context) != NotificationPresenter::PermissionAllowed) {
+    ASSERT(m_notificationCenter->client());
+    if (m_notificationCenter->client()->checkPermission(context) != NotificationClient::PermissionAllowed) {
         ec = SECURITY_ERR;
         return;
     }
@@ -80,8 +80,8 @@ Notification::Notification(const NotificationContents& contents, ScriptExecution
     , m_state(Idle)
     , m_notificationCenter(provider)
 {
-    ASSERT(m_notificationCenter->presenter());
-    if (m_notificationCenter->presenter()->checkPermission(context) != NotificationPresenter::PermissionAllowed) {
+    ASSERT(m_notificationCenter->client());
+    if (m_notificationCenter->client()->checkPermission(context) != NotificationClient::PermissionAllowed) {
         ec = SECURITY_ERR;
         return;
     }
@@ -127,19 +127,19 @@ void Notification::show()
         // handling of ondisplay may rely on that.
         if (m_state == Idle) {
             m_state = Showing;
-            if (m_notificationCenter->presenter())
-                m_notificationCenter->presenter()->show(this);
+            if (m_notificationCenter->client())
+                m_notificationCenter->client()->show(this);
         }
     } else
         startLoading();
 #elif PLATFORM(MAC)
-    if (m_state == Idle && m_notificationCenter->presenter()) {
-        m_notificationCenter->presenter()->show(this);
+    if (m_state == Idle && m_notificationCenter->client()) {
+        m_notificationCenter->client()->show(this);
         m_state = Showing;
     }
 #else
     // prevent double-showing
-    if (m_state == Idle && m_notificationCenter->presenter() && m_notificationCenter->presenter()->show(this))
+    if (m_state == Idle && m_notificationCenter->client() && m_notificationCenter->client()->show(this))
         m_state = Showing;
 #endif
 }
@@ -154,8 +154,8 @@ void Notification::cancel()
         stopLoading();
         break;
     case Showing:
-        if (m_notificationCenter->presenter())
-            m_notificationCenter->presenter()->cancel(this);
+        if (m_notificationCenter->client())
+            m_notificationCenter->client()->cancel(this);
         break;
     case Cancelled:
         break;
@@ -175,8 +175,8 @@ EventTargetData* Notification::ensureEventTargetData()
 void Notification::contextDestroyed()
 {
     ActiveDOMObject::contextDestroyed();
-    if (m_notificationCenter->presenter())
-        m_notificationCenter->presenter()->notificationObjectDestroyed(this);
+    if (m_notificationCenter->client())
+        m_notificationCenter->client()->notificationObjectDestroyed(this);
 }
 
 void Notification::startLoading()
@@ -234,7 +234,7 @@ void Notification::didFailRedirectCheck()
 void Notification::finishLoading()
 {
     if (m_state == Loading) {
-        if (m_notificationCenter->presenter() && m_notificationCenter->presenter()->show(this))
+        if (m_notificationCenter->client() && m_notificationCenter->client()->show(this))
             m_state = Showing;
     }
     unsetPendingActivity(this);
index 71146af..ff60445 100644 (file)
@@ -1,5 +1,6 @@
 /*
  * Copyright (C) 2009 Google Inc. All rights reserved.
+ * Copyright (C) 2012 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
 #include "NotificationCenter.h"
 
 #include "Document.h"
-#include "NotificationPresenter.h"
+#include "NotificationClient.h"
 #include "VoidCallback.h"
 #include "WorkerContext.h"
 
 namespace WebCore {
 
-PassRefPtr<NotificationCenter> NotificationCenter::create(ScriptExecutionContext* context, NotificationPresenter* presenter)
+PassRefPtr<NotificationCenter> NotificationCenter::create(ScriptExecutionContext* context, NotificationClient* client)
 {
-    RefPtr<NotificationCenter> notificationCenter(adoptRef(new NotificationCenter(context, presenter)));
+    RefPtr<NotificationCenter> notificationCenter(adoptRef(new NotificationCenter(context, client)));
     notificationCenter->suspendIfNeeded();
     return notificationCenter.release();
 }
 
-NotificationCenter::NotificationCenter(ScriptExecutionContext* context, NotificationPresenter* presenter)
+NotificationCenter::NotificationCenter(ScriptExecutionContext* context, NotificationClient* client)
     : ActiveDOMObject(context, this)
-    , m_notificationPresenter(presenter) {}
+    , m_client(client) { }
 
 int NotificationCenter::checkPermission()
 {
-    if (!presenter() || !scriptExecutionContext())
-        return NotificationPresenter::PermissionDenied;
-    return m_notificationPresenter->checkPermission(scriptExecutionContext());
+    if (!client() || !scriptExecutionContext())
+        return NotificationClient::PermissionDenied;
+    return m_client->checkPermission(scriptExecutionContext());
 }
 
 void NotificationCenter::requestPermission(PassRefPtr<VoidCallback> callback)
 {
-    if (!presenter() || !scriptExecutionContext())
+    if (!client() || !scriptExecutionContext())
         return;
-    m_notificationPresenter->requestPermission(scriptExecutionContext(), callback);
+    m_client->requestPermission(scriptExecutionContext(), callback);
 }
 
 void NotificationCenter::disconnectFrame()
 {
     // Can be 0 if iframe was transferred into another page. In this case
     // this method is invoked more then once.
-    if (!m_notificationPresenter)
+    if (!m_client)
         return;
-    m_notificationPresenter->cancelRequestsForPermission(scriptExecutionContext());
-    m_notificationPresenter->clearNotifications(scriptExecutionContext());
-    m_notificationPresenter = 0;
+    m_client->cancelRequestsForPermission(scriptExecutionContext());
+    m_client->clearNotifications(scriptExecutionContext());
+    m_client = 0;
 }
 
 } // namespace WebCore
index 402ccba..2cccc0d 100644 (file)
 
 namespace WebCore {
 
-class NotificationPresenter;
+class NotificationClient;
 class VoidCallback;
 
 class NotificationCenter : public RefCounted<NotificationCenter>, public ActiveDOMObject {
 public:
-    static PassRefPtr<NotificationCenter> create(ScriptExecutionContext*, NotificationPresenter*);
+    static PassRefPtr<NotificationCenter> create(ScriptExecutionContext*, NotificationClient*);
 
     PassRefPtr<Notification> createHTMLNotification(const String& URI, ExceptionCode& ec)
     {
-        if (!presenter()) {
+        if (!client()) {
             ec = INVALID_STATE_ERR;
             return 0;
         }
@@ -67,7 +67,7 @@ public:
 
     PassRefPtr<Notification> createNotification(const String& iconURI, const String& title, const String& body, ExceptionCode& ec)
     {
-        if (!presenter()) {
+        if (!client()) {
             ec = INVALID_STATE_ERR;
             return 0;
         }
@@ -75,7 +75,7 @@ public:
         return Notification::create(contents, scriptExecutionContext(), ec, this);
     }
 
-    NotificationPresenter* presenter() const { return m_notificationPresenter; }
+    NotificationClient* client() const { return m_client; }
 
     int checkPermission();
     void requestPermission(PassRefPtr<VoidCallback>);
@@ -83,9 +83,9 @@ public:
     void disconnectFrame();
 
 private:
-    NotificationCenter(ScriptExecutionContext*, NotificationPresenter*);
+    NotificationCenter(ScriptExecutionContext*, NotificationClient*);
 
-    NotificationPresenter* m_notificationPresenter;
+    NotificationClient* m_client;
 };
 
 } // namespace WebCore
@@ -1,6 +1,6 @@
 /*
  * Copyright (C) 2009 Google Inc. All rights reserved.
- * Copyright (C) 2011 Apple Inc. All rights reserved.
+ * Copyright (C) 2011, 2012 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#ifndef NotificationPresenter_h
-#define NotificationPresenter_h
+#ifndef NotificationClient_h
+#define NotificationClient_h
 
-#include <wtf/PassRefPtr.h>
 #include "VoidCallback.h"
+#include <wtf/PassRefPtr.h>
 
 namespace WebCore {
 
@@ -43,7 +43,7 @@ class KURL;
 class Page;
 class ScriptExecutionContext;
 
-class NotificationPresenter {
+class NotificationClient {
 
 public:
     enum Permission {
@@ -82,11 +82,11 @@ public:
     virtual Permission checkPermission(ScriptExecutionContext*) = 0;
 
 protected:
-    virtual ~NotificationPresenter() { }
+    virtual ~NotificationClient() { }
 };
 
-void provideNotification(Page*, NotificationPresenter*);
+void provideNotification(Page*, NotificationClient*);
 
 } // namespace WebCore
 
-#endif // NotificationPresenter_h
+#endif // NotificationClient_h
index 975b1d3..df235d3 100644 (file)
 
 #if ENABLE(NOTIFICATIONS)
 
-#include "NotificationPresenter.h"
+#include "NotificationClient.h"
 #include <wtf/PassOwnPtr.h>
 
 namespace WebCore {
 
-NotificationController::NotificationController(Page* page, NotificationPresenter* client)
+NotificationController::NotificationController(Page* page, NotificationClient* client)
     : m_page(page)
     , m_client(client)
 {
@@ -45,12 +45,12 @@ NotificationController::~NotificationController()
         m_client->notificationControllerDestroyed();
 }
 
-PassOwnPtr<NotificationController> NotificationController::create(Page* page, NotificationPresenter* client)
+PassOwnPtr<NotificationController> NotificationController::create(Page* page, NotificationClient* client)
 {
     return adoptPtr(new NotificationController(page, client));
 }
 
-NotificationPresenter* NotificationController::clientFrom(Page* page)
+NotificationClient* NotificationController::clientFrom(Page* page)
 {
     if (NotificationController* controller = NotificationController::from(page))
         return controller->client();
@@ -63,7 +63,7 @@ const AtomicString& NotificationController::supplementName()
     return name;
 }
 
-void provideNotification(Page* page, NotificationPresenter* client)
+void provideNotification(Page* page, NotificationClient* client)
 {
     NotificationController::provideTo(page, NotificationController::supplementName(), NotificationController::create(page, client));
 }
index a4e0ec5..7e9d597 100644 (file)
 
 namespace WebCore {
 
-class NotificationPresenter;
+class NotificationClient;
 
 class NotificationController : public Supplement<Page> {
     WTF_MAKE_NONCOPYABLE(NotificationController);
 public:
     ~NotificationController();
 
-    static PassOwnPtr<NotificationController> create(Page*, NotificationPresenter*);
+    static PassOwnPtr<NotificationController> create(Page*, NotificationClient*);
     static const AtomicString& supplementName();
     static NotificationController* from(Page* page) { return static_cast<NotificationController*>(Supplement<Page>::from(page, supplementName())); }
-    static NotificationPresenter* clientFrom(Page*);
+    static NotificationClient* clientFrom(Page*);
 
-    NotificationPresenter* client() { return m_client; }
+    NotificationClient* client() { return m_client; }
     
 private:
-    NotificationController(Page*, NotificationPresenter*);
+    NotificationController(Page*, NotificationClient*);
 
     Page* m_page;
-    NotificationPresenter* m_client;
+    NotificationClient* m_client;
 };
 
 } // namespace WebCore
index 5674343..eec969f 100644 (file)
@@ -716,7 +716,7 @@ NotificationCenter* DOMWindow::webkitNotifications() const
     if (!page)
         return 0;
 
-    NotificationPresenter* provider = NotificationController::clientFrom(page);
+    NotificationClient* provider = NotificationController::clientFrom(page);
     if (provider) 
         m_notifications = NotificationCenter::create(document, provider);    
       
index 816648f..cdfd322 100644 (file)
@@ -357,7 +357,7 @@ namespace WebCore {
 #if ENABLE(NOTIFICATIONS)
         NotificationCenter* webkitNotifications() const;
         // Renders webkitNotifications object safely inoperable, disconnects
-        // if from embedder-provided NotificationPresenter.
+        // if from embedder-provided NotificationClient.
         void resetNotifications();
 #endif
 
index f72f09f..debbeba 100644 (file)
@@ -298,7 +298,7 @@ void WorkerContext::addMessageToWorkerConsole(MessageSource source, MessageType
 NotificationCenter* WorkerContext::webkitNotifications() const
 {
     if (!m_notifications)
-        m_notifications = NotificationCenter::create(scriptExecutionContext(), m_thread->getNotificationPresenter());
+        m_notifications = NotificationCenter::create(scriptExecutionContext(), m_thread->getNotificationClient());
     return m_notifications.get();
 }
 #endif
index 19b9b61..d2e23a8 100644 (file)
@@ -97,7 +97,7 @@ WorkerThread::WorkerThread(const KURL& scriptURL, const String& userAgent, const
     , m_workerReportingProxy(workerReportingProxy)
     , m_startupData(WorkerThreadStartupData::create(scriptURL, userAgent, sourceCode, startMode, contentSecurityPolicy, contentSecurityPolicyType))
 #if ENABLE(NOTIFICATIONS)
-    , m_notificationPresenter(0)
+    , m_notificationClient(0)
 #endif
 {
     MutexLocker lock(threadCountMutex());
index e3a11df..cbe5a71 100644 (file)
@@ -39,7 +39,7 @@
 namespace WebCore {
 
     class KURL;
-    class NotificationPresenter;
+    class NotificationClient;
     class WorkerContext;
     class WorkerLoaderProxy;
     class WorkerReportingProxy;
@@ -63,8 +63,8 @@ namespace WebCore {
         static unsigned workerThreadCount();
 
 #if ENABLE(NOTIFICATIONS)
-        NotificationPresenter* getNotificationPresenter() { return m_notificationPresenter; }
-        void setNotificationPresenter(NotificationPresenter* presenter) { m_notificationPresenter = presenter; }
+        NotificationClient* getNotificationClient() { return m_notificationClient; }
+        void setNotificationClient(NotificationClient* client) { m_notificationClient = client; }
 #endif
 
     protected:
@@ -94,7 +94,7 @@ namespace WebCore {
         OwnPtr<WorkerThreadStartupData> m_startupData;
 
 #if ENABLE(NOTIFICATIONS)
-        NotificationPresenter* m_notificationPresenter;
+        NotificationClient* m_notificationClient;
 #endif
 
         // Track the number of WorkerThread instances for use in layout tests.
index b363ed3..28317d8 100644 (file)
@@ -1,3 +1,19 @@
+2012-03-09  Jon Lee  <jonlee@apple.com>
+
+        Rename NotificationPresenter to NotificationClient
+        https://bugs.webkit.org/show_bug.cgi?id=80488
+        <rdar://problem/10965558>
+
+        Reviewed by Kentaro Hara.
+
+        Refactor to use renamed WebCore::NotificationClient.
+        * WebCoreSupport/NotificationPresenterImpl.cpp:
+        (WebCore::NotificationPresenterImpl::instance):
+        (WebCore::NotificationPresenterImpl::show):
+        (WebCore::NotificationPresenterImpl::checkPermission):
+        * WebCoreSupport/NotificationPresenterImpl.h:
+        (NotificationPresenterImpl):
+
 2012-03-09  Charles Wei  <charles.wei@torchmobile.com.cn>
 
         [BlackBerry] Web Notification not working after rebase
index d01c87f..16c451e 100644 (file)
@@ -29,7 +29,7 @@
 
 namespace WebCore {
 
-NotificationPresenter* NotificationPresenterImpl::instance()
+NotificationClient* NotificationPresenterImpl::instance()
 {
     static NotificationPresenterImpl* s_instance = 0;
     if (!s_instance)
@@ -54,7 +54,7 @@ bool NotificationPresenterImpl::show(Notification* notification)
     if (m_notifications.contains(n))
         return false;
 
-    if (checkPermission(notification->scriptExecutionContext()) != NotificationPresenter::PermissionAllowed)
+    if (checkPermission(notification->scriptExecutionContext()) != NotificationClient::PermissionAllowed)
         return false;
 
     String uuid = createCanonicalUUIDString();
@@ -127,14 +127,14 @@ void NotificationPresenterImpl::cancelRequestsForPermission(ScriptExecutionConte
     // Because we are using modal dialogs to request permission, it's impossible to cancel them.
 }
 
-NotificationPresenter::Permission NotificationPresenterImpl::checkPermission(ScriptExecutionContext* context)
+NotificationClient::Permission NotificationPresenterImpl::checkPermission(ScriptExecutionContext* context)
 {
     ASSERT(context);
     // FIXME: Should store the permission information into file permanently instead of in m_allowedDomains.
     // The suggested place to do this is in m_platformPresenter->checkPermission().
     if (m_allowedDomains.contains(context->url().host()))
-        return NotificationPresenter::PermissionAllowed;
-    return NotificationPresenter::PermissionNotAllowed;
+        return NotificationClient::PermissionAllowed;
+    return NotificationClient::PermissionNotAllowed;
 }
 
 // This function is called in platform side.
index da84a5e..b708e00 100644 (file)
@@ -21,7 +21,7 @@
 
 #if ENABLE(NOTIFICATIONS)
 #include <NotificationAckListener.h>
-#include <NotificationPresenter.h>
+#include <NotificationClient.h>
 #include <NotificationPresenterBlackBerry.h>
 #include <string>
 #include <wtf/HashMap.h>
@@ -31,9 +31,9 @@
 
 namespace WebCore {
 
-class NotificationPresenterImpl : public WebCore::NotificationPresenter, public BlackBerry::Platform::NotificationAckListener {
+class NotificationPresenterImpl : public WebCore::NotificationClient, public BlackBerry::Platform::NotificationAckListener {
 public:
-    static NotificationPresenter* instance();
+    static NotificationClient* instance();
     virtual ~NotificationPresenterImpl();
 
     // Requests that a notification be shown.
index 0a023bf..275f1e1 100644 (file)
@@ -1,3 +1,18 @@
+2012-03-09  Jon Lee  <jonlee@apple.com>
+
+        Rename NotificationPresenter to NotificationClient
+        https://bugs.webkit.org/show_bug.cgi?id=80488
+        <rdar://problem/10965558>
+
+        Reviewed by Kentaro Hara.
+
+        Refactor to use renamed WebCore::NotificationClient.
+        * src/AssertMatchingEnums.cpp:
+        * src/NotificationPresenterImpl.cpp:
+        (WebKit::NotificationPresenterImpl::checkPermission):
+        * src/NotificationPresenterImpl.h:
+        (NotificationPresenterImpl):
+
 2012-03-10  Sheriff Bot  <webkit.review.bot@gmail.com>
 
         Unreviewed, rolling out r110363.
index 3f0875b..ac6fa04 100644 (file)
@@ -53,7 +53,7 @@
 #include "IconURL.h"
 #include "MediaPlayer.h"
 #include "MediaStreamSource.h"
-#include "NotificationPresenter.h"
+#include "NotificationClient.h"
 #include "PageVisibilityState.h"
 #include "PasteboardPrivate.h"
 #include "PlatformCursor.h"
@@ -394,9 +394,9 @@ COMPILE_ASSERT_MATCHING_ENUM(WebVideoFrame::FormatASCII, VideoFrameChromium::ASC
 #endif
 
 #if ENABLE(NOTIFICATIONS)
-COMPILE_ASSERT_MATCHING_ENUM(WebNotificationPresenter::PermissionAllowed, NotificationPresenter::PermissionAllowed);
-COMPILE_ASSERT_MATCHING_ENUM(WebNotificationPresenter::PermissionNotAllowed, NotificationPresenter::PermissionNotAllowed);
-COMPILE_ASSERT_MATCHING_ENUM(WebNotificationPresenter::PermissionDenied, NotificationPresenter::PermissionDenied);
+COMPILE_ASSERT_MATCHING_ENUM(WebNotificationPresenter::PermissionAllowed, NotificationClient::PermissionAllowed);
+COMPILE_ASSERT_MATCHING_ENUM(WebNotificationPresenter::PermissionNotAllowed, NotificationClient::PermissionNotAllowed);
+COMPILE_ASSERT_MATCHING_ENUM(WebNotificationPresenter::PermissionDenied, NotificationClient::PermissionDenied);
 #endif
 
 COMPILE_ASSERT_MATCHING_ENUM(WebScrollbar::Horizontal, HorizontalScrollbar);
index 4b68235..99a7ea3 100644 (file)
@@ -98,10 +98,10 @@ void NotificationPresenterImpl::notificationControllerDestroyed()
 {
 }
 
-NotificationPresenter::Permission NotificationPresenterImpl::checkPermission(ScriptExecutionContext* context)
+NotificationClient::Permission NotificationPresenterImpl::checkPermission(ScriptExecutionContext* context)
 {
     int result = m_presenter->checkPermission(WebSecurityOrigin(context->securityOrigin()));
-    return static_cast<NotificationPresenter::Permission>(result);
+    return static_cast<NotificationClient::Permission>(result);
 }
 
 void NotificationPresenterImpl::requestPermission(ScriptExecutionContext* context, PassRefPtr<VoidCallback> callback)
index 3eb5a87..cad5b88 100644 (file)
@@ -31,7 +31,7 @@
 #ifndef NotificationPresenterImpl_h
 #define NotificationPresenterImpl_h
 
-#include "NotificationPresenter.h"
+#include "NotificationClient.h"
 #include "VoidCallback.h"
 
 #include <wtf/HashMap.h>
@@ -43,7 +43,7 @@ namespace WebKit {
 
 class WebNotificationPresenter;
 
-class NotificationPresenterImpl : public WebCore::NotificationPresenter {
+class NotificationPresenterImpl : public WebCore::NotificationClient {
 public:
     NotificationPresenterImpl() : m_presenter(0) { }
 
@@ -55,7 +55,7 @@ public:
     virtual void cancel(WebCore::Notification* object);
     virtual void notificationObjectDestroyed(WebCore::Notification* object);
     virtual void notificationControllerDestroyed();
-    virtual WebCore::NotificationPresenter::Permission checkPermission(WebCore::ScriptExecutionContext*);
+    virtual WebCore::NotificationClient::Permission checkPermission(WebCore::ScriptExecutionContext*);
     virtual void requestPermission(WebCore::ScriptExecutionContext* , WTF::PassRefPtr<WebCore::VoidCallback> callback);
     virtual void cancelRequestsForPermission(WebCore::ScriptExecutionContext*) {}
 
index 944e378..09d0e77 100644 (file)
@@ -1,3 +1,17 @@
+2012-03-09  Jon Lee  <jonlee@apple.com>
+
+        Rename NotificationPresenter to NotificationClient
+        https://bugs.webkit.org/show_bug.cgi?id=80488
+        <rdar://problem/10965558>
+
+        Reviewed by Kentaro Hara.
+
+        Refactor to use renamed WebCore::NotificationClient.
+        * WebCoreSupport/ChromeClientEfl.cpp:
+        (WebCore::ChromeClientEfl::notificationPresenter):
+        * WebCoreSupport/ChromeClientEfl.h:
+        (ChromeClientEfl):
+
 2012-03-08  Hyowon Kim  <hw1008.kim@samsung.com>
 
         [Texmap][EFL] Implementation of AcceleratedCompositingContext for EFL port
index a25f9d0..a58a11b 100644 (file)
@@ -418,7 +418,7 @@ void ChromeClientEfl::exceededDatabaseQuota(Frame* frame, const String& database
 #endif
 
 #if ENABLE(NOTIFICATIONS)
-NotificationPresenter* ChromeClientEfl::notificationPresenter() const
+NotificationClient* ChromeClientEfl::notificationPresenter() const
 {
     notImplemented();
     return 0;
index 77db982..1526245 100644 (file)
@@ -29,7 +29,7 @@
 #include "PopupMenu.h"
 
 #if ENABLE(NOTIFICATIONS)
-#include "NotificationPresenter.h"
+#include "NotificationClient.h"
 #endif
 
 typedef struct _Evas_Object Evas_Object;
@@ -115,7 +115,7 @@ public:
 #endif
 
 #if ENABLE(NOTIFICATIONS)
-    virtual WebCore::NotificationPresenter* notificationPresenter() const;
+    virtual WebCore::NotificationClient* notificationPresenter() const;
 #endif
 
     virtual void reachedMaxAppCacheSize(int64_t spaceNeeded);
index ab7371e..7619d1f 100644 (file)
@@ -1,3 +1,17 @@
+2012-03-09  Jon Lee  <jonlee@apple.com>
+
+        Rename NotificationPresenter to NotificationClient
+        https://bugs.webkit.org/show_bug.cgi?id=80488
+        <rdar://problem/10965558>
+
+        Reviewed by Kentaro Hara.
+
+        Refactor to use renamed WebCore::NotificationClient.
+        * WebCoreSupport/WebNotificationClient.h:
+        * WebCoreSupport/WebNotificationClient.mm:
+        (WebNotificationClient::checkPermission):
+        * WebView/WebViewPrivate.h:
+
 2012-03-09  Enrica Casucci  <enrica@apple.com>
 
         Move WebNSURLExtras code down to WebCore.
index a40ce81..d68d922 100644 (file)
@@ -23,7 +23,7 @@
  * THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#import <WebCore/NotificationPresenter.h>
+#import <WebCore/NotificationClient.h>
 
 #if ENABLE(NOTIFICATIONS)
 #import <WebCore/Notification.h>
@@ -41,7 +41,7 @@ class VoidCallback;
 @class WebNotification;
 @class WebView;
 
-class WebNotificationClient : public WebCore::NotificationPresenter {
+class WebNotificationClient : public WebCore::NotificationClient {
 public:
     WebNotificationClient(WebView *);
     WebView *webView() { return m_webView; }
@@ -54,7 +54,7 @@ private:
     virtual void notificationControllerDestroyed() OVERRIDE;
     virtual void requestPermission(WebCore::ScriptExecutionContext*, PassRefPtr<WebCore::VoidCallback>) OVERRIDE;
     virtual void cancelRequestsForPermission(WebCore::ScriptExecutionContext*) OVERRIDE { }
-    virtual WebCore::NotificationPresenter::Permission checkPermission(WebCore::ScriptExecutionContext*) OVERRIDE;
+    virtual WebCore::NotificationClient::Permission checkPermission(WebCore::ScriptExecutionContext*) OVERRIDE;
 
     WebView *m_webView;
 #if ENABLE(NOTIFICATIONS)
index 2f7cd54..3fdf0bc 100644 (file)
@@ -171,29 +171,29 @@ void WebNotificationClient::requestPermission(ScriptExecutionContext* context, P
 #endif
 }
 
-NotificationPresenter::Permission WebNotificationClient::checkPermission(ScriptExecutionContext* context)
+NotificationClient::Permission WebNotificationClient::checkPermission(ScriptExecutionContext* context)
 {
 #if ENABLE(NOTIFICATIONS)
     if (!context || !context->isDocument())
-        return NotificationPresenter::PermissionDenied;
+        return NotificationClient::PermissionDenied;
     if (![[m_webView preferences] notificationsEnabled])
-        return NotificationPresenter::PermissionDenied;
+        return NotificationClient::PermissionDenied;
     WebSecurityOrigin *webOrigin = [[WebSecurityOrigin alloc] _initWithWebCoreSecurityOrigin:context->securityOrigin()];
     WebNotificationPermission permission = [[m_webView _notificationProvider] policyForOrigin:webOrigin];
     [webOrigin release];
     switch (permission) {
         case WebNotificationPermissionAllowed:
-            return NotificationPresenter::PermissionAllowed;
+            return NotificationClient::PermissionAllowed;
         case WebNotificationPermissionDenied:
-            return NotificationPresenter::PermissionDenied;
+            return NotificationClient::PermissionDenied;
         case WebNotificationPermissionNotAllowed:
-            return NotificationPresenter::PermissionNotAllowed;
+            return NotificationClient::PermissionNotAllowed;
         default:
-            return NotificationPresenter::PermissionNotAllowed;
+            return NotificationClient::PermissionNotAllowed;
     }
 #else
     UNUSED_PARAM(context);
-    return NotificationPresenter::PermissionDenied;
+    return NotificationClient::PermissionDenied;
 #endif
 }
 
index e0fee81..1b61821 100644 (file)
@@ -106,7 +106,7 @@ typedef enum {
     WebPaginationModeVertical,
 } WebPaginationMode;
 
-// This needs to be in sync with WebCore::NotificationPresenter::Permission
+// This needs to be in sync with WebCore::NotificationClient::Permission
 typedef enum {
     WebNotificationPermissionAllowed,
     WebNotificationPermissionNotAllowed,
index 113ee49..d9c4ee9 100644 (file)
@@ -1,3 +1,18 @@
+2012-03-09  Jon Lee  <jonlee@apple.com>
+
+        Rename NotificationPresenter to NotificationClient
+        https://bugs.webkit.org/show_bug.cgi?id=80488
+        <rdar://problem/10965558>
+
+        Reviewed by Kentaro Hara.
+
+        Refactor to use renamed WebCore::NotificationClient.
+        * WebCoreSupport/NotificationPresenterClientQt.cpp:
+        (WebCore::NotificationPresenterClientQt::checkPermission):
+        (WebCore::NotificationPresenterClientQt::allowNotificationForFrame):
+        * WebCoreSupport/NotificationPresenterClientQt.h:
+        (NotificationPresenterClientQt):
+
 2012-03-09  Emil A Eklund  <eae@chromium.org>
 
         Add roundedPoint to HitTestResult and change platform code to use it
index 8200664..0005218 100644 (file)
@@ -337,9 +337,9 @@ void NotificationPresenterClientQt::requestPermission(ScriptExecutionContext* co
     }
 }
 
-NotificationPresenter::Permission NotificationPresenterClientQt::checkPermission(ScriptExecutionContext* context)
+NotificationClient::Permission NotificationPresenterClientQt::checkPermission(ScriptExecutionContext* context)
 {
-    return m_cachedPermissions.value(context, NotificationPresenter::PermissionNotAllowed);
+    return m_cachedPermissions.value(context, NotificationClient::PermissionNotAllowed);
 }
 
 void NotificationPresenterClientQt::cancelRequestsForPermission(ScriptExecutionContext* context)
@@ -367,7 +367,7 @@ void NotificationPresenterClientQt::cancelRequestsForPermission(ScriptExecutionC
 
 void NotificationPresenterClientQt::allowNotificationForFrame(Frame* frame)
 {
-    m_cachedPermissions.insert(frame->document(), NotificationPresenter::PermissionAllowed);
+    m_cachedPermissions.insert(frame->document(), NotificationClient::PermissionAllowed);
 
     QHash<ScriptExecutionContext*,  CallbacksInfo>::iterator iter = m_pendingPermissionRequests.begin();
     while (iter != m_pendingPermissionRequests.end()) {
index 77dcd3b..12b06fe 100644 (file)
@@ -33,7 +33,7 @@
 #define NotificationPresenterClientQt_h
 
 #include "Notification.h"
-#include "NotificationPresenter.h"
+#include "NotificationClient.h"
 #include "QtPlatformPlugin.h"
 #include "Timer.h"
 
@@ -81,18 +81,18 @@ public:
 
 typedef QHash <Notification*, NotificationWrapper*> NotificationsQueue;
 
-class NotificationPresenterClientQt : public NotificationPresenter {
+class NotificationPresenterClientQt : public NotificationClient {
 public:
     NotificationPresenterClientQt();
     ~NotificationPresenterClientQt();
 
-    /* WebCore::NotificationPresenter interface */
+    /* WebCore::NotificationClient interface */
     virtual bool show(Notification*);
     virtual void cancel(Notification*);
     virtual void notificationObjectDestroyed(Notification*);
     virtual void notificationControllerDestroyed();
     virtual void requestPermission(ScriptExecutionContext*, PassRefPtr<VoidCallback>);
-    virtual NotificationPresenter::Permission checkPermission(ScriptExecutionContext*);
+    virtual NotificationClient::Permission checkPermission(ScriptExecutionContext*);
     virtual void cancelRequestsForPermission(ScriptExecutionContext*);
 
     void cancel(NotificationWrapper*);
@@ -125,7 +125,7 @@ private:
         QList<RefPtr<VoidCallback> > m_callbacks;
     };
     QHash<ScriptExecutionContext*,  CallbacksInfo > m_pendingPermissionRequests;
-    QHash<ScriptExecutionContext*, NotificationPresenter::Permission> m_cachedPermissions;
+    QHash<ScriptExecutionContext*, NotificationClient::Permission> m_cachedPermissions;
 
     NotificationsQueue m_notifications;
     QtPlatformPlugin m_platformPlugin;
index 9bc307e..795dca1 100644 (file)
@@ -1,3 +1,19 @@
+2012-03-09  Jon Lee  <jonlee@apple.com>
+
+        Rename NotificationPresenter to NotificationClient
+        https://bugs.webkit.org/show_bug.cgi?id=80488
+        <rdar://problem/10965558>
+
+        Reviewed by Kentaro Hara.
+
+        Refactor to use renamed WebCore::NotificationClient.
+        * WebCoreSupport/WebChromeClient.h:
+        (WebChromeClient::notificationPresenter):
+        * WebCoreSupport/WebDesktopNotificationsDelegate.cpp:
+        (WebDesktopNotificationsDelegate::checkPermission):
+        * WebCoreSupport/WebDesktopNotificationsDelegate.h:
+        (WebDesktopNotificationsDelegate):
+
 2012-03-09  Emil A Eklund  <eae@chromium.org>
 
         Add roundedPoint to HitTestResult and change platform code to use it
index 59c242d..478f5d5 100644 (file)
@@ -156,7 +156,7 @@ public:
 #endif
 
 #if ENABLE(NOTIFICATIONS)
-    virtual WebCore::NotificationPresenter* notificationPresenter() const { return reinterpret_cast<WebCore::NotificationPresenter*>(m_notificationsDelegate.get()); }
+    virtual WebCore::NotificationClient* notificationPresenter() const { return reinterpret_cast<WebCore::NotificationClient*>(m_notificationsDelegate.get()); }
 #endif
 
     virtual bool selectItemWritingDirectionIsNatural();
index b805906..70ed482 100644 (file)
@@ -180,13 +180,13 @@ void WebDesktopNotificationsDelegate::cancelRequestsForPermission(ScriptExecutio
 {
 }
 
-NotificationPresenter::Permission WebDesktopNotificationsDelegate::checkPermission(const KURL& url)
+NotificationClient::Permission WebDesktopNotificationsDelegate::checkPermission(const KURL& url)
 {
     int out = 0;
     BString org(SecurityOrigin::create(url)->toString());
     if (hasNotificationDelegate())
         notificationDelegate()->checkNotificationPermission(org, &out);
-    return (NotificationPresenter::Permission) out;
+    return (NotificationClient::Permission) out;
 }
 
 bool WebDesktopNotificationsDelegate::hasNotificationDelegate()
index f0441cf..a1a1185 100644 (file)
@@ -30,7 +30,7 @@
 
 #include <WebCore/COMPtr.h>
 #include <WebCore/Notification.h>
-#include <WebCore/NotificationPresenter.h>
+#include <WebCore/NotificationClient.h>
 
 #if ENABLE(NOTIFICATIONS)
 
@@ -41,18 +41,18 @@ class Document;
 class KURL;
 }
 
-class WebDesktopNotificationsDelegate : public WebCore::NotificationPresenter {
+class WebDesktopNotificationsDelegate : public WebCore::NotificationClient {
 public:
     WebDesktopNotificationsDelegate(WebView* view);
 
-    /* WebCore::NotificationPresenter interface */
+    /* WebCore::NotificationClient interface */
     virtual bool show(WebCore::Notification* object);
     virtual void cancel(WebCore::Notification* object);
     virtual void notificationObjectDestroyed(WebCore::Notification* object);
     virtual void notificationControllerDestroyed();
     virtual void requestPermission(WebCore::SecurityOrigin* origin, PassRefPtr<WebCore::VoidCallback> callback);
     virtual void cancelRequestsForPermission(WebCore::ScriptExecutionContext*);
-    virtual WebCore::NotificationPresenter::Permission checkPermission(const KURL& url);
+    virtual WebCore::NotificationClient::Permission checkPermission(const KURL&);
 
 private:
     bool hasNotificationDelegate();
index 9478cc5..5ca6d91 100644 (file)
@@ -1,3 +1,15 @@
+2012-03-09  Jon Lee  <jonlee@apple.com>
+
+        Rename NotificationPresenter to NotificationClient
+        https://bugs.webkit.org/show_bug.cgi?id=80488
+        <rdar://problem/10965558>
+
+        Reviewed by Kentaro Hara.
+
+        Refactor to use renamed WebCore::NotificationClient.
+        * WebCoreSupport/ChromeClientWinCE.h:
+        (ChromeClientWinCE):
+
 2012-02-26  Hajime Morrita  <morrita@chromium.org>
 
         Move ChromeClient::showContextMenu() to ContextMenuClient
index 64e2bda..4179202 100644 (file)
@@ -132,7 +132,7 @@ public:
     virtual void reachedApplicationCacheOriginQuota(WebCore::SecurityOrigin*, int64_t totalSpaceNeeded);
 
 #if ENABLE(NOTIFICATIONS)
-    virtual WebCore::NotificationPresenter* notificationPresenter() const;
+    virtual WebCore::NotificationClient* notificationPresenter() const;
 #endif
 
     // This can be either a synchronous or asynchronous call. The ChromeClient can display UI asking the user for permission
index 95ea3cd..41ba3bc 100644 (file)
@@ -1,3 +1,27 @@
+2012-03-09  Jon Lee  <jonlee@apple.com>
+
+        Rename NotificationPresenter to NotificationClient
+        https://bugs.webkit.org/show_bug.cgi?id=80488
+        <rdar://problem/10965558>
+
+        Reviewed by Kentaro Hara.
+
+        Refactor to use renamed WebCore::NotificationClient.
+        * UIProcess/Notifications/WebNotificationManagerProxy.h:
+        * WebProcess/Notifications/NotificationPermissionRequestManager.cpp:
+        (WebKit::NotificationPermissionRequestManager::startRequest):
+        (WebKit::NotificationPermissionRequestManager::permissionLevel):
+        * WebProcess/Notifications/NotificationPermissionRequestManager.h:
+        (NotificationPermissionRequestManager):
+        * WebProcess/Notifications/WebNotificationManager.cpp:
+        (WebKit::WebNotificationManager::policyForOrigin):
+        * WebProcess/Notifications/WebNotificationManager.h:
+        (WebNotificationManager):
+        * WebProcess/WebCoreSupport/WebNotificationClient.cpp:
+        (WebKit::WebNotificationClient::checkPermission):
+        * WebProcess/WebCoreSupport/WebNotificationClient.h:
+        (WebNotificationClient):
+
 2012-03-09  Viatcheslav Ostapenko  <ostapenko.viatcheslav@nokia.com>
 
         [Qt] [WK2] Shouldn't use item for clipping rect calculation in paint node.
index fdeeeb3..edfccc1 100644 (file)
@@ -29,7 +29,7 @@
 #include "APIObject.h"
 #include "MessageID.h"
 #include "WebNotificationProvider.h"
-#include <WebCore/NotificationPresenter.h>
+#include <WebCore/NotificationClient.h>
 #include <wtf/HashMap.h>
 #include <wtf/OwnPtr.h>
 #include <wtf/PassRefPtr.h>
index 1ddda7c..73e71fb 100644 (file)
@@ -62,7 +62,7 @@ NotificationPermissionRequestManager::NotificationPermissionRequestManager(WebPa
 void NotificationPermissionRequestManager::startRequest(SecurityOrigin* origin, PassRefPtr<VoidCallback> callback)
 {
 #if ENABLE(NOTIFICATIONS)
-    if (permissionLevel(origin) != NotificationPresenter::PermissionNotAllowed) {
+    if (permissionLevel(origin) != NotificationClient::PermissionNotAllowed) {
         callback->handleEvent();
         return;
     }
@@ -92,16 +92,16 @@ void NotificationPermissionRequestManager::cancelRequest(SecurityOrigin* origin)
 #endif
 }
 
-NotificationPresenter::Permission NotificationPermissionRequestManager::permissionLevel(SecurityOrigin* securityOrigin)
+NotificationClient::Permission NotificationPermissionRequestManager::permissionLevel(SecurityOrigin* securityOrigin)
 {
 #if ENABLE(NOTIFICATIONS)
     if (!m_page->corePage()->settings()->notificationsEnabled())
-        return NotificationPresenter::PermissionDenied;
+        return NotificationClient::PermissionDenied;
     
     return WebProcess::shared().notificationManager().policyForOrigin(securityOrigin);
 #else
     UNUSED_PARAM(securityOrigin);
-    return NotificationPresenter::PermissionDenied;
+    return NotificationClient::PermissionDenied;
 #endif
 }
 
index 5573c6a..0397879 100644 (file)
@@ -26,7 +26,7 @@
 #ifndef NotificationPermissionRequestManager_h
 #define NotificationPermissionRequestManager_h
 
-#include <WebCore/NotificationPresenter.h>
+#include <WebCore/NotificationClient.h>
 #include <WebCore/VoidCallback.h>
 #include <wtf/HashMap.h>
 #include <wtf/RefCounted.h>
@@ -50,7 +50,7 @@ public:
     void cancelRequest(WebCore::SecurityOrigin*);
     
     // Synchronous call to retrieve permission level for given security origin
-    WebCore::NotificationPresenter::Permission permissionLevel(WebCore::SecurityOrigin*);
+    WebCore::NotificationClient::Permission permissionLevel(WebCore::SecurityOrigin*);
     
     void didReceiveNotificationPermissionDecision(uint64_t notificationID, bool allowed);
     
index a249a13..9e5cf95 100644 (file)
@@ -90,18 +90,18 @@ void WebNotificationManager::didRemoveNotificationDecisions(const Vector<String>
 #endif
 }
 
-NotificationPresenter::Permission WebNotificationManager::policyForOrigin(WebCore::SecurityOrigin *origin) const
+NotificationClient::Permission WebNotificationManager::policyForOrigin(WebCore::SecurityOrigin *origin) const
 {
 #if ENABLE(NOTIFICATIONS)
     if (!origin)
-        return NotificationPresenter::PermissionNotAllowed;
+        return NotificationClient::PermissionNotAllowed;
     
     HashMap<String, bool>::const_iterator it = m_permissionsMap.find(origin->toString());
     if (it != m_permissionsMap.end())
-        return it->second ? NotificationPresenter::PermissionAllowed : NotificationPresenter::PermissionDenied;
+        return it->second ? NotificationClient::PermissionAllowed : NotificationClient::PermissionDenied;
 #endif
     
-    return NotificationPresenter::PermissionNotAllowed;
+    return NotificationClient::PermissionNotAllowed;
 }
 
 bool WebNotificationManager::show(Notification* notification, WebPage* page)
index 3b788be..142767e 100644 (file)
@@ -27,7 +27,7 @@
 #define WebNotificationManager_h
 
 #include "MessageID.h"
-#include <WebCore/NotificationPresenter.h>
+#include <WebCore/NotificationClient.h>
 #include <wtf/HashMap.h>
 #include <wtf/Noncopyable.h>
 #include <wtf/RefPtr.h>
@@ -66,7 +66,7 @@ public:
     void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
     
     // Looks in local cache for permission. If not found, returns DefaultDenied.
-    WebCore::NotificationPresenter::Permission policyForOrigin(WebCore::SecurityOrigin*) const;
+    WebCore::NotificationClient::Permission policyForOrigin(WebCore::SecurityOrigin*) const;
 
 private:
     // Implemented in generated WebNotificationManagerMessageReceiver.cpp
index 90eb161..6433124 100644 (file)
@@ -82,10 +82,10 @@ void WebNotificationClient::cancelRequestsForPermission(ScriptExecutionContext*
     m_page->notificationPermissionRequestManager()->cancelRequest(context->securityOrigin());
 }
 
-NotificationPresenter::Permission WebNotificationClient::checkPermission(ScriptExecutionContext* context)
+NotificationClient::Permission WebNotificationClient::checkPermission(ScriptExecutionContext* context)
 {
     if (!context || !context->isDocument())
-        return NotificationPresenter::PermissionDenied;
+        return NotificationClient::PermissionDenied;
     return m_page->notificationPermissionRequestManager()->permissionLevel(context->securityOrigin());
 }
 
index 147a88a..8a84bea 100644 (file)
@@ -28,7 +28,7 @@
 
 #if ENABLE(NOTIFICATIONS)
 
-#include <WebCore/NotificationPresenter.h>
+#include <WebCore/NotificationClient.h>
 
 namespace WebCore {
 class ScriptExecutionContext;
@@ -39,7 +39,7 @@ namespace WebKit {
 
 class WebPage;
 
-class WebNotificationClient : public WebCore::NotificationPresenter {
+class WebNotificationClient : public WebCore::NotificationClient {
 public:
     WebNotificationClient(WebPage*);
     virtual ~WebNotificationClient();
@@ -52,7 +52,7 @@ private:
     virtual void notificationControllerDestroyed() OVERRIDE;
     virtual void requestPermission(WebCore::ScriptExecutionContext*, PassRefPtr<WebCore::VoidCallback>) OVERRIDE;
     virtual void cancelRequestsForPermission(WebCore::ScriptExecutionContext*) OVERRIDE;
-    virtual NotificationPresenter::Permission checkPermission(WebCore::ScriptExecutionContext*) OVERRIDE;
+    virtual NotificationClient::Permission checkPermission(WebCore::ScriptExecutionContext*) OVERRIDE;
     
     WebPage* m_page;
 };
index a6ea133..6df1bd2 100644 (file)
@@ -1,3 +1,15 @@
+2012-03-09  Jon Lee  <jonlee@apple.com>
+
+        Rename NotificationPresenter to NotificationClient
+        https://bugs.webkit.org/show_bug.cgi?id=80488
+        <rdar://problem/10965558>
+
+        Reviewed by Kentaro Hara.
+
+        Refactor to use renamed WebCore::NotificationClient.
+        * DumpRenderTree/win/DRTDesktopNotificationPresenter.cpp:
+        (DRTDesktopNotificationPresenter::checkNotificationPermission):
+
 2012-03-07  James Robinson  <jamesr@chromium.org>
 
         [chromium] Deprecate renderDirectlyToWebView parameter of WebViewClient::createGraphicsContext3D()
index 1bc4678..3bc166d 100644 (file)
@@ -35,7 +35,7 @@
 #include "LayoutTestController.h"
 #include <JavaScriptCore/JSStringRef.h>
 #include <JavaScriptCore/JSStringRefBSTR.h>
-#include <WebCore/NotificationPresenter.h>
+#include <WebCore/NotificationClient.h>
 
 DRTDesktopNotificationPresenter::DRTDesktopNotificationPresenter()
     : m_refCount(1) {} 
@@ -128,9 +128,9 @@ HRESULT STDMETHODCALLTYPE DRTDesktopNotificationPresenter::checkNotificationPerm
     bool allowed = ::gLayoutTestController->checkDesktopNotificationPermission(jsOrigin);
 
     if (allowed)
-        *result = WebCore::NotificationPresenter::PermissionAllowed;
+        *result = WebCore::NotificationClient::PermissionAllowed;
     else
-        *result = WebCore::NotificationPresenter::PermissionDenied;
+        *result = WebCore::NotificationClient::PermissionDenied;
 
     JSStringRelease(jsOrigin);
 #endif