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 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 Loading... |
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 |
OLD | NEW |