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

Unified Diff: third_party/WebKit/Source/core/dom/DocumentUserGestureToken.h

Issue 2625773002: Reenable framebusting (Closed)
Patch Set: Pass through FrameReplicationState Created 3 years, 11 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: third_party/WebKit/Source/core/dom/DocumentUserGestureToken.h
diff --git a/third_party/WebKit/Source/core/dom/DocumentUserGestureToken.h b/third_party/WebKit/Source/core/dom/DocumentUserGestureToken.h
index d4cd560b21112be05f6d9490d75fc9094af9825b..f8b99021f02be08cea177f8e3de69cf2cc45670c 100644
--- a/third_party/WebKit/Source/core/dom/DocumentUserGestureToken.h
+++ b/third_party/WebKit/Source/core/dom/DocumentUserGestureToken.h
@@ -7,6 +7,7 @@
#include "core/dom/Document.h"
#include "core/frame/LocalFrame.h"
+#include "core/loader/FrameLoaderClient.h"
#include "platform/UserGestureIndicator.h"
namespace blink {
@@ -36,12 +37,10 @@ class DocumentUserGestureToken final : public UserGestureToken {
DocumentUserGestureToken(Status status) : UserGestureToken(status) {}
static void setHasReceivedUserGesture(Document* document) {
- if (!document || document->hasReceivedUserGesture())
- return;
- document->setHasReceivedUserGesture();
- for (Frame* frame = document->frame()->tree().parent(); frame;
- frame = frame->tree().parent()) {
- frame->setDocumentHasReceivedUserGesture();
+ if (document && document->frame() &&
+ !document->frame()->hasReceivedUserGesture()) {
+ document->frame()->setDocumentHasReceivedUserGesture();
+ document->frame()->loader().client()->setHasReceivedUserGesture();
}
}
};
« no previous file with comments | « third_party/WebKit/Source/core/dom/Document.cpp ('k') | third_party/WebKit/Source/core/dom/DocumentUserGestureTokenTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698