OLD | NEW |
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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 int getPointerEventId(const WebPointerProperties&) const; | 74 int getPointerEventId(const WebPointerProperties&) const; |
75 | 75 |
76 static const int s_mouseId; | 76 static const int s_mouseId; |
77 | 77 |
78 private: | 78 private: |
79 typedef WTF::UnsignedWithZeroKeyHashTraits<int> UnsignedHash; | 79 typedef WTF::UnsignedWithZeroKeyHashTraits<int> UnsignedHash; |
80 typedef struct IncomingId : public std::pair<int, int> { | 80 typedef struct IncomingId : public std::pair<int, int> { |
81 IncomingId() {} | 81 IncomingId() {} |
82 IncomingId(WebPointerProperties::PointerType pointerType, int rawId) | 82 IncomingId(WebPointerProperties::PointerType pointerType, int rawId) |
83 : std::pair<int, int>(static_cast<int>(pointerType), rawId) {} | 83 : std::pair<int, int>(static_cast<int>(pointerType), rawId) {} |
84 int pointerType() const { return first; } | 84 int pointerTypeInt() const { return first; } |
| 85 WebPointerProperties::PointerType pointerType() const { |
| 86 return static_cast<WebPointerProperties::PointerType>(first); |
| 87 } |
85 int rawId() const { return second; } | 88 int rawId() const { return second; } |
86 } IncomingId; | 89 } IncomingId; |
87 typedef struct PointerAttributes { | 90 typedef struct PointerAttributes { |
88 IncomingId incomingId; | 91 IncomingId incomingId; |
89 bool isActiveButtons; | 92 bool isActiveButtons; |
90 PointerAttributes() : incomingId(), isActiveButtons(false) {} | 93 PointerAttributes() : incomingId(), isActiveButtons(false) {} |
91 PointerAttributes(IncomingId incomingId, unsigned isActiveButtons) | 94 PointerAttributes(IncomingId incomingId, unsigned isActiveButtons) |
92 : incomingId(incomingId), isActiveButtons(isActiveButtons) {} | 95 : incomingId(incomingId), isActiveButtons(isActiveButtons) {} |
93 } PointerAttributes; | 96 } PointerAttributes; |
94 | 97 |
(...skipping 23 matching lines...) Expand all Loading... |
118 int m_primaryId[static_cast<int>( | 121 int m_primaryId[static_cast<int>( |
119 WebPointerProperties::PointerType::LastEntry) + | 122 WebPointerProperties::PointerType::LastEntry) + |
120 1]; | 123 1]; |
121 int m_idCount[static_cast<int>(WebPointerProperties::PointerType::LastEntry) + | 124 int m_idCount[static_cast<int>(WebPointerProperties::PointerType::LastEntry) + |
122 1]; | 125 1]; |
123 }; | 126 }; |
124 | 127 |
125 } // namespace blink | 128 } // namespace blink |
126 | 129 |
127 #endif // PointerEventFactory_h | 130 #endif // PointerEventFactory_h |
OLD | NEW |