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

Side by Side Diff: third_party/WebKit/Source/core/events/PointerEventFactory.h

Issue 2174863002: Change mouse pointer event targets to the capturing node (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Variable name change Created 4 years, 4 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef PointerEventFactory_h 5 #ifndef PointerEventFactory_h
6 #define PointerEventFactory_h 6 #define PointerEventFactory_h
7 7
8 #include "core/CoreExport.h" 8 #include "core/CoreExport.h"
9 #include "core/events/PointerEvent.h" 9 #include "core/events/PointerEvent.h"
10 #include "public/platform/WebPointerProperties.h" 10 #include "public/platform/WebPointerProperties.h"
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 // Returns whether a pointer id exists and active. 68 // Returns whether a pointer id exists and active.
69 bool isActive(const int) const; 69 bool isActive(const int) const;
70 70
71 // Returns whether a pointer id exists and has at least one pressed button. 71 // Returns whether a pointer id exists and has at least one pressed button.
72 bool isActiveButtonsState(const int) const; 72 bool isActiveButtonsState(const int) const;
73 73
74 // Returns the id of the pointer event corresponding to the given pointer 74 // Returns the id of the pointer event corresponding to the given pointer
75 // properties if exists otherwise s_invalidId. 75 // properties if exists otherwise s_invalidId.
76 int getPointerEventId(const WebPointerProperties&) const; 76 int getPointerEventId(const WebPointerProperties&) const;
77 77
78 static const int s_mouseId;
79
78 private: 80 private:
79 typedef WTF::UnsignedWithZeroKeyHashTraits<int> UnsignedHash; 81 typedef WTF::UnsignedWithZeroKeyHashTraits<int> UnsignedHash;
80 typedef struct IncomingId : public std::pair<int, int> { 82 typedef struct IncomingId : public std::pair<int, int> {
81 IncomingId() {} 83 IncomingId() {}
82 IncomingId(WebPointerProperties::PointerType pointerType, 84 IncomingId(WebPointerProperties::PointerType pointerType,
83 int rawId) 85 int rawId)
84 : std::pair<int, int>(static_cast<int>(pointerType), rawId) {} 86 : std::pair<int, int>(static_cast<int>(pointerType), rawId) {}
85 int pointerType() const {return first;} 87 int pointerType() const {return first;}
86 int rawId() const {return second;} 88 int rawId() const {return second;}
87 } IncomingId; 89 } IncomingId;
88 typedef struct PointerAttributes { 90 typedef struct PointerAttributes {
89 IncomingId incomingId; 91 IncomingId incomingId;
90 bool isActiveButtons; 92 bool isActiveButtons;
91 PointerAttributes() {} 93 PointerAttributes() {}
92 PointerAttributes(IncomingId incomingId, unsigned isActiveButtons) 94 PointerAttributes(IncomingId incomingId, unsigned isActiveButtons)
93 : incomingId(incomingId) 95 : incomingId(incomingId)
94 , isActiveButtons(isActiveButtons) {} 96 , isActiveButtons(isActiveButtons) {}
95 } PointerAttributes; 97 } PointerAttributes;
96 98
97 int addIdAndActiveButtons(const IncomingId, bool isActiveButtons); 99 int addIdAndActiveButtons(const IncomingId, bool isActiveButtons);
98 bool isPrimary(const int) const; 100 bool isPrimary(const int) const;
99 void setIdTypeButtons(PointerEventInit&, const WebPointerProperties&, 101 void setIdTypeButtons(PointerEventInit&, const WebPointerProperties&,
100 unsigned buttons); 102 unsigned buttons);
101 void setBubblesAndCancelable(PointerEventInit&, const AtomicString& type); 103 void setBubblesAndCancelable(PointerEventInit&, const AtomicString& type);
102 104
103 static const int s_invalidId; 105 static const int s_invalidId;
104 static const int s_mouseId;
105 106
106 int m_currentId; 107 int m_currentId;
107 HashMap<IncomingId, int, WTF::PairHash<int, int>, WTF::PairHashTraits<Unsign edHash, UnsignedHash>> m_pointerIncomingIdMapping; 108 HashMap<IncomingId, int, WTF::PairHash<int, int>, WTF::PairHashTraits<Unsign edHash, UnsignedHash>> m_pointerIncomingIdMapping;
108 HashMap<int, PointerAttributes, WTF::IntHash<int>, UnsignedHash> m_pointerId Mapping; 109 HashMap<int, PointerAttributes, WTF::IntHash<int>, UnsignedHash> m_pointerId Mapping;
109 int m_primaryId[static_cast<int>(WebPointerProperties::PointerType::LastEntr y) + 1]; 110 int m_primaryId[static_cast<int>(WebPointerProperties::PointerType::LastEntr y) + 1];
110 int m_idCount[static_cast<int>(WebPointerProperties::PointerType::LastEntry) + 1]; 111 int m_idCount[static_cast<int>(WebPointerProperties::PointerType::LastEntry) + 1];
111 }; 112 };
112 113
113 } // namespace blink 114 } // namespace blink
114 115
115 #endif // PointerEventFactory_h 116 #endif // PointerEventFactory_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698