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

Side by Side Diff: Source/platform/PlatformWheelEvent.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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2004, 2005, 2006, 2009 Apple Inc. All rights reserved. 2 * Copyright (C) 2004, 2005, 2006, 2009 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 float deltaX() const { return m_deltaX; } 97 float deltaX() const { return m_deltaX; }
98 float deltaY() const { return m_deltaY; } 98 float deltaY() const { return m_deltaY; }
99 99
100 float wheelTicksX() const { return m_wheelTicksX; } 100 float wheelTicksX() const { return m_wheelTicksX; }
101 float wheelTicksY() const { return m_wheelTicksY; } 101 float wheelTicksY() const { return m_wheelTicksY; }
102 102
103 PlatformWheelEventGranularity granularity() const { return m_granularity; } 103 PlatformWheelEventGranularity granularity() const { return m_granularity; }
104 104
105 bool hasPreciseScrollingDeltas() const { return m_hasPreciseScrollingDeltas; } 105 bool hasPreciseScrollingDeltas() const { return m_hasPreciseScrollingDeltas; }
106 void setHasPreciseScrollingDeltas(bool b) { m_hasPreciseScrollingDeltas = b; } 106 void setHasPreciseScrollingDeltas(bool b) { m_hasPreciseScrollingDeltas = b; }
107
108 unsigned short buttons() const
109 {
110 unsigned short value = 0;
111
112 if (m_modifiers & LeftButtonDown)
113 value |= 1;
114 if (m_modifiers & RightButtonDown)
115 value |= 2;
116 if (m_modifiers & MiddleButtonDown)
117 value |= 4;
118
119 return value;
120 }
107 #if OS(MACOSX) 121 #if OS(MACOSX)
108 PlatformWheelEventPhase phase() const { return m_phase; } 122 PlatformWheelEventPhase phase() const { return m_phase; }
109 PlatformWheelEventPhase momentumPhase() const { return m_momentumPhase; } 123 PlatformWheelEventPhase momentumPhase() const { return m_momentumPhase; }
110 bool useLatchedEventNode() const { return m_momentumPhase == PlatformWheelEv entPhaseBegan || m_momentumPhase == PlatformWheelEventPhaseChanged; } 124 bool useLatchedEventNode() const { return m_momentumPhase == PlatformWheelEv entPhaseBegan || m_momentumPhase == PlatformWheelEventPhaseChanged; }
111 bool canRubberbandLeft() const { return m_canRubberbandLeft; } 125 bool canRubberbandLeft() const { return m_canRubberbandLeft; }
112 bool canRubberbandRight() const { return m_canRubberbandRight; } 126 bool canRubberbandRight() const { return m_canRubberbandRight; }
113 #else 127 #else
114 bool useLatchedEventNode() const { return false; } 128 bool useLatchedEventNode() const { return false; }
115 #endif 129 #endif
116 130
(...skipping 10 matching lines...) Expand all
127 PlatformWheelEventPhase m_phase; 141 PlatformWheelEventPhase m_phase;
128 PlatformWheelEventPhase m_momentumPhase; 142 PlatformWheelEventPhase m_momentumPhase;
129 bool m_canRubberbandLeft; 143 bool m_canRubberbandLeft;
130 bool m_canRubberbandRight; 144 bool m_canRubberbandRight;
131 #endif 145 #endif
132 }; 146 };
133 147
134 } // namespace blink 148 } // namespace blink
135 149
136 #endif // PlatformWheelEvent_h 150 #endif // PlatformWheelEvent_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698