https://bugs.webkit.org/show_bug.cgi?id=78783
<rdar://problem/
10610578>
Reviewed by Anders Carlsson.
* WebCore.exp.in: Expose dispatchErrorEvent on Notification.
Source/WebKit: Bring notifications support to WK1 mac: showing, canceling, removing notifications
https://bugs.webkit.org/show_bug.cgi?id=78783
<rdar://problem/
10610578>
Reviewed by Anders Carlsson.
* WebKit.xcodeproj/project.pbxproj: Added new files.
Source/WebKit/mac: Bring notifications support to WK1 mac: permission requests
https://bugs.webkit.org/show_bug.cgi?id=78783
<rdar://problem/
10610578>
Reviewed by Anders Carlsson.
* WebCoreSupport/WebNotificationClient.h:
* WebCoreSupport/WebNotificationClient.mm: Create policy listener, which conforms to the
WebAllowDenyPolicyListener protocol, similar to geolocation.
(WebNotificationClient::requestPermission):
(WebNotificationClient::checkPermission):
(-[WebNotificationPolicyListener initWithCallback:]):
(-[WebNotificationPolicyListener allow]): Call the callback.
(-[WebNotificationPolicyListener deny]): Call the callback.
* WebView/WebUIDelegatePrivate.h: Define new UI delegate method to ask the user to decide a
policy for navigations.
====
Bring notifications support to WK1 mac: showing, canceling, removing notifications
Create a WebKit wrapper object for WebCore::Notification, which also keeps track of an assigned
ID.
* WebView/WebNotification.h: Added.
(WebSecurityOrigin):
* WebView/WebNotification.mm: Added.
(core):
(-[WebNotification initWithCoreNotification:notificationID:]):
(-[WebNotification init]):
(-[WebNotification dealloc]):
(-[WebNotification title]):
(-[WebNotification body]):
(-[WebNotification origin]):
(-[WebNotification notificationID]):
(-[WebNotification dispatchShowEvent]):
(-[WebNotification dispatchCloseEvent]):
(-[WebNotification dispatchClickEvent]):
(-[WebNotification dispatchErrorEvent]):
* WebView/WebNotificationInternal.h: Added.
(WebCore): Internal category to allow creating instances with WebCore objects.
Extend WebView to include a WebNotificationProvider, which clients implement.
* WebView/WebViewData.h: Add a private member for the provider.
* WebView/WebViewPrivate.h:
* Define an enum WebNotificationPermission that mirrors WebCore::NotificationPresenter::Permission
that client which implement the provider can use to return policy decisions.
* Define WebNotificationProvider.
* Category WebViewNotification extends WebView with methods that set and manager the
notification provider, and handle events from the platform notifications.
* WebView/WebView.mm:
(-[WebView _setNotificationProvider:]): Sets the provider when initializing the WebView.
(-[WebView _notificationControllerDestroyed]):
(-[WebView _notificationProvider]):
(-[WebView _notificationDidShow:]):
(-[WebView _notificationDidClick:]):
(-[WebView _notificationsDidClose:]):
* WebCoreSupport/WebNotificationClient.h: Add variables that map between WebCore::Notification
instances, their assigned IDs, their contexts, and corresponding WebKit wrapper objects.
* WebCoreSupport/WebNotificationClient.mm:
(generateNotificationID): Created unique IDs for each shown notification.
(WebNotificationClient::show): Create wrapper object for notification, assign ID, cache the
mappings between the objects, and forward it to the provider.
(WebNotificationClient::cancel):
(WebNotificationClient::clearNotifications): Clear all notifications associated with the
provided context.
(WebNotificationClient::notificationObjectDestroyed): Remove the notification from the maps.
(WebNotificationClient::notificationControllerDestroyed): If the controller is destroyed, tell
the provider to clear of the notifications related to this web view.
====
(Prep work for) Bring notifications support to WK1 mac
Rename WebGeolocationPolicyListener. The interface is generic enough to be reused for
notification requests. To avoid having to create a new listener type, instead rename it
to WebAllowDenyPolicyListener.
* WebView/WebUIDelegatePrivate.h: Rename the protocol.
* WebCoreSupport/WebGeolocationClient.mm: Refactor geolocation request listener to use
new name.
Add preference to keep track of whether notifications are enabled in general.
* WebView/WebPreferenceKeysPrivate.h: Add WebNotificationsEnabledKey for storing the
preference.
* WebView/WebPreferences.mm:
(+[WebPreferences initialize]): By default have them enabled.
(-[WebPreferences setNotificationsEnabled:]):
(-[WebPreferences notificationsEnabled]):
* WebView/WebPreferencesPrivate.h:
Add a stringValue method that exposes WebCore::SecurityOrigin::toString() for storing the
notification policy for a given origin.
* WebCoreSupport/WebSecurityOrigin.mm:
(-[WebSecurityOrigin stringValue]):
* WebCoreSupport/WebSecurityOriginPrivate.h:
Tools: Bring notifications support to WK1 mac
https://bugs.webkit.org/show_bug.cgi?id=78783
<rdar://problem/
10610578>
Reviewed by Anders Carlsson.
* DumpRenderTree/mac/UIDelegate.mm: Refactor WebGeolocationPolicyListener to WebAllowDenyPolicyListener.
(-[UIDelegate webView:decidePolicyForGeolocationRequestFromOrigin:frame:listener:]):
(-[UIDelegate timerFired]):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@108409
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2012-02-21 Jon Lee <jonlee@apple.com>
+
+ Bring notifications support to WK1 mac
+ https://bugs.webkit.org/show_bug.cgi?id=78783
+ <rdar://problem/10610578>
+
+ Reviewed by Anders Carlsson.
+
+ * WebCore.exp.in: Expose dispatchErrorEvent on Notification.
+
2012-02-21 No'am Rosenthal <noam.rosenthal@nokia.com>
[Qt] Previous web page appears outside content rect
__ZN7WebCore12Notification17dispatchShowEventEv
__ZN7WebCore12Notification18dispatchClickEventEv
__ZN7WebCore12Notification18dispatchCloseEventEv
+__ZN7WebCore12Notification18dispatchErrorEventEv
#endif
#if ENABLE(THREADED_SCROLLING)
+2012-02-21 Jon Lee <jonlee@apple.com>
+
+ Bring notifications support to WK1 mac: showing, canceling, removing notifications
+ https://bugs.webkit.org/show_bug.cgi?id=78783
+ <rdar://problem/10610578>
+
+ Reviewed by Anders Carlsson.
+
+ * WebKit.xcodeproj/project.pbxproj: Added new files.
+
2012-02-21 Adam Roben <aroben@apple.com>
Roll out r108309, r108323, and r108326
226E9E6B09D0AA8200F3A2BC /* WebNetscapeDeprecatedFunctions.c in Sources */ = {isa = PBXBuildFile; fileRef = 226E9E6909D0AA8200F3A2BC /* WebNetscapeDeprecatedFunctions.c */; settings = {COMPILER_FLAGS = "-Wno-deprecated-declarations"; }; };
22F219CC08D236730030E078 /* WebBackForwardListPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 22F219CB08D236730030E078 /* WebBackForwardListPrivate.h */; settings = {ATTRIBUTES = (Private, ); }; };
29AEF960134C76FB00FE5096 /* OutlookQuirksUserScript.js in Resources */ = {isa = PBXBuildFile; fileRef = 29AEF95D134C755400FE5096 /* OutlookQuirksUserScript.js */; };
+ 312E2FE514E48182007CCA18 /* WebNotification.h in Headers */ = {isa = PBXBuildFile; fileRef = 312E2FE314E48182007CCA18 /* WebNotification.h */; settings = {ATTRIBUTES = (Private, ); }; };
+ 312E2FE614E48182007CCA18 /* WebNotification.mm in Sources */ = {isa = PBXBuildFile; fileRef = 312E2FE414E48182007CCA18 /* WebNotification.mm */; };
+ 312E2FE914E48215007CCA18 /* WebNotificationInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 312E2FE814E48215007CCA18 /* WebNotificationInternal.h */; };
31C11A6E1476552E0049A4CC /* WebNotificationClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 31C11A6C1476552E0049A4CC /* WebNotificationClient.h */; };
31C11A6F1476552E0049A4CC /* WebNotificationClient.mm in Sources */ = {isa = PBXBuildFile; fileRef = 31C11A6D1476552E0049A4CC /* WebNotificationClient.mm */; };
37B6FB4E1063530C000FDB3B /* WebPDFDocumentExtras.h in Headers */ = {isa = PBXBuildFile; fileRef = 37B6FB4C1063530C000FDB3B /* WebPDFDocumentExtras.h */; };
2D36FD5E03F78F9E00A80166 /* WebFormDelegatePrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebFormDelegatePrivate.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
2D81DAB203EB0B2D00A80166 /* WebFormDelegate.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebFormDelegate.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
2D81DAB303EB0B2D00A80166 /* WebFormDelegate.m */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.objc; path = WebFormDelegate.m; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
+ 312E2FE314E48182007CCA18 /* WebNotification.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebNotification.h; sourceTree = "<group>"; };
+ 312E2FE414E48182007CCA18 /* WebNotification.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebNotification.mm; sourceTree = "<group>"; };
+ 312E2FE814E48215007CCA18 /* WebNotificationInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebNotificationInternal.h; sourceTree = "<group>"; };
31C11A6C1476552E0049A4CC /* WebNotificationClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebNotificationClient.h; sourceTree = "<group>"; };
31C11A6D1476552E0049A4CC /* WebNotificationClient.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebNotificationClient.mm; sourceTree = "<group>"; };
35081D9202B6D4D80ACA2ACA /* WebHTMLRepresentation.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.h; fileEncoding = 4; indentWidth = 4; path = WebHTMLRepresentation.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
F834AAD60E64B1C700E2737C /* WebTextIterator.mm */,
515E27CC0458C86500CA2D3A /* WebUIDelegate.h */,
65A7D44A0568AB2600E70EF6 /* WebUIDelegatePrivate.h */,
+ 312E2FE314E48182007CCA18 /* WebNotification.h */,
+ 312E2FE414E48182007CCA18 /* WebNotification.mm */,
+ 312E2FE814E48215007CCA18 /* WebNotificationInternal.h */,
51A8B579042834F700CA2D3A /* WebView.h */,
51A8B57A042834F700CA2D3A /* WebView.mm */,
BC2E464B0FD8A96800A9D9DE /* WebViewData.h */,
9398109B0824BF01008DF038 /* WebViewInternal.h in Headers */,
939810710824BF01008DF038 /* WebViewPrivate.h in Headers */,
41F4484F10338E8C0030E55E /* WebWorkersPrivate.h in Headers */,
+ 312E2FE514E48182007CCA18 /* WebNotification.h in Headers */,
+ 312E2FE914E48215007CCA18 /* WebNotificationInternal.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
939811070824BF01008DF038 /* WebView.mm in Sources */,
BC2E464E0FD8A96800A9D9DE /* WebViewData.mm in Sources */,
41F4485010338E8C0030E55E /* WebWorkersPrivate.mm in Sources */,
+ 312E2FE614E48182007CCA18 /* WebNotification.mm in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
+2012-02-21 Jon Lee <jonlee@apple.com>
+
+ Bring notifications support to WK1 mac: permission requests
+ https://bugs.webkit.org/show_bug.cgi?id=78783
+ <rdar://problem/10610578>
+
+ Reviewed by Anders Carlsson.
+
+ * WebCoreSupport/WebNotificationClient.h:
+ * WebCoreSupport/WebNotificationClient.mm: Create policy listener, which conforms to the
+ WebAllowDenyPolicyListener protocol, similar to geolocation.
+ (WebNotificationClient::requestPermission):
+ (WebNotificationClient::checkPermission):
+ (-[WebNotificationPolicyListener initWithCallback:]):
+ (-[WebNotificationPolicyListener allow]): Call the callback.
+ (-[WebNotificationPolicyListener deny]): Call the callback.
+ * WebView/WebUIDelegatePrivate.h: Define new UI delegate method to ask the user to decide a
+ policy for navigations.
+
+ ====
+ Bring notifications support to WK1 mac: showing, canceling, removing notifications
+
+ Create a WebKit wrapper object for WebCore::Notification, which also keeps track of an assigned
+ ID.
+ * WebView/WebNotification.h: Added.
+ (WebSecurityOrigin):
+ * WebView/WebNotification.mm: Added.
+ (core):
+ (-[WebNotification initWithCoreNotification:notificationID:]):
+ (-[WebNotification init]):
+ (-[WebNotification dealloc]):
+ (-[WebNotification title]):
+ (-[WebNotification body]):
+ (-[WebNotification origin]):
+ (-[WebNotification notificationID]):
+ (-[WebNotification dispatchShowEvent]):
+ (-[WebNotification dispatchCloseEvent]):
+ (-[WebNotification dispatchClickEvent]):
+ (-[WebNotification dispatchErrorEvent]):
+ * WebView/WebNotificationInternal.h: Added.
+ (WebCore): Internal category to allow creating instances with WebCore objects.
+
+ Extend WebView to include a WebNotificationProvider, which clients implement.
+ * WebView/WebViewData.h: Add a private member for the provider.
+ * WebView/WebViewPrivate.h:
+ * Define an enum WebNotificationPermission that mirrors WebCore::NotificationPresenter::Permission
+ that client which implement the provider can use to return policy decisions.
+ * Define WebNotificationProvider.
+ * Category WebViewNotification extends WebView with methods that set and manager the
+ notification provider, and handle events from the platform notifications.
+ * WebView/WebView.mm:
+ (-[WebView _setNotificationProvider:]): Sets the provider when initializing the WebView.
+ (-[WebView _notificationControllerDestroyed]):
+ (-[WebView _notificationProvider]):
+ (-[WebView _notificationDidShow:]):
+ (-[WebView _notificationDidClick:]):
+ (-[WebView _notificationsDidClose:]):
+
+ * WebCoreSupport/WebNotificationClient.h: Add variables that map between WebCore::Notification
+ instances, their assigned IDs, their contexts, and corresponding WebKit wrapper objects.
+ * WebCoreSupport/WebNotificationClient.mm:
+ (generateNotificationID): Created unique IDs for each shown notification.
+ (WebNotificationClient::show): Create wrapper object for notification, assign ID, cache the
+ mappings between the objects, and forward it to the provider.
+ (WebNotificationClient::cancel):
+ (WebNotificationClient::clearNotifications): Clear all notifications associated with the
+ provided context.
+ (WebNotificationClient::notificationObjectDestroyed): Remove the notification from the maps.
+ (WebNotificationClient::notificationControllerDestroyed): If the controller is destroyed, tell
+ the provider to clear of the notifications related to this web view.
+
+ ====
+ (Prep work for) Bring notifications support to WK1 mac
+
+ Rename WebGeolocationPolicyListener. The interface is generic enough to be reused for
+ notification requests. To avoid having to create a new listener type, instead rename it
+ to WebAllowDenyPolicyListener.
+ * WebView/WebUIDelegatePrivate.h: Rename the protocol.
+ * WebCoreSupport/WebGeolocationClient.mm: Refactor geolocation request listener to use
+ new name.
+
+ Add preference to keep track of whether notifications are enabled in general.
+ * WebView/WebPreferenceKeysPrivate.h: Add WebNotificationsEnabledKey for storing the
+ preference.
+ * WebView/WebPreferences.mm:
+ (+[WebPreferences initialize]): By default have them enabled.
+ (-[WebPreferences setNotificationsEnabled:]):
+ (-[WebPreferences notificationsEnabled]):
+ * WebView/WebPreferencesPrivate.h:
+
+ Add a stringValue method that exposes WebCore::SecurityOrigin::toString() for storing the
+ notification policy for a given origin.
+ * WebCoreSupport/WebSecurityOrigin.mm:
+ (-[WebSecurityOrigin stringValue]):
+ * WebCoreSupport/WebSecurityOriginPrivate.h:
+
2012-02-21 Sam Weinig <sam@webkit.org>
Attempt to fix the Snow Leopard build.
/*
- * Copyright (C) 2009 Apple Inc. All rights reserved.
+ * Copyright (C) 2009, 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
using namespace WebCore;
-@interface WebGeolocationPolicyListener : NSObject <WebGeolocationPolicyListener>
+@interface WebGeolocationPolicyListener : NSObject <WebAllowDenyPolicyListener>
{
RefPtr<Geolocation> _geolocation;
}
/*
- * 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
#import <WebCore/NotificationPresenter.h>
+#import <WebCore/Notification.h>
+#import <wtf/HashMap.h>
+#import <wtf/RefPtr.h>
+#import <wtf/RetainPtr.h>
+
namespace WebCore {
class ScriptExecutionContext;
class VoidCallback;
}
+@class WebNotification;
@class WebView;
class WebNotificationClient : public WebCore::NotificationPresenter {
private:
virtual bool show(WebCore::Notification*) OVERRIDE;
virtual void cancel(WebCore::Notification*) OVERRIDE;
+ virtual void clearNotifications(WebCore::ScriptExecutionContext*) OVERRIDE;
virtual void notificationObjectDestroyed(WebCore::Notification*) OVERRIDE;
virtual void notificationControllerDestroyed() OVERRIDE;
virtual void requestPermission(WebCore::ScriptExecutionContext*, PassRefPtr<WebCore::VoidCallback>) OVERRIDE;
- virtual void cancelRequestsForPermission(WebCore::ScriptExecutionContext*) OVERRIDE;
+ virtual void cancelRequestsForPermission(WebCore::ScriptExecutionContext*) OVERRIDE { }
virtual WebCore::NotificationPresenter::Permission checkPermission(WebCore::ScriptExecutionContext*) OVERRIDE;
WebView *m_webView;
+ HashMap<uint64_t, RetainPtr<WebNotification> > m_notificationIDMap;
+ HashMap<RefPtr<WebCore::Notification>, uint64_t> m_notificationMap;
+
+ typedef HashMap<RefPtr<WebCore::ScriptExecutionContext>, Vector<uint64_t> > NotificationContextMap;
+ NotificationContextMap m_notificationContextMap;
+
};
/*
- * 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
#import "WebNotificationClient.h"
+#import "WebNotificationInternal.h"
+#import "WebViewInternal.h"
#import <WebCore/NotImplemented.h>
#import <WebCore/Notification.h>
+#if ENABLE(NOTIFICATIONS)
+#import "WebDelegateImplementationCaching.h"
+#import "WebPreferencesPrivate.h"
+#import "WebSecurityOriginInternal.h"
+#import "WebUIDelegatePrivate.h"
+#import <WebCore/BlockExceptions.h>
+#import <WebCore/Page.h>
+#import <WebCore/ScriptExecutionContext.h>
+#endif
+
using namespace WebCore;
+#if ENABLE(NOTIFICATIONS)
+@interface WebNotificationPolicyListener : NSObject <WebAllowDenyPolicyListener>
+{
+ RefPtr<VoidCallback> _callback;
+}
+- (id)initWithCallback:(PassRefPtr<VoidCallback>)callback;
+@end
+#endif
+
+#if ENABLE(NOTIFICATIONS)
+static uint64_t generateNotificationID()
+{
+ static uint64_t uniqueNotificationID = 1;
+ return uniqueNotificationID++;
+}
+#endif
+
WebNotificationClient::WebNotificationClient(WebView *webView)
: m_webView(webView)
{
}
-bool WebNotificationClient::show(Notification*)
+bool WebNotificationClient::show(Notification* notification)
{
- notImplemented();
+#if ENABLE(NOTIFICATIONS)
+ if (![m_webView _notificationProvider])
+ return false;
+
+ uint64_t notificationID = generateNotificationID();
+ RetainPtr<WebNotification> webNotification = adoptNS([[WebNotification alloc] initWithCoreNotification:notification notificationID:notificationID]);
+ m_notificationMap.set(notification, notificationID);
+ m_notificationIDMap.set(notificationID, webNotification);
+
+ NotificationContextMap::iterator it = m_notificationContextMap.find(notification->scriptExecutionContext());
+ if (it == m_notificationContextMap.end()) {
+ pair<NotificationContextMap::iterator, bool> addedPair = m_notificationContextMap.add(notification->scriptExecutionContext(), Vector<uint64_t>());
+ it = addedPair.first;
+ }
+ it->second.append(notificationID);
+
+ [[m_webView _notificationProvider] showNotification:webNotification.get() fromWebView:m_webView];
+ return true;
+#else
+ UNUSED_PARAM(notification);
return false;
+#endif
}
-void WebNotificationClient::cancel(Notification*)
+void WebNotificationClient::cancel(Notification* notification)
{
- notImplemented();
+#if ENABLE(NOTIFICATIONS)
+ uint64_t notificationID = m_notificationMap.get(notification);
+ if (!notificationID)
+ return;
+
+ WebNotification *webNotification = m_notificationIDMap.get(notificationID).get();
+ ASSERT(webNotification);
+ [[m_webView _notificationProvider] cancelNotification:webNotification];
+#else
+ UNUSED_PARAM(notification);
+#endif
}
-void WebNotificationClient::notificationObjectDestroyed(WebCore::Notification*)
+void WebNotificationClient::clearNotifications(ScriptExecutionContext* context)
{
- notImplemented();
+#if ENABLE(NOTIFICATIONS)
+ NotificationContextMap::iterator it = m_notificationContextMap.find(context);
+ if (it == m_notificationContextMap.end())
+ return;
+
+ Vector<uint64_t>& notificationIDs = it->second;
+ NSMutableArray *nsIDs = [NSMutableArray array];
+ size_t count = notificationIDs.size();
+ for (size_t i = 0; i < count; ++i)
+ [nsIDs addObject:[NSNumber numberWithUnsignedLongLong:notificationIDs[i]]];
+ [[m_webView _notificationProvider] clearNotifications:nsIDs];
+
+ for (size_t i = 0; i < count; ++i) {
+ RetainPtr<WebNotification> webNotification = m_notificationIDMap.take(notificationIDs[i]);
+ if (!webNotification)
+ continue;
+ m_notificationMap.remove(core(webNotification.get()));
+ }
+
+ m_notificationContextMap.remove(it);
+#else
+ UNUSED_PARAM(context);
+#endif
+}
+
+void WebNotificationClient::notificationObjectDestroyed(Notification* notification)
+{
+#if ENABLE(NOTIFICATIONS)
+ uint64_t notificationID = m_notificationMap.take(notification);
+ if (!notificationID)
+ return;
+
+ RetainPtr<WebNotification> webNotification = m_notificationIDMap.take(notificationID);
+ ASSERT(webNotification.get());
+
+ NotificationContextMap::iterator it = m_notificationContextMap.find(notification->scriptExecutionContext());
+ ASSERT(it != m_notificationContextMap.end());
+ size_t index = it->second.find(notificationID);
+ ASSERT(index != notFound);
+ it->second.remove(index);
+ if (it->second.isEmpty())
+ m_notificationContextMap.remove(it);
+
+ [[m_webView _notificationProvider] notificationDestroyed:webNotification.get()];
+#else
+ UNUSED_PARAM(notification);
+#endif
}
void WebNotificationClient::notificationControllerDestroyed()
{
+#if ENABLE(NOTIFICATIONS)
+ NSMutableArray *notificationIDs = [NSMutableArray array];
+ HashMap<uint64_t, RetainPtr<WebNotification> >::iterator itEnd = m_notificationIDMap.end();
+ for (HashMap<uint64_t, RetainPtr<WebNotification> >::iterator it = m_notificationIDMap.begin(); it != itEnd; ++it)
+ [notificationIDs addObject:[NSNumber numberWithUnsignedLongLong:it->first]];
+ [[m_webView _notificationProvider] clearNotifications:notificationIDs];
+ [m_webView _notificationControllerDestroyed];
+#endif
delete this;
}
-void WebNotificationClient::requestPermission(WebCore::ScriptExecutionContext*, PassRefPtr<WebCore::VoidCallback>)
+void WebNotificationClient::requestPermission(ScriptExecutionContext* context, PassRefPtr<VoidCallback> callback)
{
- notImplemented();
+#if ENABLE(NOTIFICATIONS)
+ BEGIN_BLOCK_OBJC_EXCEPTIONS;
+
+ SEL selector = @selector(webView:decidePolicyForNotificationRequestFromOrigin:listener:);
+ if (![[m_webView UIDelegate] respondsToSelector:selector])
+ return;
+
+ WebSecurityOrigin *webOrigin = [[WebSecurityOrigin alloc] _initWithWebCoreSecurityOrigin:context->securityOrigin()];
+ WebNotificationPolicyListener* listener = [[WebNotificationPolicyListener alloc] initWithCallback:callback];
+
+ CallUIDelegate(m_webView, selector, webOrigin, listener);
+
+ [webOrigin release];
+ [listener release];
+
+ END_BLOCK_OBJC_EXCEPTIONS;
+#else
+ UNUSED_PARAM(context);
+ UNUSED_PARAM(callback);
+#endif
}
-void WebNotificationClient::cancelRequestsForPermission(WebCore::ScriptExecutionContext*)
+NotificationPresenter::Permission WebNotificationClient::checkPermission(ScriptExecutionContext* context)
{
- notImplemented();
+#if ENABLE(NOTIFICATIONS)
+ if (!context || !context->isDocument())
+ return NotificationPresenter::PermissionDenied;
+ if (![[m_webView preferences] notificationsEnabled])
+ return NotificationPresenter::PermissionDenied;
+ WebSecurityOrigin *webOrigin = [[WebSecurityOrigin alloc] _initWithWebCoreSecurityOrigin:context->securityOrigin()];
+ WebNotificationPermission permission = [[m_webView _notificationProvider] policyForOrigin:webOrigin];
+ [webOrigin release];
+ switch (permission) {
+ case WebNotificationPermissionAllowed:
+ return NotificationPresenter::PermissionAllowed;
+ case WebNotificationPermissionDenied:
+ return NotificationPresenter::PermissionDenied;
+ case WebNotificationPermissionNotAllowed:
+ return NotificationPresenter::PermissionNotAllowed;
+ default:
+ return NotificationPresenter::PermissionNotAllowed;
+ }
+#else
+ UNUSED_PARAM(context);
+ return NotificationPresenter::PermissionDenied;
+#endif
}
-NotificationPresenter::Permission WebNotificationClient::checkPermission(WebCore::ScriptExecutionContext*)
+#if ENABLE(NOTIFICATIONS)
+@implementation WebNotificationPolicyListener
+- (id)initWithCallback:(PassRefPtr<VoidCallback>)callback
{
- notImplemented();
- return NotificationPresenter::PermissionDenied;
+ if (!(self = [super init]))
+ return nil;
+
+ ASSERT(callback);
+ _callback = callback;
+ return self;
}
+
+- (void)allow
+{
+ _callback->handleEvent();
+}
+
+- (void)deny
+{
+ _callback->handleEvent();
+}
+
+@end
+#endif
/*
- * Copyright (C) 2007, 2010 Apple Inc. All rights reserved.
+ * Copyright (C) 2007, 2010, 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
return reinterpret_cast<SecurityOrigin*>(_private)->databaseIdentifier();
}
+- (NSString *)stringValue
+{
+ return reinterpret_cast<SecurityOrigin*>(_private)->toString();
+}
+
// Deprecated. Use host instead. This needs to stay here until we ship a new Safari.
- (NSString *)domain
{
/*
- * Copyright (C) 2007, 2010 Apple Inc. All rights reserved.
+ * Copyright (C) 2007, 2010, 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
- (NSString *)host;
- (NSString *)databaseIdentifier;
+- (NSString *)stringValue;
// Returns zero if the port is the default port for the protocol, non-zero otherwise.
- (unsigned short)port;
--- /dev/null
+/*
+ * Copyright (C) 2012 Apple Computer, Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+@class WebNotificationPrivate;
+@class WebSecurityOrigin;
+
+@interface WebNotification : NSObject
+{
+ WebNotificationPrivate *_private;
+}
+
+- (NSString *)title;
+- (NSString *)body;
+- (WebSecurityOrigin *)origin;
+- (uint64_t)notificationID;
+
+- (void)dispatchShowEvent;
+- (void)dispatchCloseEvent;
+- (void)dispatchClickEvent;
+- (void)dispatchErrorEvent;
+
+@end
--- /dev/null
+/*
+ * Copyright (C) 2012 Apple Computer, Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#import "WebNotification.h"
+
+#import "WebNotificationInternal.h"
+#import "WebSecurityOriginInternal.h"
+#import <WebCore/Notification.h>
+#import <WebCore/ScriptExecutionContext.h>
+#import <wtf/PassRefPtr.h>
+#import <wtf/RefPtr.h>
+
+using namespace WebCore;
+
+OBJC_CLASS WebNotificationInternal;
+
+@interface WebNotificationPrivate : NSObject
+{
+@public
+ WebNotificationInternal *_internal;
+ uint64_t _notificationID;
+}
+@end
+
+@implementation WebNotificationPrivate
+@end
+
+#if ENABLE(NOTIFICATIONS)
+@implementation WebNotification (WebNotificationInternal)
+Notification* core(WebNotification *notification)
+{
+ if (!notification->_private)
+ return 0;
+ return reinterpret_cast<Notification*>(notification->_private->_internal);
+}
+
+- (id)initWithCoreNotification:(Notification*)coreNotification notificationID:(uint64_t)notificationID
+{
+ if (!(self = [super init]))
+ return nil;
+ coreNotification->ref();
+ _private = [[WebNotificationPrivate alloc] init];
+ _private->_internal = reinterpret_cast<WebNotificationInternal*>(coreNotification);
+ _private->_notificationID = notificationID;
+ return self;
+}
+@end
+#endif
+
+@implementation WebNotification
+- (id)init
+{
+ return nil;
+}
+
+- (void)dealloc
+{
+ Notification* notification = core(self);
+ if (notification)
+ notification->deref();
+
+ [super dealloc];
+}
+
+- (NSString *)title
+{
+ ASSERT(core(self));
+ return core(self)->contents().title;
+}
+
+- (NSString *)body
+{
+ ASSERT(core(self));
+ return core(self)->contents().body;
+}
+
+- (WebSecurityOrigin *)origin
+{
+ ASSERT(core(self));
+ return [[[WebSecurityOrigin alloc] _initWithWebCoreSecurityOrigin:core(self)->scriptExecutionContext()->securityOrigin()] autorelease];
+}
+
+- (uint64_t)notificationID
+{
+ ASSERT(core(self));
+ return _private->_notificationID;
+}
+
+- (void)dispatchShowEvent
+{
+ ASSERT(core(self));
+ core(self)->dispatchShowEvent();
+}
+
+- (void)dispatchCloseEvent
+{
+ ASSERT(core(self));
+ core(self)->dispatchCloseEvent();
+}
+
+- (void)dispatchClickEvent
+{
+ ASSERT(core(self));
+ core(self)->dispatchClickEvent();
+}
+
+- (void)dispatchErrorEvent
+{
+ ASSERT(core(self));
+ core(self)->dispatchErrorEvent();
+}
+
+@end
--- /dev/null
+/*
+ * Copyright (C) 2012 Apple Computer, Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#import "WebNotification.h"
+
+#if ENABLE(NOTIFICATIONS)
+
+namespace WebCore {
+class Notification;
+}
+
+WebCore::Notification* core(WebNotification *);
+
+@interface WebNotification (WebNotificationInternal)
+- (id)initWithCoreNotification:(WebCore::Notification*)coreNotification notificationID:(uint64_t)notificationID;
+@end
+
+#endif
/*
- * Copyright (C) 2005 Apple Computer, Inc. All rights reserved.
+ * Copyright (C) 2005, 2012 Apple Computer, Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
#define WebKitShouldDisplaySubtitlesPreferenceKey @"WebKitShouldDisplaySubtitles"
#define WebKitShouldDisplayCaptionsPreferenceKey @"WebKitShouldDisplayCaptions"
#define WebKitShouldDisplayTextDescriptionsPreferenceKey @"WebKitShouldDisplayTextDescriptions"
+#define WebKitNotificationsEnabledKey @"WebKitNotificationsEnabled"
// These are private both because callers should be using the cover methods and because the
// cover methods themselves are private.
/*
- * Copyright (C) 2003, 2004, 2005 Apple Computer, Inc. All rights reserved.
+ * Copyright (C) 2003, 2004, 2005, 2012 Apple Computer, Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
/*
- * Copyright (C) 2005, 2006, 2007, 2011 Apple Inc. All rights reserved.
+ * Copyright (C) 2005, 2006, 2007, 2011, 2012 Apple Inc. All rights reserved.
* (C) 2006 Graham Dennis (graham.dennis@gmail.com)
*
* Redistribution and use in source and binary forms, with or without
[NSNumber numberWithBool:NO], WebKitShouldDisplaySubtitlesPreferenceKey,
[NSNumber numberWithBool:NO], WebKitShouldDisplayCaptionsPreferenceKey,
[NSNumber numberWithBool:NO], WebKitShouldDisplayTextDescriptionsPreferenceKey,
+ [NSNumber numberWithBool:YES], WebKitNotificationsEnabledKey,
[NSNumber numberWithLongLong:ApplicationCacheStorage::noQuota()], WebKitApplicationCacheTotalQuota,
[NSNumber numberWithLongLong:ApplicationCacheStorage::noQuota()], WebKitApplicationCacheDefaultOriginQuota,
return [self _boolValueForKey:WebKitShouldDisplayTextDescriptionsPreferenceKey];
}
+- (void)setNotificationsEnabled:(BOOL)flag
+{
+ [self _setBoolValue:flag forKey:WebKitNotificationsEnabledKey];
+}
+
+- (BOOL)notificationsEnabled
+{
+ return [self _boolValueForKey:WebKitNotificationsEnabledKey];
+}
+
@end
@implementation WebPreferences (WebInternal)
- (void)setShouldDisplayTextDescriptions:(BOOL)flag;
- (BOOL)shouldDisplayTextDescriptions;
+- (void)setNotificationsEnabled:(BOOL)flag;
+- (BOOL)notificationsEnabled;
+
@end
/*
- * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved.
+ * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 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
@class WebSecurityOrigin;
-@protocol WebGeolocationPolicyListener <NSObject>
+@protocol WebAllowDenyPolicyListener <NSObject>
- (void)allow;
- (void)deny;
@end
*/
- (void)webView:(WebView *)webView decidePolicyForGeolocationRequestFromOrigin:(WebSecurityOrigin *)origin
frame:(WebFrame *)frame
- listener:(id<WebGeolocationPolicyListener>)listener;
+ listener:(id<WebAllowDenyPolicyListener>)listener;
+- (void)webView:(WebView *)webView decidePolicyForNotificationRequestFromOrigin:(WebSecurityOrigin *)origin listener:(id<WebAllowDenyPolicyListener>)listener;
- (void)webView:(WebView *)sender elementDidFocusNode:(DOMNode *)node;
- (void)webView:(WebView *)sender elementDidBlurNode:(DOMNode *)node;
/*
- * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved.
+ * Copyright (C) 2005-2012 Apple Inc. All rights reserved.
* Copyright (C) 2006 David Smith (catfish.man@gmail.com)
* Copyright (C) 2010 Igalia S.L
*
@end
+@implementation WebView (WebViewNotification)
+- (void)_setNotificationProvider:(id<WebNotificationProvider>)notificationProvider
+{
+ if (_private) {
+ _private->_notificationProvider = notificationProvider;
+ [_private->_notificationProvider registerWebView:self];
+ }
+}
+
+- (void)_notificationControllerDestroyed
+{
+ [[self _notificationProvider] unregisterWebView:self];
+}
+
+- (id<WebNotificationProvider>)_notificationProvider
+{
+ if (_private)
+ return _private->_notificationProvider;
+ return nil;
+}
+
+- (void)_notificationDidShow:(uint64_t)notificationID
+{
+ [[self _notificationProvider] webView:self didShowNotification:notificationID];
+}
+
+- (void)_notificationDidClick:(uint64_t)notificationID
+{
+ [[self _notificationProvider] webView:self didClickNotification:notificationID];
+}
+
+- (void)_notificationsDidClose:(NSArray *)notificationIDs
+{
+ [[self _notificationProvider] webView:self didCloseNotifications:notificationIDs];
+}
+@end
+
@implementation WebView (WebViewPrivateStyleInfo)
- (JSValueRef)_computedStyleIncludingVisitedInfo:(JSContextRef)context forElement:(JSValueRef)value
/*
- * Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
+ * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2012 Apple Inc. All rights reserved.
* Copyright (C) 2010 Igalia S.L
*
* Redistribution and use in source and binary forms, with or without
@protocol WebFormDelegate;
@protocol WebDeviceOrientationProvider;
@protocol WebGeolocationProvider;
+@protocol WebNotificationProvider;
#if ENABLE(VIDEO)
@class WebVideoFullscreenController;
#endif
#endif
id<WebGeolocationProvider> _geolocationProvider;
id<WebDeviceOrientationProvider> m_deviceOrientationProvider;
+ id<WebNotificationProvider> _notificationProvider;
RefPtr<WebCore::HistoryItem> _globalHistoryItem;
/*
- * Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
+ * Copyright (C) 2005-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
@class WebDeviceOrientation;
@class WebGeolocationPosition;
@class WebInspector;
+@class WebNotification;
@class WebPreferences;
@class WebScriptWorld;
+@class WebSecurityOrigin;
@class WebTextIterator;
@protocol WebDeviceOrientationProvider;
WebPaginationModeVertical,
} WebPaginationMode;
+// This needs to be in sync with WebCore::NotificationPresenter::Permission
+typedef enum {
+ WebNotificationPermissionAllowed,
+ WebNotificationPermissionNotAllowed,
+ WebNotificationPermissionDenied
+} WebNotificationPermission;
+
@interface WebController : NSTreeController {
IBOutlet WebView *webView;
}
- (WebGeolocationPosition *)lastPosition;
@end
+@protocol WebNotificationProvider
+- (void)registerWebView:(WebView *)webView;
+- (void)unregisterWebView:(WebView *)webView;
+
+- (void)showNotification:(WebNotification *)notification fromWebView:(WebView *)webView;
+- (void)cancelNotification:(WebNotification *)notification;
+- (void)notificationDestroyed:(WebNotification *)notification;
+- (void)clearNotifications:(NSArray *)notificationIDs;
+- (WebNotificationPermission)policyForOrigin:(WebSecurityOrigin *)origin;
+
+- (void)webView:(WebView *)webView didShowNotification:(uint64_t)notificationID;
+- (void)webView:(WebView *)webView didClickNotification:(uint64_t)notificationID;
+- (void)webView:(WebView *)webView didCloseNotifications:(NSArray *)notificationIDs;
+@end
+
@interface WebView (WebViewGeolocation)
- (void)_setGeolocationProvider:(id<WebGeolocationProvider>)locationProvider;
- (id<WebGeolocationProvider>)_geolocationProvider;
- (void)_geolocationDidFailWithError:(NSError *)error;
@end
+@interface WebView (WebViewNotification)
+- (void)_setNotificationProvider:(id<WebNotificationProvider>)notificationProvider;
+- (id<WebNotificationProvider>)_notificationProvider;
+- (void)_notificationControllerDestroyed;
+
+- (void)_notificationDidShow:(uint64_t)notificationID;
+- (void)_notificationDidClick:(uint64_t)notificationID;
+- (void)_notificationsDidClose:(NSArray *)notificationIDs;
+@end
+
@interface WebView (WebViewPrivateStyleInfo)
- (JSValueRef)_computedStyleIncludingVisitedInfo:(JSContextRef)context forElement:(JSValueRef)value;
@end
+2012-02-21 Jon Lee <jonlee@apple.com>
+
+ Bring notifications support to WK1 mac
+ https://bugs.webkit.org/show_bug.cgi?id=78783
+ <rdar://problem/10610578>
+
+ Reviewed by Anders Carlsson.
+
+ * DumpRenderTree/mac/UIDelegate.mm: Refactor WebGeolocationPolicyListener to WebAllowDenyPolicyListener.
+ (-[UIDelegate webView:decidePolicyForGeolocationRequestFromOrigin:frame:listener:]):
+ (-[UIDelegate timerFired]):
+
2012-02-21 Kentaro Hara <haraken@chromium.org>
Enable the IDL attribute checker in run-bindings-tests
printf("UI DELEGATE STATUS CALLBACK: setStatusText:%s\n", [text UTF8String]);
}
-- (void)webView:(WebView *)webView decidePolicyForGeolocationRequestFromOrigin:(WebSecurityOrigin *)origin frame:(WebFrame *)frame listener:(id<WebGeolocationPolicyListener>)listener
+- (void)webView:(WebView *)webView decidePolicyForGeolocationRequestFromOrigin:(WebSecurityOrigin *)origin frame:(WebFrame *)frame listener:(id<WebAllowDenyPolicyListener>)listener
{
if (!gLayoutTestController->isGeolocationPermissionSet()) {
if (!m_pendingGeolocationPermissionListeners)
ASSERT(gLayoutTestController->isGeolocationPermissionSet());
m_timer = 0;
NSEnumerator* enumerator = [m_pendingGeolocationPermissionListeners objectEnumerator];
- id<WebGeolocationPolicyListener> listener;
+ id<WebAllowDenyPolicyListener> listener;
while ((listener = [enumerator nextObject])) {
if (gLayoutTestController->geolocationPermission())
[listener allow];