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

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

Issue 2296303002: Make a pen in eraser mode visible thru PointerEvent.buttons (Closed)
Patch Set: Moved Buttons to WebPointerProperties, fixed button val, rebased. Created 4 years, 3 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 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 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 143
144 MouseEvent::~MouseEvent() 144 MouseEvent::~MouseEvent()
145 { 145 {
146 } 146 }
147 147
148 unsigned short MouseEvent::platformModifiersToButtons(unsigned modifiers) 148 unsigned short MouseEvent::platformModifiersToButtons(unsigned modifiers)
149 { 149 {
150 unsigned short buttons = 0; 150 unsigned short buttons = 0;
151 151
152 if (modifiers & PlatformEvent::LeftButtonDown) 152 if (modifiers & PlatformEvent::LeftButtonDown)
153 buttons |= static_cast<unsigned short>(Buttons::Left); 153 buttons |= static_cast<unsigned short>(WebPointerProperties::Buttons::Le ft);
154 if (modifiers & PlatformEvent::RightButtonDown) 154 if (modifiers & PlatformEvent::RightButtonDown)
155 buttons |= static_cast<unsigned short>(Buttons::Right); 155 buttons |= static_cast<unsigned short>(WebPointerProperties::Buttons::Ri ght);
156 if (modifiers & PlatformEvent::MiddleButtonDown) 156 if (modifiers & PlatformEvent::MiddleButtonDown)
157 buttons |= static_cast<unsigned short>(Buttons::Middle); 157 buttons |= static_cast<unsigned short>(WebPointerProperties::Buttons::Mi ddle);
158 158
159 return buttons; 159 return buttons;
160 } 160 }
161 161
162 void MouseEvent::initMouseEvent(ScriptState* scriptState, const AtomicString& ty pe, bool canBubble, bool cancelable, AbstractView* view, 162 void MouseEvent::initMouseEvent(ScriptState* scriptState, const AtomicString& ty pe, bool canBubble, bool cancelable, AbstractView* view,
163 int detail, int screenX, int screenY, int client X, int clientY, 163 int detail, int screenX, int screenY, int client X, int clientY,
164 bool ctrlKey, bool altKey, bool shiftKey, bool m etaKey, 164 bool ctrlKey, bool altKey, bool shiftKey, bool m etaKey,
165 short button, EventTarget* relatedTarget, unsign ed short buttons) 165 short button, EventTarget* relatedTarget, unsign ed short buttons)
166 { 166 {
167 if (isBeingDispatched()) 167 if (isBeingDispatched())
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
288 doubleClickEvent->setTrusted(mouseEvent.isTrusted()); 288 doubleClickEvent->setTrusted(mouseEvent.isTrusted());
289 if (mouseEvent.defaultHandled()) 289 if (mouseEvent.defaultHandled())
290 doubleClickEvent->setDefaultHandled(); 290 doubleClickEvent->setDefaultHandled();
291 DispatchEventResult doubleClickDispatchResult = EventDispatcher::dispatchEve nt(dispatcher.node(), MouseEventDispatchMediator::create(doubleClickEvent)); 291 DispatchEventResult doubleClickDispatchResult = EventDispatcher::dispatchEve nt(dispatcher.node(), MouseEventDispatchMediator::create(doubleClickEvent));
292 if (doubleClickDispatchResult != DispatchEventResult::NotCanceled) 292 if (doubleClickDispatchResult != DispatchEventResult::NotCanceled)
293 return doubleClickDispatchResult; 293 return doubleClickDispatchResult;
294 return dispatchResult; 294 return dispatchResult;
295 } 295 }
296 296
297 } // namespace blink 297 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698