| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006, 2007, 2008, 2010 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007, 2008, 2010 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) | 3 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 return *supplement; | 62 return *supplement; |
| 63 } | 63 } |
| 64 | 64 |
| 65 NotificationCenter* DOMWindowNotifications::webkitNotifications(DOMWindow& windo
w) | 65 NotificationCenter* DOMWindowNotifications::webkitNotifications(DOMWindow& windo
w) |
| 66 { | 66 { |
| 67 return DOMWindowNotifications::from(window).webkitNotifications(); | 67 return DOMWindowNotifications::from(window).webkitNotifications(); |
| 68 } | 68 } |
| 69 | 69 |
| 70 void DOMWindowNotifications::willDestroyGlobalObjectInFrame() | 70 void DOMWindowNotifications::willDestroyGlobalObjectInFrame() |
| 71 { | 71 { |
| 72 m_notificationCenter = 0; | 72 m_notificationCenter = nullptr; |
| 73 DOMWindowProperty::willDestroyGlobalObjectInFrame(); | 73 DOMWindowProperty::willDestroyGlobalObjectInFrame(); |
| 74 } | 74 } |
| 75 | 75 |
| 76 void DOMWindowNotifications::willDetachGlobalObjectFromFrame() | 76 void DOMWindowNotifications::willDetachGlobalObjectFromFrame() |
| 77 { | 77 { |
| 78 m_notificationCenter = 0; | 78 m_notificationCenter = nullptr; |
| 79 DOMWindowProperty::willDetachGlobalObjectFromFrame(); | 79 DOMWindowProperty::willDetachGlobalObjectFromFrame(); |
| 80 } | 80 } |
| 81 | 81 |
| 82 NotificationCenter* DOMWindowNotifications::webkitNotifications() | 82 NotificationCenter* DOMWindowNotifications::webkitNotifications() |
| 83 { | 83 { |
| 84 if (!m_window.isCurrentlyDisplayedInFrame()) | 84 if (!m_window.isCurrentlyDisplayedInFrame()) |
| 85 return 0; | 85 return 0; |
| 86 | 86 |
| 87 if (m_notificationCenter) | 87 if (m_notificationCenter) |
| 88 return m_notificationCenter.get(); | 88 return m_notificationCenter.get(); |
| 89 | 89 |
| 90 Document* document = m_window.document(); | 90 Document* document = m_window.document(); |
| 91 if (!document) | 91 if (!document) |
| 92 return 0; | 92 return 0; |
| 93 | 93 |
| 94 Page* page = document->page(); | 94 Page* page = document->page(); |
| 95 if (!page) | 95 if (!page) |
| 96 return 0; | 96 return 0; |
| 97 | 97 |
| 98 NotificationClient* provider = NotificationController::clientFrom(page); | 98 NotificationClient* provider = NotificationController::clientFrom(page); |
| 99 if (provider) | 99 if (provider) |
| 100 m_notificationCenter = NotificationCenter::create(document, provider); | 100 m_notificationCenter = NotificationCenter::create(document, provider); |
| 101 | 101 |
| 102 return m_notificationCenter.get(); | 102 return m_notificationCenter.get(); |
| 103 } | 103 } |
| 104 | 104 |
| 105 } // namespace WebCore | 105 } // namespace WebCore |
| 106 | 106 |
| 107 #endif // ENABLE(LEGACY_NOTIFICATIONS) | 107 #endif // ENABLE(LEGACY_NOTIFICATIONS) |
| OLD | NEW |