| 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 15 matching lines...) Expand all Loading... |
| 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 29 */ | 29 */ |
| 30 | 30 |
| 31 #include "config.h" | 31 #include "config.h" |
| 32 #include "modules/notifications/Notification.h" | 32 #include "modules/notifications/Notification.h" |
| 33 | 33 |
| 34 #include "bindings/core/v8/ScriptWrappable.h" | 34 #include "bindings/core/v8/ScriptWrappable.h" |
| 35 #include "core/dom/Document.h" | 35 #include "core/dom/Document.h" |
| 36 #include "core/dom/ScopedWindowFocusAllowedIndicator.h" | |
| 37 #include "core/events/Event.h" | 36 #include "core/events/Event.h" |
| 38 #include "core/frame/UseCounter.h" | 37 #include "core/frame/UseCounter.h" |
| 38 #include "core/page/WindowFocusAllowedIndicator.h" |
| 39 #include "modules/notifications/NotificationOptions.h" | 39 #include "modules/notifications/NotificationOptions.h" |
| 40 #include "modules/notifications/NotificationPermissionClient.h" | 40 #include "modules/notifications/NotificationPermissionClient.h" |
| 41 #include "public/platform/Platform.h" | 41 #include "public/platform/Platform.h" |
| 42 #include "public/platform/WebNotificationData.h" | 42 #include "public/platform/WebNotificationData.h" |
| 43 #include "public/platform/WebNotificationManager.h" | 43 #include "public/platform/WebNotificationManager.h" |
| 44 #include "public/platform/WebSerializedOrigin.h" | 44 #include "public/platform/WebSerializedOrigin.h" |
| 45 | 45 |
| 46 namespace blink { | 46 namespace blink { |
| 47 namespace { | 47 namespace { |
| 48 | 48 |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 } | 121 } |
| 122 | 122 |
| 123 void Notification::dispatchShowEvent() | 123 void Notification::dispatchShowEvent() |
| 124 { | 124 { |
| 125 dispatchEvent(Event::create(EventTypeNames::show)); | 125 dispatchEvent(Event::create(EventTypeNames::show)); |
| 126 } | 126 } |
| 127 | 127 |
| 128 void Notification::dispatchClickEvent() | 128 void Notification::dispatchClickEvent() |
| 129 { | 129 { |
| 130 UserGestureIndicator gestureIndicator(DefinitelyProcessingNewUserGesture); | 130 UserGestureIndicator gestureIndicator(DefinitelyProcessingNewUserGesture); |
| 131 ScopedWindowFocusAllowedIndicator windowFocusAllowed(executionContext()); | 131 WindowFocusAllowedIndicator windowFocusAllowed; |
| 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 { |
| (...skipping 66 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 |