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

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

Issue 2785853002: Selection Action mode triggered like a context menu (Closed)
Patch Set: fix tests Created 3 years, 7 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 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 abstract_view 169 abstract_view
170 ? abstract_view->GetInputDeviceCapabilities()->FiresTouchEvents( 170 ? abstract_view->GetInputDeviceCapabilities()->FiresTouchEvents(
171 event.FromTouch()) 171 event.FromTouch())
172 : nullptr), 172 : nullptr),
173 screen_location_(event.PositionInScreen().x, event.PositionInScreen().y), 173 screen_location_(event.PositionInScreen().x, event.PositionInScreen().y),
174 movement_delta_(FlooredIntPoint(event.MovementInRootFrame())), 174 movement_delta_(FlooredIntPoint(event.MovementInRootFrame())),
175 position_type_(PositionType::kPosition), 175 position_type_(PositionType::kPosition),
176 button_(static_cast<short>(event.button)), 176 button_(static_cast<short>(event.button)),
177 buttons_(WebInputEventModifiersToButtons(event.GetModifiers())), 177 buttons_(WebInputEventModifiersToButtons(event.GetModifiers())),
178 related_target_(related_target), 178 related_target_(related_target),
179 synthetic_event_type_(event.FromTouch() ? kFromTouch
180 : kRealOrIndistinguishable),
181 region_(region) { 179 region_(region) {
182 IntPoint root_frame_coordinates = 180 IntPoint root_frame_coordinates =
183 FlooredIntPoint(event.PositionInRootFrame()); 181 FlooredIntPoint(event.PositionInRootFrame());
184 InitCoordinatesFromRootFrame(root_frame_coordinates.X(), 182 InitCoordinatesFromRootFrame(root_frame_coordinates.X(),
185 root_frame_coordinates.Y()); 183 root_frame_coordinates.Y());
184 if (event.GetModifiers() & WebInputEvent::kSelectAll)
185 synthetic_event_type_ = kFromSelectAll;
186 else if (event.FromTouch())
187 synthetic_event_type_ = kFromTouch;
188 else
189 synthetic_event_type_ = kRealOrIndistinguishable;
186 } 190 }
187 191
188 MouseEvent::MouseEvent(const AtomicString& event_type, 192 MouseEvent::MouseEvent(const AtomicString& event_type,
189 bool can_bubble, 193 bool can_bubble,
190 bool cancelable, 194 bool cancelable,
191 AbstractView* abstract_view, 195 AbstractView* abstract_view,
192 int detail, 196 int detail,
193 int screen_x, 197 int screen_x,
194 int screen_y, 198 int screen_y,
195 int window_x, 199 int window_x,
(...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after
598 602
599 int MouseEvent::offsetY() { 603 int MouseEvent::offsetY() {
600 if (!HasPosition()) 604 if (!HasPosition())
601 return 0; 605 return 0;
602 if (!has_cached_relative_position_) 606 if (!has_cached_relative_position_)
603 ComputeRelativePosition(); 607 ComputeRelativePosition();
604 return std::round(offset_location_.Y()); 608 return std::round(offset_location_.Y());
605 } 609 }
606 610
607 } // namespace blink 611 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698