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

Unified Diff: ui/events/event.h

Issue 2786693002: Add PointerDetails to ui::MouseEvent's constructors (Closed)
Patch Set: mouse constructor Created 3 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/events/blink/web_input_event_unittest.cc ('k') | ui/events/event.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/events/event.h
diff --git a/ui/events/event.h b/ui/events/event.h
index 16dce04e3a44e5133e15b5ddc442d38b83d6c56f..b6ffd82d90252ebb8cb48a4888d98649247ff3fe 100644
--- a/ui/events/event.h
+++ b/ui/events/event.h
@@ -481,6 +481,8 @@ struct EVENTS_EXPORT PointerDetails {
class EVENTS_EXPORT MouseEvent : public LocatedEvent {
public:
+ static const int32_t kMousePointerId;
+
explicit MouseEvent(const base::NativeEvent& native_event);
// |pointer_event.IsMousePointerEvent()| must be true.
@@ -519,7 +521,10 @@ class EVENTS_EXPORT MouseEvent : public LocatedEvent {
const gfx::Point& root_location,
base::TimeTicks time_stamp,
int flags,
- int changed_button_flags);
+ int changed_button_flags,
+ const PointerDetails& pointer_details =
+ PointerDetails(EventPointerType::POINTER_TYPE_MOUSE,
+ kMousePointerId));
// Conveniences to quickly test what button is down
bool IsOnlyLeftMouseButton() const {
@@ -581,7 +586,6 @@ class EVENTS_EXPORT MouseEvent : public LocatedEvent {
// Event details common to MouseEvent and TouchEvent.
const PointerDetails& pointer_details() const { return pointer_details_; }
- void set_pointer_details(const PointerDetails& details);
private:
FRIEND_TEST_ALL_PREFIXES(EventTest, DoubleClickRequiresRelease);
@@ -733,8 +737,6 @@ class EVENTS_EXPORT TouchEvent : public LocatedEvent {
class EVENTS_EXPORT PointerEvent : public LocatedEvent {
public:
- static const int32_t kMousePointerId;
-
// Returns true if a PointerEvent can be constructed from |event|. Currently,
// only mouse and touch events can be converted to pointer events.
static bool CanConvertFrom(const Event& event);
« no previous file with comments | « ui/events/blink/web_input_event_unittest.cc ('k') | ui/events/event.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698