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

Unified Diff: Source/modules/serviceworkers/ServiceWorkerWindowClient.cpp

Issue 866983004: Allow creating new windows from a notificationclick event in SW. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebase Created 5 years, 10 months 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 side-by-side diff with in-line comments
Download patch
Index: Source/modules/serviceworkers/ServiceWorkerWindowClient.cpp
diff --git a/Source/modules/serviceworkers/ServiceWorkerWindowClient.cpp b/Source/modules/serviceworkers/ServiceWorkerWindowClient.cpp
index ef68824cde4d0336ef13de2b4283b7add179863d..7c6fa9c75a7859e150d481f982d4b4957a4c9ef1 100644
--- a/Source/modules/serviceworkers/ServiceWorkerWindowClient.cpp
+++ b/Source/modules/serviceworkers/ServiceWorkerWindowClient.cpp
@@ -76,11 +76,11 @@ ScriptPromise ServiceWorkerWindowClient::focus(ScriptState* scriptState)
RefPtrWillBeRawPtr<ScriptPromiseResolver> resolver = ScriptPromiseResolver::create(scriptState);
ScriptPromise promise = resolver->promise();
- if (!scriptState->executionContext()->isWindowFocusAllowed()) {
+ if (!scriptState->executionContext()->isWindowInteractionAllowed()) {
resolver->reject(DOMException::create(InvalidAccessError, "Not allowed to focus a window."));
return promise;
}
- scriptState->executionContext()->consumeWindowFocus();
+ scriptState->executionContext()->consumeWindowInteraction();
ServiceWorkerGlobalScopeClient::from(scriptState->executionContext())->focus(id(), new CallbackPromiseAdapter<ServiceWorkerWindowClient, ServiceWorkerError>(resolver));
return promise;
« no previous file with comments | « Source/modules/serviceworkers/ServiceWorkerGlobalScope.h ('k') | Source/modules/serviceworkers/WaitUntilObserver.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698