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

Unified Diff: Source/modules/serviceworkers/ServiceWorkerClient.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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/modules/notifications/Notification.cpp ('k') | Source/modules/serviceworkers/WaitUntilObserver.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/serviceworkers/ServiceWorkerClient.cpp
===================================================================
--- Source/modules/serviceworkers/ServiceWorkerClient.cpp (revision 187183)
+++ Source/modules/serviceworkers/ServiceWorkerClient.cpp (working copy)
@@ -9,7 +9,6 @@
#include "bindings/core/v8/ExceptionState.h"
#include "bindings/core/v8/ScriptPromiseResolver.h"
#include "bindings/core/v8/SerializedScriptValue.h"
-#include "core/page/WindowFocusAllowedIndicator.h"
#include "modules/serviceworkers/ServiceWorkerError.h"
#include "modules/serviceworkers/ServiceWorkerGlobalScopeClient.h"
#include "public/platform/WebString.h"
@@ -74,11 +73,9 @@
RefPtr<ScriptPromiseResolver> resolver = ScriptPromiseResolver::create(scriptState);
ScriptPromise promise = resolver->promise();
- if (!scriptState->executionContext()->isWindowFocusAllowed()) {
- resolver->resolve(false);
- return promise;
- }
- scriptState->executionContext()->consumeWindowFocus();
+ // FIXME: there should be a check for whether the caller is allowed to focus
+ // the client. The promise should succeed with |false| if the call is not
+ // allowed. https://crbug.com/437149
ServiceWorkerGlobalScopeClient::from(scriptState->executionContext())->focus(m_id, new CallbackPromiseAdapter<bool, ServiceWorkerError>(resolver));
return promise;
« no previous file with comments | « Source/modules/notifications/Notification.cpp ('k') | Source/modules/serviceworkers/WaitUntilObserver.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698