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 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 m_state = NotificationStateShowing; | 145 m_state = NotificationStateShowing; |
146 } | 146 } |
147 | 147 |
148 void Notification::close() | 148 void Notification::close() |
149 { | 149 { |
150 if (m_state != NotificationStateShowing) | 150 if (m_state != NotificationStateShowing) |
151 return; | 151 return; |
152 | 152 |
153 if (m_persistentId == kInvalidPersistentId) { | 153 if (m_persistentId == kInvalidPersistentId) { |
154 // Fire the close event asynchronously. | 154 // Fire the close event asynchronously. |
155 executionContext()->postTask(FROM_HERE, createSameThreadTask(&Notificati
on::dispatchCloseEvent, this)); | 155 executionContext()->postTask(BLINK_FROM_HERE, createSameThreadTask(&Noti
fication::dispatchCloseEvent, this)); |
156 | 156 |
157 m_state = NotificationStateClosing; | 157 m_state = NotificationStateClosing; |
158 notificationManager()->close(this); | 158 notificationManager()->close(this); |
159 } else { | 159 } else { |
160 m_state = NotificationStateClosed; | 160 m_state = NotificationStateClosed; |
161 | 161 |
162 SecurityOrigin* origin = executionContext()->securityOrigin(); | 162 SecurityOrigin* origin = executionContext()->securityOrigin(); |
163 ASSERT(origin); | 163 ASSERT(origin); |
164 | 164 |
165 notificationManager()->closePersistent(WebSecurityOrigin(origin), m_pers
istentId); | 165 notificationManager()->closePersistent(WebSecurityOrigin(origin), m_pers
istentId); |
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
358 return m_state == NotificationStateShowing || m_asyncRunner.isActive(); | 358 return m_state == NotificationStateShowing || m_asyncRunner.isActive(); |
359 } | 359 } |
360 | 360 |
361 DEFINE_TRACE(Notification) | 361 DEFINE_TRACE(Notification) |
362 { | 362 { |
363 RefCountedGarbageCollectedEventTargetWithInlineData<Notification>::trace(vis
itor); | 363 RefCountedGarbageCollectedEventTargetWithInlineData<Notification>::trace(vis
itor); |
364 ActiveDOMObject::trace(visitor); | 364 ActiveDOMObject::trace(visitor); |
365 } | 365 } |
366 | 366 |
367 } // namespace blink | 367 } // namespace blink |
OLD | NEW |