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

Side by Side Diff: third_party/WebKit/Source/core/events/MouseEvent.cpp

Issue 2542693002: Use WTF::TimeTicks to represent timestamp in Platform/Core event types (Closed)
Patch Set: rebase Created 4 years 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) 2001 Peter Kelly (pmk@post.com) 2 * Copyright (C) 2001 Peter Kelly (pmk@post.com)
3 * Copyright (C) 2001 Tobias Anton (anton@stud.fbi.fh-darmstadt.de) 3 * Copyright (C) 2001 Tobias Anton (anton@stud.fbi.fh-darmstadt.de)
4 * Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com) 4 * Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com)
5 * Copyright (C) 2003, 2005, 2006, 2008 Apple Inc. All rights reserved. 5 * Copyright (C) 2003, 2005, 2006, 2008 Apple Inc. All rights reserved.
6 * 6 *
7 * This library is free software; you can redistribute it and/or 7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public 8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either 9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version. 10 * version 2 of the License, or (at your option) any later version.
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 int screenX, 70 int screenX,
71 int screenY, 71 int screenY,
72 int windowX, 72 int windowX,
73 int windowY, 73 int windowY,
74 int movementX, 74 int movementX,
75 int movementY, 75 int movementY,
76 PlatformEvent::Modifiers modifiers, 76 PlatformEvent::Modifiers modifiers,
77 short button, 77 short button,
78 unsigned short buttons, 78 unsigned short buttons,
79 EventTarget* relatedTarget, 79 EventTarget* relatedTarget,
80 double platformTimeStamp, 80 TimeTicks platformTimeStamp,
81 PlatformMouseEvent::SyntheticEventType syntheticEventType, 81 PlatformMouseEvent::SyntheticEventType syntheticEventType,
82 const String& region, 82 const String& region,
83 const PlatformMouseEvent* mouseEvent) { 83 const PlatformMouseEvent* mouseEvent) {
84 return new MouseEvent( 84 return new MouseEvent(
85 type, canBubble, cancelable, view, detail, screenX, screenY, windowX, 85 type, canBubble, cancelable, view, detail, screenX, screenY, windowX,
86 windowY, movementX, movementY, modifiers, button, buttons, relatedTarget, 86 windowY, movementX, movementY, modifiers, button, buttons, relatedTarget,
87 platformTimeStamp, syntheticEventType, region, mouseEvent); 87 platformTimeStamp, syntheticEventType, region, mouseEvent);
88 } 88 }
89 89
90 MouseEvent* MouseEvent::create(const AtomicString& eventType, 90 MouseEvent* MouseEvent::create(const AtomicString& eventType,
(...skipping 10 matching lines...) Expand all
101 PlatformMouseEvent::Positionless; 101 PlatformMouseEvent::Positionless;
102 int screenX = 0; 102 int screenX = 0;
103 int screenY = 0; 103 int screenY = 0;
104 if (underlyingEvent && underlyingEvent->isMouseEvent()) { 104 if (underlyingEvent && underlyingEvent->isMouseEvent()) {
105 syntheticType = PlatformMouseEvent::RealOrIndistinguishable; 105 syntheticType = PlatformMouseEvent::RealOrIndistinguishable;
106 MouseEvent* mouseEvent = toMouseEvent(underlyingEvent); 106 MouseEvent* mouseEvent = toMouseEvent(underlyingEvent);
107 screenX = mouseEvent->screenX(); 107 screenX = mouseEvent->screenX();
108 screenY = mouseEvent->screenY(); 108 screenY = mouseEvent->screenY();
109 } 109 }
110 110
111 double timestamp = underlyingEvent ? underlyingEvent->platformTimeStamp() 111 TimeTicks timestamp =
112 : monotonicallyIncreasingTime(); 112 underlyingEvent ? underlyingEvent->platformTimeStamp() : TimeTicks::Now();
113 MouseEvent* createdEvent = MouseEvent::create( 113 MouseEvent* createdEvent = MouseEvent::create(
114 eventType, true, true, view, 0, screenX, screenY, 0, 0, 0, 0, modifiers, 114 eventType, true, true, view, 0, screenX, screenY, 0, 0, 0, 0, modifiers,
115 0, 0, nullptr, timestamp, syntheticType, String(), nullptr); 115 0, 0, nullptr, timestamp, syntheticType, String(), nullptr);
116 116
117 createdEvent->setTrusted(creationScope == 117 createdEvent->setTrusted(creationScope ==
118 SimulatedClickCreationScope::FromUserAgent); 118 SimulatedClickCreationScope::FromUserAgent);
119 createdEvent->setUnderlyingEvent(underlyingEvent); 119 createdEvent->setUnderlyingEvent(underlyingEvent);
120 if (syntheticType == PlatformMouseEvent::RealOrIndistinguishable) { 120 if (syntheticType == PlatformMouseEvent::RealOrIndistinguishable) {
121 MouseEvent* mouseEvent = toMouseEvent(createdEvent->underlyingEvent()); 121 MouseEvent* mouseEvent = toMouseEvent(createdEvent->underlyingEvent());
122 createdEvent->initCoordinates(mouseEvent->clientX(), mouseEvent->clientY()); 122 createdEvent->initCoordinates(mouseEvent->clientX(), mouseEvent->clientY());
(...skipping 17 matching lines...) Expand all
140 int screenX, 140 int screenX,
141 int screenY, 141 int screenY,
142 int windowX, 142 int windowX,
143 int windowY, 143 int windowY,
144 int movementX, 144 int movementX,
145 int movementY, 145 int movementY,
146 PlatformEvent::Modifiers modifiers, 146 PlatformEvent::Modifiers modifiers,
147 short button, 147 short button,
148 unsigned short buttons, 148 unsigned short buttons,
149 EventTarget* relatedTarget, 149 EventTarget* relatedTarget,
150 double platformTimeStamp, 150 TimeTicks platformTimeStamp,
151 PlatformMouseEvent::SyntheticEventType syntheticEventType, 151 PlatformMouseEvent::SyntheticEventType syntheticEventType,
152 const String& region, 152 const String& region,
153 const PlatformMouseEvent* mouseEvent) 153 const PlatformMouseEvent* mouseEvent)
154 : MouseRelatedEvent( 154 : MouseRelatedEvent(
155 eventType, 155 eventType,
156 canBubble, 156 canBubble,
157 cancelable, 157 cancelable,
158 view, 158 view,
159 detail, 159 detail,
160 IntPoint(screenX, screenY), 160 IntPoint(screenX, screenY),
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
366 DispatchEventResult doubleClickDispatchResult = 366 DispatchEventResult doubleClickDispatchResult =
367 EventDispatcher::dispatchEvent( 367 EventDispatcher::dispatchEvent(
368 dispatcher.node(), 368 dispatcher.node(),
369 MouseEventDispatchMediator::create(doubleClickEvent)); 369 MouseEventDispatchMediator::create(doubleClickEvent));
370 if (doubleClickDispatchResult != DispatchEventResult::NotCanceled) 370 if (doubleClickDispatchResult != DispatchEventResult::NotCanceled)
371 return doubleClickDispatchResult; 371 return doubleClickDispatchResult;
372 return dispatchResult; 372 return dispatchResult;
373 } 373 }
374 374
375 } // namespace blink 375 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/events/MouseEvent.h ('k') | third_party/WebKit/Source/core/events/MouseRelatedEvent.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698