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

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

Issue 804163002: Revert 186849 "Bind Window focus ability to the ExecutionContext..." (Closed) Base URL: svn://svn.chromium.org/blink/branches/chromium/2250/
Patch Set: Created 6 years 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
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 15 matching lines...) Expand all
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 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 } 149 }
150 150
151 void Notification::dispatchShowEvent() 151 void Notification::dispatchShowEvent()
152 { 152 {
153 dispatchEvent(Event::create(EventTypeNames::show)); 153 dispatchEvent(Event::create(EventTypeNames::show));
154 } 154 }
155 155
156 void Notification::dispatchClickEvent() 156 void Notification::dispatchClickEvent()
157 { 157 {
158 UserGestureIndicator gestureIndicator(DefinitelyProcessingNewUserGesture); 158 UserGestureIndicator gestureIndicator(DefinitelyProcessingNewUserGesture);
159 ScopedWindowFocusAllowedIndicator windowFocusAllowed(executionContext()); 159 WindowFocusAllowedIndicator windowFocusAllowed;
160 dispatchEvent(Event::create(EventTypeNames::click)); 160 dispatchEvent(Event::create(EventTypeNames::click));
161 } 161 }
162 162
163 void Notification::dispatchErrorEvent() 163 void Notification::dispatchErrorEvent()
164 { 164 {
165 dispatchEvent(Event::create(EventTypeNames::error)); 165 dispatchEvent(Event::create(EventTypeNames::error));
166 } 166 }
167 167
168 void Notification::dispatchCloseEvent() 168 void Notification::dispatchCloseEvent()
169 { 169 {
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
236 236
237 m_asyncRunner.stop(); 237 m_asyncRunner.stop();
238 } 238 }
239 239
240 bool Notification::hasPendingActivity() const 240 bool Notification::hasPendingActivity() const
241 { 241 {
242 return m_state == NotificationStateShowing || m_asyncRunner.isActive(); 242 return m_state == NotificationStateShowing || m_asyncRunner.isActive();
243 } 243 }
244 244
245 } // namespace blink 245 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/frame/LocalDOMWindow.cpp ('k') | Source/modules/serviceworkers/ServiceWorkerClient.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698