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

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

Issue 745713003: Mark the Notification as being closed before dispatching the event. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 1 month 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 | no next file » | 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 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 dispatchEvent(Event::create(EventTypeNames::click)); 132 dispatchEvent(Event::create(EventTypeNames::click));
133 } 133 }
134 134
135 void Notification::dispatchErrorEvent() 135 void Notification::dispatchErrorEvent()
136 { 136 {
137 dispatchEvent(Event::create(EventTypeNames::error)); 137 dispatchEvent(Event::create(EventTypeNames::error));
138 } 138 }
139 139
140 void Notification::dispatchCloseEvent() 140 void Notification::dispatchCloseEvent()
141 { 141 {
142 m_state = NotificationStateClosed;
142 dispatchEvent(Event::create(EventTypeNames::close)); 143 dispatchEvent(Event::create(EventTypeNames::close));
143 m_state = NotificationStateClosed;
144 } 144 }
145 145
146 TextDirection Notification::direction() const 146 TextDirection Notification::direction() const
147 { 147 {
148 // FIXME: Resolve dir()=="auto" against the document. 148 // FIXME: Resolve dir()=="auto" against the document.
149 return dir() == "rtl" ? RTL : LTR; 149 return dir() == "rtl" ? RTL : LTR;
150 } 150 }
151 151
152 const String& Notification::permissionString(WebNotificationPermission permissio n) 152 const String& Notification::permissionString(WebNotificationPermission permissio n)
153 { 153 {
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
208 208
209 m_asyncRunner.stop(); 209 m_asyncRunner.stop();
210 } 210 }
211 211
212 bool Notification::hasPendingActivity() const 212 bool Notification::hasPendingActivity() const
213 { 213 {
214 return m_state == NotificationStateShowing || m_asyncRunner.isActive(); 214 return m_state == NotificationStateShowing || m_asyncRunner.isActive();
215 } 215 }
216 216
217 } // namespace blink 217 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698