| 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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 | 54 |
| 55 void NotificationCenter::requestPermission(PassRefPtr<VoidCallback> callback) | 55 void NotificationCenter::requestPermission(PassRefPtr<VoidCallback> callback) |
| 56 { | 56 { |
| 57 if (!presenter() || !scriptExecutionContext()) | 57 if (!presenter() || !scriptExecutionContext()) |
| 58 return; | 58 return; |
| 59 m_notificationPresenter->requestPermission(scriptExecutionContext(), callbac
k); | 59 m_notificationPresenter->requestPermission(scriptExecutionContext(), callbac
k); |
| 60 } | 60 } |
| 61 | 61 |
| 62 void NotificationCenter::disconnectFrame() | 62 void NotificationCenter::disconnectFrame() |
| 63 { | 63 { |
| 64 // m_notificationPresenter should never be 0. But just to be safe, we check
it here. | 64 // Can be 0 if iframe was transferred into another page. In this case |
| 65 // Due to the mysterious bug http://code.google.com/p/chromium/issues/detail
?id=49323. | 65 // this method is invoked more then once. |
| 66 ASSERT(m_notificationPresenter); | |
| 67 if (!m_notificationPresenter) | 66 if (!m_notificationPresenter) |
| 68 return; | 67 return; |
| 69 m_notificationPresenter->cancelRequestsForPermission(scriptExecutionContext(
)); | 68 m_notificationPresenter->cancelRequestsForPermission(scriptExecutionContext(
)); |
| 70 m_notificationPresenter = 0; | 69 m_notificationPresenter = 0; |
| 71 } | 70 } |
| 72 | 71 |
| 73 } // namespace WebCore | 72 } // namespace WebCore |
| 74 | 73 |
| 75 #endif // ENABLE(NOTIFICATIONS) | 74 #endif // ENABLE(NOTIFICATIONS) |
| OLD | NEW |