| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 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 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 162 return; | 162 return; |
| 163 | 163 |
| 164 if (m_persistentId.isEmpty()) { | 164 if (m_persistentId.isEmpty()) { |
| 165 // Fire the close event asynchronously. | 165 // Fire the close event asynchronously. |
| 166 executionContext()->postTask(FROM_HERE, createSameThreadTask(&Notificati
on::dispatchCloseEvent, this)); | 166 executionContext()->postTask(FROM_HERE, createSameThreadTask(&Notificati
on::dispatchCloseEvent, this)); |
| 167 | 167 |
| 168 m_state = NotificationStateClosing; | 168 m_state = NotificationStateClosing; |
| 169 notificationManager()->close(this); | 169 notificationManager()->close(this); |
| 170 } else { | 170 } else { |
| 171 m_state = NotificationStateClosed; | 171 m_state = NotificationStateClosed; |
| 172 notificationManager()->closePersistent(m_persistentId); | 172 |
| 173 SecurityOrigin* origin = executionContext()->securityOrigin(); |
| 174 ASSERT(origin); |
| 175 |
| 176 notificationManager()->closePersistent(WebSerializedOrigin(*origin), m_p
ersistentId); |
| 173 } | 177 } |
| 174 } | 178 } |
| 175 | 179 |
| 176 void Notification::dispatchShowEvent() | 180 void Notification::dispatchShowEvent() |
| 177 { | 181 { |
| 178 dispatchEvent(Event::create(EventTypeNames::show)); | 182 dispatchEvent(Event::create(EventTypeNames::show)); |
| 179 } | 183 } |
| 180 | 184 |
| 181 void Notification::dispatchClickEvent() | 185 void Notification::dispatchClickEvent() |
| 182 { | 186 { |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 268 return m_state == NotificationStateShowing || m_asyncRunner.isActive(); | 272 return m_state == NotificationStateShowing || m_asyncRunner.isActive(); |
| 269 } | 273 } |
| 270 | 274 |
| 271 DEFINE_TRACE(Notification) | 275 DEFINE_TRACE(Notification) |
| 272 { | 276 { |
| 273 RefCountedGarbageCollectedEventTargetWithInlineData<Notification>::trace(vis
itor); | 277 RefCountedGarbageCollectedEventTargetWithInlineData<Notification>::trace(vis
itor); |
| 274 ActiveDOMObject::trace(visitor); | 278 ActiveDOMObject::trace(visitor); |
| 275 } | 279 } |
| 276 | 280 |
| 277 } // namespace blink | 281 } // namespace blink |
| OLD | NEW |