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

Side by Side Diff: third_party/WebKit/Source/core/dom/DocumentUserGestureToken.h

Issue 2408333004: Move persistent gesture state to Document, add DocumentUserGestureToken (Closed)
Patch Set: Add TODO, null check toNode() result in PointerEventManager Created 4 years, 1 month 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef DocumentUserGestureToken_h
6 #define DocumentUserGestureToken_h
7
8 #include "core/dom/Document.h"
9 #include "platform/UserGestureIndicator.h"
10
11 namespace blink {
12
13 // Associates a UserGestureToken with a Document, if a non-null Document*
14 // is provided in the constructor.
15 class DocumentUserGestureToken final : public UserGestureToken {
16 WTF_MAKE_NONCOPYABLE(DocumentUserGestureToken);
17
18 public:
19 static PassRefPtr<UserGestureToken> create(
20 Document* document,
21 Status status = PossiblyExistingGesture) {
22 return adoptRef(new DocumentUserGestureToken(document, status));
23 }
24
25 ~DocumentUserGestureToken() final {}
26
27 private:
28 DocumentUserGestureToken(Document* document, Status status)
29 : UserGestureToken(status) {
30 // TODO(japhet): This doesn't work if an ancestor is remote.
31 // See http://crbug.com/658800
Charlie Reis 2016/10/24 21:38:16 What are the consequences of leaving this as a TOD
32 for (; document; document = document->parentDocument()) {
33 if (document)
34 document->setHasReceivedUserGesture();
35 }
36 }
37 };
38
39 } // namespace blink
40
41 #endif // DocumentUserGestureToken_h
OLDNEW
« 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