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

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

Issue 2408333004: Move persistent gesture state to Document, add DocumentUserGestureToken (Closed)
Patch Set: Re-add dropped null check 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 9b34e0ffcfb6d74f50b31fea2d377a344909514d..21ebb27a45c63282e458d10566a91706d621b098 100644
--- a/third_party/WebKit/Source/core/loader/FrameLoader.cpp
+++ b/third_party/WebKit/Source/core/loader/FrameLoader.cpp
@@ -393,10 +393,6 @@ void FrameLoader::setHistoryItemStateForCommit(
FrameLoadType loadType,
HistoryCommitType historyCommitType,
HistoryNavigationType navigationType) {
- if (m_frame->settings()->historyEntryRequiresUserGesture() &&
- historyCommitType == StandardCommit)
- UserGestureIndicator::clearProcessedUserGestureSinceLoad();
-
HistoryItem* oldItem = m_currentItem;
if (isBackForwardLoadType(loadType) && m_provisionalItem)
m_currentItem = m_provisionalItem.release();
@@ -789,10 +785,12 @@ void FrameLoader::updateForSameDocumentNavigation(
HistoryCommitType historyCommitType = loadTypeToCommitType(type);
if (!m_currentItem)
historyCommitType = HistoryInertCommit;
- if (m_frame->settings()->historyEntryRequiresUserGesture() &&
- !UserGestureIndicator::processedUserGestureSinceLoad() &&
- initiatingDocument)
- historyCommitType = HistoryInertCommit;
+ if (m_frame->settings()->historyEntryRequiresUserGesture()) {
+ if (initiatingDocument && !initiatingDocument->hasReceivedUserGesture())
+ historyCommitType = HistoryInertCommit;
+ else if (historyCommitType == StandardCommit)
+ m_frame->document()->clearHasReceivedUserGesture();
+ }
setHistoryItemStateForCommit(
type, historyCommitType,
@@ -937,8 +935,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