diff options
author | Allan Sandfeld Jensen <allan.jensen@digia.com> | 2013-09-13 12:51:20 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-09-19 20:50:05 +0200 |
commit | d441d6f39bb846989d95bcf5caf387b42414718d (patch) | |
tree | e367e64a75991c554930278175d403c072de6bb8 /Source/WebKit2/WebProcess/Notifications/WebNotificationManager.cpp | |
parent | 0060b2994c07842f4c59de64b5e3e430525c4b90 (diff) | |
download | qtwebkit-d441d6f39bb846989d95bcf5caf387b42414718d.tar.gz |
Import Qt5x2 branch of QtWebkit for Qt 5.2
Importing a new snapshot of webkit.
Change-Id: I2d01ad12cdc8af8cb015387641120a9d7ea5f10c
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@digia.com>
Diffstat (limited to 'Source/WebKit2/WebProcess/Notifications/WebNotificationManager.cpp')
-rw-r--r-- | Source/WebKit2/WebProcess/Notifications/WebNotificationManager.cpp | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/Source/WebKit2/WebProcess/Notifications/WebNotificationManager.cpp b/Source/WebKit2/WebProcess/Notifications/WebNotificationManager.cpp index 35070e144..6423ff64a 100644 --- a/Source/WebKit2/WebProcess/Notifications/WebNotificationManager.cpp +++ b/Source/WebKit2/WebProcess/Notifications/WebNotificationManager.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011, 2012 Apple Inc. All rights reserved. + * Copyright (C) 2011, 2012, 2013 Apple Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -28,11 +28,11 @@ #include "WebPage.h" #include "WebProcess.h" +#include "WebProcessCreationParameters.h" #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) #include "WebNotification.h" #include "WebNotificationManagerMessages.h" -#include "WebNotificationManagerProxyMessages.h" #include "WebPageProxyMessages.h" #include <WebCore/Document.h> #include <WebCore/Notification.h> @@ -55,6 +55,11 @@ static uint64_t generateNotificationID() } #endif +const char* WebNotificationManager::supplementName() +{ + return "WebNotificationManager"; +} + WebNotificationManager::WebNotificationManager(WebProcess* process) : m_process(process) { @@ -67,17 +72,12 @@ WebNotificationManager::~WebNotificationManager() { } -void WebNotificationManager::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::MessageDecoder& decoder) -{ - didReceiveWebNotificationManagerMessage(connection, messageID, decoder); -} - -void WebNotificationManager::initialize(const HashMap<String, bool>& permissions) +void WebNotificationManager::initialize(const WebProcessCreationParameters& parameters) { #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) - m_permissionsMap = permissions; + m_permissionsMap = parameters.notificationPermissions; #else - UNUSED_PARAM(permissions); + UNUSED_PARAM(parameters); #endif } @@ -152,9 +152,9 @@ bool WebNotificationManager::show(Notification* notification, WebPage* page) it->value.append(notificationID); #if ENABLE(NOTIFICATIONS) - m_process->connection()->send(Messages::WebPageProxy::ShowNotification(notification->title(), notification->body(), notification->iconURL().string(), notification->tag(), notification->lang(), notification->dir(), notification->scriptExecutionContext()->securityOrigin()->toString(), notificationID), page->pageID()); + m_process->parentProcessConnection()->send(Messages::WebPageProxy::ShowNotification(notification->title(), notification->body(), notification->iconURL().string(), notification->tag(), notification->lang(), notification->dir(), notification->scriptExecutionContext()->securityOrigin()->toString(), notificationID), page->pageID()); #else - m_process->connection()->send(Messages::WebPageProxy::ShowNotification(notification->title(), notification->body(), notification->iconURL().string(), notification->replaceId(), notification->lang(), notification->dir(), notification->scriptExecutionContext()->securityOrigin()->toString(), notificationID), page->pageID()); + m_process->parentProcessConnection()->send(Messages::WebPageProxy::ShowNotification(notification->title(), notification->body(), notification->iconURL().string(), notification->replaceId(), notification->lang(), notification->dir(), notification->scriptExecutionContext()->securityOrigin()->toString(), notificationID), page->pageID()); #endif return true; #else @@ -174,7 +174,7 @@ void WebNotificationManager::cancel(Notification* notification, WebPage* page) if (!notificationID) return; - m_process->connection()->send(Messages::WebNotificationManagerProxy::Cancel(notificationID), 0); + m_process->parentProcessConnection()->send(Messages::WebPageProxy::CancelNotification(notificationID), page->pageID()); #else UNUSED_PARAM(notification); UNUSED_PARAM(page); @@ -187,9 +187,9 @@ void WebNotificationManager::clearNotifications(WebCore::ScriptExecutionContext* NotificationContextMap::iterator it = m_notificationContextMap.find(context); if (it == m_notificationContextMap.end()) return; - + Vector<uint64_t>& notificationIDs = it->value; - m_process->connection()->send(Messages::WebNotificationManagerProxy::ClearNotifications(notificationIDs), 0); + m_process->parentProcessConnection()->send(Messages::WebPageProxy::ClearNotifications(notificationIDs), page->pageID()); size_t count = notificationIDs.size(); for (size_t i = 0; i < count; ++i) { RefPtr<Notification> notification = m_notificationIDMap.take(notificationIDs[i]); @@ -215,7 +215,7 @@ void WebNotificationManager::didDestroyNotification(Notification* notification, m_notificationIDMap.remove(notificationID); removeNotificationFromContextMap(notificationID, notification); - m_process->connection()->send(Messages::WebNotificationManagerProxy::DidDestroyNotification(notificationID), 0); + m_process->parentProcessConnection()->send(Messages::WebPageProxy::DidDestroyNotification(notificationID), page->pageID()); #else UNUSED_PARAM(notification); UNUSED_PARAM(page); |