Changeset 57604 in webkit
- Timestamp:
- Apr 14, 2010 1:51:41 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r57603 r57604 1 2010-04-14 Aaron Boodman <aa@chromium.org> 2 3 Reviewed by David Levin. 4 5 Support relative URLs for notifications on Chromium. They weren't working previously because WebCore was inserting 6 the relative URL into a KURL instance, but when KURL is backed by GURL as it is on Chromium, relative URLs are 7 unsupported. Fixed by resolving the relative URL first. 8 9 https://bugs.webkit.org/show_bug.cgi?id=36623 10 11 Adding tests for this is difficult because we don't currently have DRT support for notifications on Mac, only Windows. 12 13 * notifications/Notification.cpp: 14 (WebCore::Notification::Notification): Accept resolved KURL instead of relative string. 15 * notifications/Notification.h: 16 (WebCore::Notification::create): Ditto. 17 (WebCore::Notification::iconURL): Return resolved KURL instead of relative string. 18 * notifications/NotificationCenter.h: 19 (WebCore::NotificationCenter::createHTMLNotification): Immediately resolve URL instead of passing off relative string. 20 (WebCore::NotificationCenter::createNotification): Ditto. 21 * notifications/NotificationContents.h: 22 (WebCore::NotificationContents::NotificationContents): Accept resolved KURL instead of relative string. 23 (WebCore::NotificationContents::icon): Return resolved URL. 24 1 25 2010-04-14 Anders Carlsson <andersca@apple.com> 2 26 -
trunk/WebCore/notifications/Notification.cpp
r57103 r57604 43 43 namespace WebCore { 44 44 45 Notification::Notification(const String& url, ScriptExecutionContext* context, ExceptionCode& ec, NotificationPresenter* provider)45 Notification::Notification(const KURL& url, ScriptExecutionContext* context, ExceptionCode& ec, NotificationPresenter* provider) 46 46 : ActiveDOMObject(context, this) 47 47 , m_isHTML(true) … … 55 55 } 56 56 57 m_notificationURL = context->completeURL(url); 58 if (url.isEmpty() || !m_notificationURL.isValid()) { 57 if (url.isEmpty() || !url.isValid()) { 59 58 ec = SYNTAX_ERR; 60 59 return; 61 60 } 61 62 m_notificationURL = url; 62 63 } 63 64 … … 75 76 } 76 77 77 if (!contents.icon().isEmpty()) 78 m_iconURL = context->completeURL(contents.icon()); 79 if (!m_iconURL.isEmpty() && !m_iconURL.isValid()) { 78 if (!contents.icon().isEmpty() && !contents.icon().isValid()) { 80 79 ec = SYNTAX_ERR; 81 80 return; -
trunk/WebCore/notifications/Notification.h
r56043 r57604 56 56 class Notification : public RefCounted<Notification>, public ActiveDOMObject, public EventTarget { 57 57 public: 58 static Notification* create(const String& url, ScriptExecutionContext* context, ExceptionCode& ec, NotificationPresenter* provider) { return new Notification(url, context, ec, provider); }58 static Notification* create(const KURL& url, ScriptExecutionContext* context, ExceptionCode& ec, NotificationPresenter* provider) { return new Notification(url, context, ec, provider); } 59 59 static Notification* create(const NotificationContents& contents, ScriptExecutionContext* context, ExceptionCode& ec, NotificationPresenter* provider) { return new Notification(contents, context, ec, provider); } 60 60 … … 66 66 bool isHTML() { return m_isHTML; } 67 67 KURL url() { return m_notificationURL; } 68 KURL iconURL() { return m_ iconURL; }68 KURL iconURL() { return m_contents.icon(); } 69 69 NotificationContents& contents() { return m_contents; } 70 70 … … 81 81 82 82 private: 83 Notification(const String& url, ScriptExecutionContext* context, ExceptionCode& ec, NotificationPresenter* provider);84 Notification(const NotificationContents& fields, ScriptExecutionContext* context, ExceptionCode& ec, NotificationPresenter* provider);83 Notification(const KURL&, ScriptExecutionContext*, ExceptionCode&, NotificationPresenter*); 84 Notification(const NotificationContents&, ScriptExecutionContext*, ExceptionCode&, NotificationPresenter*); 85 85 86 86 // EventTarget interface … … 92 92 bool m_isHTML; 93 93 KURL m_notificationURL; 94 KURL m_iconURL;95 94 NotificationContents m_contents; 96 95 -
trunk/WebCore/notifications/NotificationCenter.h
r51865 r57604 56 56 return 0; 57 57 } 58 return Notification::create(KURL(ParsedURLString, URI), context(), ec, presenter()); 58 if (URI.isEmpty()) { 59 ec = SYNTAX_ERR; 60 return 0; 61 } 62 return Notification::create(m_scriptExecutionContext->completeURL(URI), context(), ec, presenter()); 59 63 } 60 64 … … 65 69 return 0; 66 70 } 67 NotificationContents contents(iconURI , title, body);71 NotificationContents contents(iconURI.isEmpty() ? KURL() : m_scriptExecutionContext->completeURL(iconURI), title, body); 68 72 return Notification::create(contents, context(), ec, presenter()); 69 73 } -
trunk/WebCore/notifications/NotificationContents.h
r47056 r57604 39 39 public: 40 40 NotificationContents() {} 41 NotificationContents(const String& iconUrl, const String& title, const String& body)41 NotificationContents(const KURL& iconUrl, const String& title, const String& body) 42 42 : m_icon(iconUrl) 43 43 , m_title(title) 44 44 , m_body(body) {} 45 45 46 Stringicon() const { return m_icon; }46 KURL icon() const { return m_icon; } 47 47 String title() const { return m_title; } 48 48 String body() const { return m_body; } 49 49 50 50 private: 51 Stringm_icon;51 KURL m_icon; 52 52 String m_title; 53 53 String m_body; -
trunk/WebKit/chromium/ChangeLog
r57599 r57604 1 2010-04-14 Aaron Boodman <aa@chromium.org> 2 3 Reviewed by David Levin. 4 5 Support relative URLs for notifications on Chromium. They weren't working previously because WebCore was inserting 6 the relative URL into a KURL instance, but when KURL is backed by GURL as it is on Chromium, relative URLs are 7 unsupported. Fixed by resolving the relative URL first. 8 9 https://bugs.webkit.org/show_bug.cgi?id=36623 10 11 Adding tests for this is difficult because we don't currently have DRT support for notifications on Mac, only Windows. 12 13 * public/WebNotification.h: Remove deprecated icon() method. 14 * src/WebNotification.cpp: Ditto. 15 1 16 2010-04-14 Jay Civelli <jcivelli@chromium.org> 2 17 -
trunk/WebKit/chromium/public/WebNotification.h
r56043 r57604 72 72 WEBKIT_API WebURL url() const; 73 73 74 // If not HTML, the parameters for the icon-title-text notification.75 // FIXME: Deprecated; use iconURL() instead.76 WEBKIT_API WebString icon() const;77 74 WEBKIT_API WebURL iconURL() const; 78 75 WEBKIT_API WebString title() const; -
trunk/WebKit/chromium/src/WebNotification.cpp
r56043 r57604 77 77 } 78 78 79 // FIXME: remove this deprecated function once all callers use iconURL()80 WebString WebNotification::icon() const81 {82 ASSERT(!isHTML());83 return m_private->contents().icon();84 }85 86 79 WebURL WebNotification::iconURL() const 87 80 { -
trunk/WebKit/qt/ChangeLog
r57535 r57604 1 2010-04-14 Aaron Boodman <aa@chromium.org> 2 3 Reviewed by David Levin. 4 5 Support relative URLs for notifications on Chromium. They weren't working previously because WebCore was inserting 6 the relative URL into a KURL instance, but when KURL is backed by GURL as it is on Chromium, relative URLs are 7 unsupported. Fixed by resolving the relative URL first. 8 9 https://bugs.webkit.org/show_bug.cgi?id=36623 10 11 Adding tests for this is difficult because we don't currently have DRT support for notifications on Mac, only Windows. 12 13 * WebCoreSupport/NotificationPresenterClientQt.cpp: 14 (NotificationPresenterClientQt::show): Return type of NotificationContents::iconURL() changed. 15 1 16 2010-04-13 Timothy Hatcher <timothy@apple.com> 2 17 -
trunk/WebKit/qt/WebCoreSupport/NotificationPresenterClientQt.cpp
r57408 r57604 64 64 else { 65 65 printf("DESKTOP NOTIFICATION: icon %s, title %s, text %s\n", 66 QString(notification->contents().icon() ).toUtf8().constData(), QString(notification->contents().title()).toUtf8().constData(),66 QString(notification->contents().icon().string()).toUtf8().constData(), QString(notification->contents().title()).toUtf8().constData(), 67 67 QString(notification->contents().body()).toUtf8().constData()); 68 68 }
Note: See TracChangeset
for help on using the changeset viewer.