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

Unified Diff: Source/platform/PlatformMouseEvent.h

Issue 727593003: Implement MouseEvent buttons attribute. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 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 side-by-side diff with in-line comments
Download patch
Index: Source/platform/PlatformMouseEvent.h
diff --git a/Source/platform/PlatformMouseEvent.h b/Source/platform/PlatformMouseEvent.h
index 488bd0c211c910e5137fe452603608f3484de634..bf95e7c5d5e59796fd939322b1f94aa901bb8e6f 100644
--- a/Source/platform/PlatformMouseEvent.h
+++ b/Source/platform/PlatformMouseEvent.h
@@ -95,6 +95,23 @@ public:
bool fromTouch() const { return m_synthesized == FromTouch; }
SyntheticEventType syntheticEventType() const { return m_synthesized; }
+ unsigned short buttons() const
Rick Byers 2014/11/18 20:29:19 And actually, it doesn't really make sense for Pla
zino 2014/11/24 13:07:08 Done.
+ {
+ if (fromTouch())
+ return 1;
Rick Byers 2014/11/18 20:29:19 This logic doesn't belong here, the caller should
zino 2014/11/24 13:07:08 Done.
Rick Byers 2014/11/25 17:44:27 I still don't see why we should change the Platfor
zino 2014/11/28 02:37:07 Here
zino 2014/11/28 12:29:28 Done
+
+ unsigned short value = 0;
+
+ if (m_modifiers & LeftButtonDown)
+ value |= 1;
+ if (m_modifiers & RightButtonDown)
+ value |= 2;
+ if (m_modifiers & MiddleButtonDown)
+ value |= 4;
+
+ return value;
+ }
+
protected:
IntPoint m_position;
IntPoint m_globalPosition;

Powered by Google App Engine
This is Rietveld 408576698