| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 29 */ | 29 */ |
| 30 | 30 |
| 31 #include "config.h" | 31 #include "config.h" |
| 32 #include "WebNotification.h" | 32 #include "WebNotification.h" |
| 33 | 33 |
| 34 #include "WebTextDirection.h" | 34 #include "WebTextDirection.h" |
| 35 #include "core/events/Event.h" | 35 #include "core/events/Event.h" |
| 36 #include "core/page/WindowFocusAllowedIndicator.h" | 36 #include "core/page/WindowFocusAllowedIndicator.h" |
| 37 #include "modules/notifications/NotificationBase.h" | 37 #include "modules/notifications/Notification.h" |
| 38 #include "platform/UserGestureIndicator.h" | 38 #include "platform/UserGestureIndicator.h" |
| 39 #include "public/platform/WebString.h" | 39 #include "public/platform/WebString.h" |
| 40 #include "public/platform/WebURL.h" | 40 #include "public/platform/WebURL.h" |
| 41 #include "wtf/PassRefPtr.h" | 41 #include "wtf/PassRefPtr.h" |
| 42 | 42 |
| 43 using namespace WebCore; | 43 using namespace WebCore; |
| 44 | 44 |
| 45 namespace blink { | 45 namespace blink { |
| 46 | 46 |
| 47 class WebNotificationPrivate : public NotificationBase { | 47 class WebNotificationPrivate : public Notification { |
| 48 }; | 48 }; |
| 49 | 49 |
| 50 void WebNotification::reset() | 50 void WebNotification::reset() |
| 51 { | 51 { |
| 52 assign(0); | 52 assign(0); |
| 53 } | 53 } |
| 54 | 54 |
| 55 void WebNotification::assign(const WebNotification& other) | 55 void WebNotification::assign(const WebNotification& other) |
| 56 { | 56 { |
| 57 WebNotificationPrivate* p = const_cast<WebNotificationPrivate*>(other.m_priv
ate); | 57 WebNotificationPrivate* p = const_cast<WebNotificationPrivate*>(other.m_priv
ate); |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 { | 117 { |
| 118 // FIXME: byUser flag not supported by WebCore yet | 118 // FIXME: byUser flag not supported by WebCore yet |
| 119 m_private->dispatchCloseEvent(); | 119 m_private->dispatchCloseEvent(); |
| 120 } | 120 } |
| 121 | 121 |
| 122 void WebNotification::dispatchClickEvent() | 122 void WebNotification::dispatchClickEvent() |
| 123 { | 123 { |
| 124 m_private->dispatchClickEvent(); | 124 m_private->dispatchClickEvent(); |
| 125 } | 125 } |
| 126 | 126 |
| 127 WebNotification::WebNotification(const WTF::PassRefPtr<NotificationBase>& notifi
cation) | 127 WebNotification::WebNotification(const WTF::PassRefPtr<Notification>& notificati
on) |
| 128 : m_private(static_cast<WebNotificationPrivate*>(notification.leakRef())) | 128 : m_private(static_cast<WebNotificationPrivate*>(notification.leakRef())) |
| 129 { | 129 { |
| 130 } | 130 } |
| 131 | 131 |
| 132 WebNotification& WebNotification::operator=(const WTF::PassRefPtr<NotificationBa
se>& notification) | 132 WebNotification& WebNotification::operator=(const WTF::PassRefPtr<Notification>&
notification) |
| 133 { | 133 { |
| 134 assign(static_cast<WebNotificationPrivate*>(notification.leakRef())); | 134 assign(static_cast<WebNotificationPrivate*>(notification.leakRef())); |
| 135 return *this; | 135 return *this; |
| 136 } | 136 } |
| 137 | 137 |
| 138 WebNotification::operator WTF::PassRefPtr<NotificationBase>() const | 138 WebNotification::operator WTF::PassRefPtr<Notification>() const |
| 139 { | 139 { |
| 140 return WTF::PassRefPtr<NotificationBase>(const_cast<WebNotificationPrivate*>
(m_private)); | 140 return WTF::PassRefPtr<Notification>(const_cast<WebNotificationPrivate*>(m_p
rivate)); |
| 141 } | 141 } |
| 142 | 142 |
| 143 void WebNotification::assign(WebNotificationPrivate* p) | 143 void WebNotification::assign(WebNotificationPrivate* p) |
| 144 { | 144 { |
| 145 // p is already ref'd for us by the caller | 145 // p is already ref'd for us by the caller |
| 146 if (m_private) | 146 if (m_private) |
| 147 m_private->deref(); | 147 m_private->deref(); |
| 148 m_private = p; | 148 m_private = p; |
| 149 } | 149 } |
| 150 | 150 |
| 151 } // namespace blink | 151 } // namespace blink |
| OLD | NEW |