Changeset 47084 in webkit
- Timestamp:
- Aug 11, 2009 8:30:17 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 7 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebKit/win/ChangeLog
r47064 r47084 1 2009-08-11 John Gregg <johnnyg@google.com> 2 3 Reviewed by Maciej Stachowiak. 4 5 Move the accessor for notifications presenter from WebUIDelegate 6 to WebUIDelegate2 which extends it. When making this call from 7 WebCoreSupport, check using QueryInterface before calling. 8 9 https://bugs.webkit.org/show_bug.cgi?id=28198 10 11 * Interfaces/IWebUIDelegate.idl: 12 * Interfaces/IWebUIDelegate2.idl: Added. 13 * Interfaces/WebKit.idl: 14 * WebCoreSupport/WebDesktopNotificationsDelegate.cpp: 15 (WebDesktopNotificationsDelegate::show): 16 (WebDesktopNotificationsDelegate::cancel): 17 (WebDesktopNotificationsDelegate::notificationObjectDestroyed): 18 (WebDesktopNotificationsDelegate::requestPermission): 19 (WebDesktopNotificationsDelegate::checkPermission): 20 (WebDesktopNotificationsDelegate::hasNotificationDelegate): 21 (WebDesktopNotificationsDelegate::notificationDelegate): 22 * WebCoreSupport/WebDesktopNotificationsDelegate.h: 23 1 24 2009-08-11 Drew Wilson <atwilson@google.com> 2 25 -
trunk/WebKit/win/Interfaces/IWebUIDelegate.idl
r47056 r47084 756 756 [in] WebScrollbarControlPart pressedPart, [in] BOOL vertical, [in] float value, [in] float proportion, [in] WebScrollbarControlPartMask parts); 757 757 HRESULT paintCustomScrollCorner([in] IWebView* webView, [in] HDC hDC, [in] RECT rect); 758 759 HRESULT desktopNotificationsDelegate([out, retval] IWebDesktopNotificationsDelegate** result);760 758 } -
trunk/WebKit/win/Interfaces/IWebUIDelegate2.idl
r47083 r47084 29 29 */ 30 30 31 #include <WebCore/COMPtr.h> 32 #include <WebCore/Notification.h> 33 #include <WebCore/NotificationPresenter.h> 31 #ifndef DO_NO_IMPORTS 32 import "oaidl.idl"; 33 import "ocidl.idl"; 34 #endif 34 35 35 #if ENABLE(NOTIFICATIONS) 36 /*! 37 @category WebUIDelegate2 38 @discussion An extension of WebUIDelegate which additionally 39 provides access to a notification presenter. 40 @interface NSObject (WebUIDelegate2) 41 */ 42 [ 43 object, 44 oleautomation, 45 uuid(C6DEF152-86CD-11de-8BF4-ADD456D89593), 46 pointer_default(unique) 47 ] 36 48 37 interface IWebDesktopNotificationPresenter; 38 39 class WebDesktopNotificationsDelegate : public WebCore::NotificationPresenter { 40 public: 41 WebDesktopNotificationsDelegate(WebView* view); 42 43 /* WebCore::NotificationPresenter interface */ 44 virtual bool show(WebCore::Notification* object); 45 virtual void cancel(WebCore::Notification* object); 46 virtual void notificationObjectDestroyed(WebCore::Notification* object); 47 virtual void requestPermission(WebCore::SecurityOrigin* origin, PassRefPtr<WebCore::VoidCallback> callback); 48 virtual WebCore::NotificationPresenter::Permission checkPermission(WebCore::SecurityOrigin* origin); 49 50 private: 51 COMPtr<IWebDesktopNotificationsDelegate> notificationDelegate(); 52 53 WebView* m_webView; 54 }; 55 56 #endif 49 interface IWebUIDelegate2 : IWebUIDelegate 50 { 51 /*! 52 @method desktopNotificationsDelegate: 53 @abstract Returns the notifications delegate object. 54 */ 55 HRESULT desktopNotificationsDelegate([out, retval] IWebDesktopNotificationsDelegate** result); 56 } -
trunk/WebKit/win/Interfaces/WebKit.idl
r47056 r47084 113 113 #include "IWebTextRenderer.idl" 114 114 #include "IWebUIDelegate.idl" 115 #include "IWebUIDelegate2.idl" 115 116 #include "IWebUIDelegatePrivate.idl" 116 117 #include "IWebURLAuthenticationChallenge.idl" -
trunk/WebKit/win/WebCoreSupport/WebDesktopNotificationsDelegate.cpp
r47056 r47084 147 147 bool WebDesktopNotificationsDelegate::show(Notification* object) 148 148 { 149 notificationDelegate()->showDesktopNotification(NotificationCOMWrapper::create(object)); 149 if (hasNotificationDelegate()) 150 notificationDelegate()->showDesktopNotification(NotificationCOMWrapper::create(object)); 150 151 return true; 151 152 } … … 153 154 void WebDesktopNotificationsDelegate::cancel(Notification* object) 154 155 { 155 notificationDelegate()->cancelDesktopNotification(NotificationCOMWrapper::create(object)); 156 if (hasNotificationDelegate()) 157 notificationDelegate()->cancelDesktopNotification(NotificationCOMWrapper::create(object)); 156 158 } 157 159 158 160 void WebDesktopNotificationsDelegate::notificationObjectDestroyed(Notification* object) 159 161 { 160 notificationDelegate()->notificationDestroyed(NotificationCOMWrapper::create(object)); 162 if (hasNotificationDelegate()) 163 notificationDelegate()->notificationDestroyed(NotificationCOMWrapper::create(object)); 161 164 } 162 165 … … 164 167 { 165 168 BString org(origin->toString()); 166 notificationDelegate()->requestNotificationPermission(org); 169 if (hasNotificationDelegate()) 170 notificationDelegate()->requestNotificationPermission(org); 167 171 } 168 172 169 173 NotificationPresenter::Permission WebDesktopNotificationsDelegate::checkPermission(SecurityOrigin* origin) 170 { 171 int out ;174 { 175 int out = 0; 172 176 BString org(origin->toString()); 173 notificationDelegate()->checkNotificationPermission(org, &out); 177 if (hasNotificationDelegate()) 178 notificationDelegate()->checkNotificationPermission(org, &out); 174 179 return (NotificationPresenter::Permission) out; 175 180 } 176 181 177 COMPtr<IWebDesktopNotificationsDelegate> WebDesktopNotificationsDelegate::notificationDelegate()182 bool WebDesktopNotificationsDelegate::hasNotificationDelegate() 178 183 { 179 184 COMPtr<IWebUIDelegate> ui; 180 185 m_webView->uiDelegate(&ui); 181 186 187 COMPtr<IWebUIDelegate2> ui2; 188 if (SUCCEEDED(ui->QueryInterface(IID_IWebUIDelegate2, &ui2))) 189 return true; 190 } 191 192 COMPtr<IWebDesktopNotificationsDelegate> WebDesktopNotificationsDelegate::notificationDelegate() 193 { 194 COMPtr<IWebUIDelegate> ui; 195 m_webView->uiDelegate(&ui); 196 197 COMPtr<IWebUIDelegate2> ui2; 182 198 COMPtr<IWebDesktopNotificationsDelegate> delegate; 183 ui->desktopNotificationsDelegate(&delegate); 184 199 if (SUCCEEDED(ui->QueryInterface(IID_IWebUIDelegate2, &ui2))) 200 ui2->desktopNotificationsDelegate(&delegate); 201 185 202 return delegate; 186 203 } -
trunk/WebKit/win/WebCoreSupport/WebDesktopNotificationsDelegate.h
r47063 r47084 49 49 50 50 private: 51 bool hasNotificationDelegate(); 51 52 COMPtr<IWebDesktopNotificationsDelegate> notificationDelegate(); 52 53 53 54 WebView* m_webView; 54 55 }; -
trunk/WebKitTools/ChangeLog
r47080 r47084 1 2009-08-11 John Gregg <johnnyg@google.com> 2 3 Reviewed by Maciej Stachowiak. 4 5 Switch DumpRenderTree to contain a WebUIDelegate2, which extends 6 WebUIDelegate, so that the notifications tests will still work. 7 https://bugs.webkit.org/show_bug.cgi?id=28198 8 9 * DumpRenderTree/win/UIDelegate.h: 10 1 11 2009-08-11 Darin Adler <darin@apple.com> 2 12 -
trunk/WebKitTools/DumpRenderTree/win/UIDelegate.h
r47056 r47084 38 38 class DRTDesktopNotificationPresenter; 39 39 40 class UIDelegate : public IWebUIDelegate , IWebUIDelegatePrivate {40 class UIDelegate : public IWebUIDelegate2, IWebUIDelegatePrivate { 41 41 public: 42 42 UIDelegate();
Note: See TracChangeset
for help on using the changeset viewer.