Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(202)

Side by Side Diff: Source/modules/notifications/Notification.cpp

Issue 985063002: Pass in the origin when closing a persistent notification. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | public/platform/modules/notifications/WebNotificationManager.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | public/platform/modules/notifications/WebNotificationManager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698