https://bugs.webkit.org/show_bug.cgi?id=79052
Patch by Hajime Morrita <morrita@chromium.org> on 2012-02-22
Reviewed by Adam Barth.
Source/WebCore:
Turned NotificationController to a PageSupplement.
No new tests. No behavior change.
* notifications/NotificationController.cpp:
(WebCore::NotificationController::clientFrom):
(WebCore):
(WebCore::NotificationController::supplementName):
(WebCore::provideNotification):
* notifications/NotificationController.h:
(NotificationController):
(WebCore::NotificationController::from):
* notifications/NotificationPresenter.h:
(WebCore):
* page/DOMWindow.cpp:
(WebCore::DOMWindow::webkitNotifications):
* page/Page.cpp:
(WebCore::Page::Page):
(WebCore::Page::PageClients::PageClients):
* page/Page.h:
(WebCore):
(PageClients):
(Page):
Source/WebKit/chromium:
* src/WebViewImpl.cpp:
(WebKit::WebViewImpl::WebViewImpl):
Source/WebKit/mac:
* WebView/WebView.mm:
(-[WebView _commonInitializationWithFrameName:groupName:]):
Source/WebKit/qt:
* Api/qwebpage.cpp:
(QWebPagePrivate::QWebPagePrivate):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@108615
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2012-02-22 Hajime Morrita <morrita@chromium.org>
+
+ NOTIFICATIONS should be implemented as PageSupplement
+ https://bugs.webkit.org/show_bug.cgi?id=79052
+
+ Reviewed by Adam Barth.
+
+ Turned NotificationController to a PageSupplement.
+
+ No new tests. No behavior change.
+
+ * notifications/NotificationController.cpp:
+ (WebCore::NotificationController::clientFrom):
+ (WebCore):
+ (WebCore::NotificationController::supplementName):
+ (WebCore::provideNotification):
+ * notifications/NotificationController.h:
+ (NotificationController):
+ (WebCore::NotificationController::from):
+ * notifications/NotificationPresenter.h:
+ (WebCore):
+ * page/DOMWindow.cpp:
+ (WebCore::DOMWindow::webkitNotifications):
+ * page/Page.cpp:
+ (WebCore::Page::Page):
+ (WebCore::Page::PageClients::PageClients):
+ * page/Page.h:
+ (WebCore):
+ (PageClients):
+ (Page):
+
2012-02-22 Dmitry Lomov <dslomov@google.com>
[Chromium][V8] Support Uint8ClampedArray in postMessage
return adoptPtr(new NotificationController(page, client));
}
+NotificationPresenter* NotificationController::clientFrom(Page* page)
+{
+ if (NotificationController* controller = NotificationController::from(page))
+ return controller->client();
+ return 0;
+}
+
+const AtomicString& NotificationController::supplementName()
+{
+ DEFINE_STATIC_LOCAL(AtomicString, name, ("NotificationController"));
+ return name;
+}
+
+void provideNotification(Page* page, NotificationPresenter* client)
+{
+ PageSupplement::provideTo(page, NotificationController::supplementName(), NotificationController::create(page, client));
+}
+
} // namespace WebCore
#endif // ENABLE(NOTIFICATIONS)
#if ENABLE(NOTIFICATIONS)
+#include "PageSupplement.h"
#include <wtf/Forward.h>
#include <wtf/Noncopyable.h>
class NotificationPresenter;
class Page;
-class NotificationController {
+class NotificationController : public PageSupplement {
WTF_MAKE_NONCOPYABLE(NotificationController);
public:
~NotificationController();
static PassOwnPtr<NotificationController> create(Page*, NotificationPresenter*);
+ static const AtomicString& supplementName();
+ static NotificationController* from(Frame* frame) { return static_cast<NotificationController*>(PageSupplement::from(frame, supplementName())); }
+ static NotificationController* from(Page* page) { return static_cast<NotificationController*>(PageSupplement::from(page, supplementName())); }
+ static NotificationPresenter* clientFrom(Page*);
NotificationPresenter* client() { return m_client; }
class Document;
class Notification;
class KURL;
+class Page;
class ScriptExecutionContext;
class NotificationPresenter {
virtual ~NotificationPresenter() { }
};
+void provideNotification(Page*, NotificationPresenter*);
+
} // namespace WebCore
#endif // NotificationPresenter_h
if (!page)
return 0;
- NotificationPresenter* provider = page->notificationController()->client();
+ NotificationPresenter* provider = NotificationController::clientFrom(page);
if (provider)
m_notifications = NotificationCenter::create(document, provider);
#include "MediaCanStartListener.h"
#include "Navigator.h"
#include "NetworkStateNotifier.h"
-#include "NotificationController.h"
-#include "NotificationPresenter.h"
#include "PageGroup.h"
#include "PluginData.h"
#include "PluginView.h"
#include "StorageArea.h"
#include "StorageNamespace.h"
#include "TextResourceDecoder.h"
+#include "VoidCallback.h"
#include "Widget.h"
#include <wtf/HashMap.h>
#include <wtf/RefCountedLeakCounter.h>
#if ENABLE(CLIENT_BASED_GEOLOCATION)
, m_geolocationController(GeolocationController::create(this, pageClients.geolocationClient))
#endif
-#if ENABLE(NOTIFICATIONS)
- , m_notificationController(NotificationController::create(this, pageClients.notificationClient))
-#endif
#if ENABLE(POINTER_LOCK)
, m_pointerLockController(PointerLockController::create(this))
#endif
, dragClient(0)
, inspectorClient(0)
, geolocationClient(0)
- , notificationClient(0)
{
}
class InspectorController;
class MediaCanStartListener;
class Node;
- class NotificationController;
- class NotificationPresenter;
class PageGroup;
class PluginData;
class PointerLockController;
class ScrollingCoordinator;
class Settings;
class StorageNamespace;
-#if ENABLE(NOTIFICATIONS)
- class NotificationPresenter;
-#endif
typedef uint64_t LinkHash;
InspectorClient* inspectorClient;
GeolocationClient* geolocationClient;
RefPtr<BackForwardList> backForwardClient;
- NotificationPresenter* notificationClient;
};
Page(PageClients&);
#if ENABLE(CLIENT_BASED_GEOLOCATION)
GeolocationController* geolocationController() const { return m_geolocationController.get(); }
#endif
-#if ENABLE(NOTIFICATIONS)
- NotificationController* notificationController() const { return m_notificationController.get(); }
-#endif
#if ENABLE(POINTER_LOCK)
PointerLockController* pointerLockController() const { return m_pointerLockController.get(); }
#endif
#if ENABLE(CLIENT_BASED_GEOLOCATION)
OwnPtr<GeolocationController> m_geolocationController;
#endif
-#if ENABLE(NOTIFICATIONS)
- OwnPtr<NotificationController> m_notificationController;
-#endif
#if ENABLE(POINTER_LOCK)
OwnPtr<PointerLockController> m_pointerLockController;
#endif
RefPtr<StorageNamespace> m_sessionStorage;
-#if ENABLE(NOTIFICATIONS)
- NotificationPresenter* m_notificationPresenter;
-#endif
-
ViewMode m_viewMode;
double m_minimumTimerInterval;
+2012-02-22 Hajime Morrita <morrita@chromium.org>
+
+ NOTIFICATIONS should be implemented as PageSupplement
+ https://bugs.webkit.org/show_bug.cgi?id=79052
+
+ Reviewed by Adam Barth.
+
+ * src/WebViewImpl.cpp:
+ (WebKit::WebViewImpl::WebViewImpl):
+
2012-02-22 Dana Jansens <danakj@chromium.org>
[chromium] Add unit test for surface occlusion
pageClients.dragClient = &m_dragClientImpl;
pageClients.inspectorClient = &m_inspectorClientImpl;
pageClients.geolocationClient = m_geolocationClientProxy.get();
-#if ENABLE(NOTIFICATIONS)
- pageClients.notificationClient = notificationPresenterImpl();
-#endif
pageClients.backForwardClient = BackForwardListChromium::create(this);
m_page = adoptPtr(new Page(pageClients));
#if ENABLE(INPUT_SPEECH)
provideSpeechInputTo(m_page.get(), m_speechInputClient.get());
#endif
+#if ENABLE(NOTIFICATIONS)
+ provideNotification(m_page.get(), notificationPresenterImpl());
+#endif
provideDeviceOrientationTo(m_page.get(), m_deviceOrientationClientProxy.get());
m_geolocationClientProxy->setController(m_page->geolocationController());
+2012-02-22 Hajime Morrita <morrita@chromium.org>
+
+ NOTIFICATIONS should be implemented as PageSupplement
+ https://bugs.webkit.org/show_bug.cgi?id=79052
+
+ Reviewed by Adam Barth.
+
+ * WebView/WebView.mm:
+ (-[WebView _commonInitializationWithFrameName:groupName:]):
+
2012-02-21 Ryosuke Niwa <rniwa@webkit.org>
Remove the remaining uses of CSSStyleDeclaration in Editor
#if ENABLE(CLIENT_BASED_GEOLOCATION)
pageClients.geolocationClient = new WebGeolocationClient(self);
#endif
+ _private->page = new Page(pageClients);
#if ENABLE(NOTIFICATIONS)
- pageClients.notificationClient = new WebNotificationClient(self);
+ WebCore::provideNotification(_private->page, new WebNotificationClient(self));
#endif
- _private->page = new Page(pageClients);
#if ENABLE(DEVICE_ORIENTATION)
WebCore::provideDeviceOrientationTo(_private->page, new WebDeviceOrientationClient(self));
#endif
else
pageClients.geolocationClient = new GeolocationClientQt(q);
#endif
-#if ENABLE(NOTIFICATIONS)
- pageClients.notificationClient = NotificationPresenterClientQt::notificationPresenter();
-#endif
page = new Page(pageClients);
#if ENABLE(DEVICE_ORIENTATION)
if (useMock)
WebCore::provideDeviceOrientationTo(page, new DeviceOrientationClientQt);
WebCore::provideDeviceMotionTo(page, new DeviceMotionClientQt);
#endif
+#if ENABLE(NOTIFICATIONS)
+ WebCore::provideNotification(page, NotificationPresenterClientQt::notificationPresenter());
+#endif
// By default each page is put into their own unique page group, which affects popup windows
// and visited links. Page groups (per process only) is a feature making it possible to use
+2012-02-22 Hajime Morrita <morrita@chromium.org>
+
+ NOTIFICATIONS should be implemented as PageSupplement
+ https://bugs.webkit.org/show_bug.cgi?id=79052
+
+ Reviewed by Adam Barth.
+
+ * Api/qwebpage.cpp:
+ (QWebPagePrivate::QWebPagePrivate):
+
2012-02-21 Ryosuke Niwa <rniwa@webkit.org>
Remove the remaining uses of CSSStyleDeclaration in Editor