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

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

Issue 2408333004: Move persistent gesture state to Document, add DocumentUserGestureToken (Closed)
Patch Set: Switch back to checkign context->isDocument() 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/dom/Document.h
diff --git a/third_party/WebKit/Source/core/dom/Document.h b/third_party/WebKit/Source/core/dom/Document.h
index 0844a8866f7e44e8c80e1de6abf56ca11efc538d..b2d8da28af6afee0ced8f17575e26fa1a1e71b16 100644
--- a/third_party/WebKit/Source/core/dom/Document.h
+++ b/third_party/WebKit/Source/core/dom/Document.h
@@ -1290,6 +1290,14 @@ class CORE_EXPORT Document : public ContainerNode,
PropertyRegistry* propertyRegistry();
+ // Indicates whether the user has interacted with this particular Document.
+ void setHasReceivedUserGesture() { m_hasReceivedUserGesture = true; }
+ // Consume user interaction state. Used for an experiment that restricts
+ // adding history entries to Documents that have had a user gesture since
+ // last history state change.
+ void clearHasReceivedUserGesture() { m_hasReceivedUserGesture = false; }
+ bool hasReceivedUserGesture() const { return m_hasReceivedUserGesture; }
+
protected:
Document(const DocumentInit&, DocumentClassFlags = DefaultDocumentClass);
@@ -1534,6 +1542,7 @@ class CORE_EXPORT Document : public ContainerNode,
bool m_designMode;
bool m_isRunningExecCommand;
+ bool m_hasReceivedUserGesture;
HeapHashSet<WeakMember<const LiveNodeListBase>> m_listsInvalidatedAtDocument;
// Oilpan keeps track of all registered NodeLists.

Powered by Google App Engine
This is Rietveld 408576698