| 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 17 matching lines...) Expand all Loading... |
| 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/ExecutionContext.h" | 36 #include "core/dom/ExecutionContext.h" |
| 37 #include "core/dom/ExecutionContextTask.h" | 37 #include "core/dom/ExecutionContextTask.h" |
| 38 #include "core/dom/ScopedWindowFocusAllowedIndicator.h" |
| 38 #include "core/events/Event.h" | 39 #include "core/events/Event.h" |
| 39 #include "core/frame/UseCounter.h" | 40 #include "core/frame/UseCounter.h" |
| 40 #include "core/page/WindowFocusAllowedIndicator.h" | |
| 41 #include "modules/notifications/NotificationOptions.h" | 41 #include "modules/notifications/NotificationOptions.h" |
| 42 #include "modules/notifications/NotificationPermissionClient.h" | 42 #include "modules/notifications/NotificationPermissionClient.h" |
| 43 #include "public/platform/Platform.h" | 43 #include "public/platform/Platform.h" |
| 44 #include "public/platform/WebNotificationData.h" | 44 #include "public/platform/WebNotificationData.h" |
| 45 #include "public/platform/WebNotificationManager.h" | 45 #include "public/platform/WebNotificationManager.h" |
| 46 #include "public/platform/WebSerializedOrigin.h" | 46 #include "public/platform/WebSerializedOrigin.h" |
| 47 | 47 |
| 48 namespace blink { | 48 namespace blink { |
| 49 namespace { | 49 namespace { |
| 50 | 50 |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 } | 156 } |
| 157 | 157 |
| 158 void Notification::dispatchShowEvent() | 158 void Notification::dispatchShowEvent() |
| 159 { | 159 { |
| 160 dispatchEvent(Event::create(EventTypeNames::show)); | 160 dispatchEvent(Event::create(EventTypeNames::show)); |
| 161 } | 161 } |
| 162 | 162 |
| 163 void Notification::dispatchClickEvent() | 163 void Notification::dispatchClickEvent() |
| 164 { | 164 { |
| 165 UserGestureIndicator gestureIndicator(DefinitelyProcessingNewUserGesture); | 165 UserGestureIndicator gestureIndicator(DefinitelyProcessingNewUserGesture); |
| 166 WindowFocusAllowedIndicator windowFocusAllowed; | 166 ScopedWindowFocusAllowedIndicator windowFocusAllowed(executionContext()); |
| 167 dispatchEvent(Event::create(EventTypeNames::click)); | 167 dispatchEvent(Event::create(EventTypeNames::click)); |
| 168 } | 168 } |
| 169 | 169 |
| 170 void Notification::dispatchErrorEvent() | 170 void Notification::dispatchErrorEvent() |
| 171 { | 171 { |
| 172 dispatchEvent(Event::create(EventTypeNames::error)); | 172 dispatchEvent(Event::create(EventTypeNames::error)); |
| 173 } | 173 } |
| 174 | 174 |
| 175 void Notification::dispatchCloseEvent() | 175 void Notification::dispatchCloseEvent() |
| 176 { | 176 { |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 248 | 248 |
| 249 m_asyncRunner.stop(); | 249 m_asyncRunner.stop(); |
| 250 } | 250 } |
| 251 | 251 |
| 252 bool Notification::hasPendingActivity() const | 252 bool Notification::hasPendingActivity() const |
| 253 { | 253 { |
| 254 return m_state == NotificationStateShowing || m_asyncRunner.isActive(); | 254 return m_state == NotificationStateShowing || m_asyncRunner.isActive(); |
| 255 } | 255 } |
| 256 | 256 |
| 257 } // namespace blink | 257 } // namespace blink |
| OLD | NEW |