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

Unified Diff: Source/core/frame/LocalDOMWindow.cpp

Issue 803253003: Revert of 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: 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
Index: Source/core/frame/LocalDOMWindow.cpp
diff --git a/Source/core/frame/LocalDOMWindow.cpp b/Source/core/frame/LocalDOMWindow.cpp
index a8c7f5c59251eedb3712d86b8bbe7b854872f388..926de144193cf533bef0b4ef1472bf2137363d95 100644
--- a/Source/core/frame/LocalDOMWindow.cpp
+++ b/Source/core/frame/LocalDOMWindow.cpp
@@ -976,19 +976,20 @@
if (!host)
return;
- ASSERT(context);
-
- bool allowFocus = context->isWindowFocusAllowed();
- if (allowFocus) {
- context->consumeWindowFocus();
- } else {
+ bool allowFocus = WindowFocusAllowedIndicator::windowFocusAllowed();
+ if (context) {
ASSERT(isMainThread());
- allowFocus = opener() && (opener() != this) && (toDocument(context)->domWindow() == opener());
+ Document* activeDocument = toDocument(context);
+ if (opener() && opener() != this && activeDocument->domWindow() == opener())
+ allowFocus = true;
}
// If we're a top level window, bring the window to the front.
if (frame()->isMainFrame() && allowFocus)
host->chrome().focus();
+
+ if (!frame())
+ return;
frame()->eventHandler().focusDocumentView();
}
« no previous file with comments | « Source/core/dom/ScopedWindowFocusAllowedIndicator.cpp ('k') | Source/modules/notifications/Notification.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698