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

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

Issue 777483004: Bind Window focus ability to the ExecutionContext instead of the process. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@sw_client_focus
Patch Set: rebase 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
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 17 matching lines...) Expand all
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
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
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
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