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

Unified Diff: third_party/WebKit/Source/core/loader/FrameLoader.cpp

Issue 2408333004: Move persistent gesture state to Document, add DocumentUserGestureToken (Closed)
Patch Set: Rebase Created 4 years, 2 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/loader/FrameLoader.cpp
diff --git a/third_party/WebKit/Source/core/loader/FrameLoader.cpp b/third_party/WebKit/Source/core/loader/FrameLoader.cpp
index 65e9ac9a3c572fea1623484eeae2493b80234854..6b20b048b8861b21a2b09b1b9405b9dc2f71d8bb 100644
--- a/third_party/WebKit/Source/core/loader/FrameLoader.cpp
+++ b/third_party/WebKit/Source/core/loader/FrameLoader.cpp
@@ -395,7 +395,7 @@ void FrameLoader::setHistoryItemStateForCommit(
HistoryNavigationType navigationType) {
if (m_frame->settings()->historyEntryRequiresUserGesture() &&
historyCommitType == StandardCommit)
- UserGestureIndicator::clearProcessedUserGestureSinceLoad();
+ m_frame->document()->clearHasReceivedUserGesture();
Nate Chapin 2016/10/21 18:11:04 I moved this to updateForSameDocumentNavigation().
HistoryItem* oldItem = m_currentItem;
if (isBackForwardLoadType(loadType) && m_provisionalItem)
@@ -790,9 +790,9 @@ void FrameLoader::updateForSameDocumentNavigation(
if (!m_currentItem)
historyCommitType = HistoryInertCommit;
if (m_frame->settings()->historyEntryRequiresUserGesture() &&
- !UserGestureIndicator::processedUserGestureSinceLoad() &&
- initiatingDocument)
+ initiatingDocument && !initiatingDocument->hasReceivedUserGesture()) {
historyCommitType = HistoryInertCommit;
+ }
setHistoryItemStateForCommit(
type, historyCommitType,
@@ -937,8 +937,8 @@ FrameLoadType FrameLoader::determineFrameLoadType(
return FrameLoadTypeReload;
if (m_frame->settings()->historyEntryRequiresUserGesture() &&
- !UserGestureIndicator::processedUserGestureSinceLoad() &&
- request.originDocument())
+ request.originDocument() &&
+ !request.originDocument()->hasReceivedUserGesture())
return FrameLoadTypeReplaceCurrentItem;
return FrameLoadTypeStandard;
« no previous file with comments | « third_party/WebKit/Source/core/inspector/ThreadDebugger.cpp ('k') | third_party/WebKit/Source/core/page/DragController.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698