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

Side by Side Diff: sky/engine/core/events/MouseRelatedEvent.cpp

Issue 681023002: Remove a bunch of frame-level scrolling machinery. (Closed) Base URL: git@github.com:domokit/mojo.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
« no previous file with comments | « sky/engine/core/dom/Touch.cpp ('k') | sky/engine/core/frame/FrameView.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 30 matching lines...) Expand all
41 MouseRelatedEvent::MouseRelatedEvent(const AtomicString& eventType, bool canBubb le, bool cancelable, PassRefPtrWillBeRawPtr<AbstractView> abstractView, 41 MouseRelatedEvent::MouseRelatedEvent(const AtomicString& eventType, bool canBubb le, bool cancelable, PassRefPtrWillBeRawPtr<AbstractView> abstractView,
42 int detail, const IntPoint& screenLocation, const IntPoint& windowLocation, 42 int detail, const IntPoint& screenLocation, const IntPoint& windowLocation,
43 const IntPoint& movementDelta, 43 const IntPoint& movementDelta,
44 bool ctrlKey, bool altKey, bool shiftKey, b ool metaKey, bool isSimulated) 44 bool ctrlKey, bool altKey, bool shiftKey, b ool metaKey, bool isSimulated)
45 : UIEventWithKeyState(eventType, canBubble, cancelable, abstractView, detail , ctrlKey, altKey, shiftKey, metaKey) 45 : UIEventWithKeyState(eventType, canBubble, cancelable, abstractView, detail , ctrlKey, altKey, shiftKey, metaKey)
46 , m_screenLocation(screenLocation) 46 , m_screenLocation(screenLocation)
47 , m_movementDelta(movementDelta) 47 , m_movementDelta(movementDelta)
48 , m_isSimulated(isSimulated) 48 , m_isSimulated(isSimulated)
49 { 49 {
50 LayoutPoint adjustedPageLocation; 50 LayoutPoint adjustedPageLocation;
51 LayoutPoint scrollPosition;
52 51
53 LocalFrame* frame = view() ? view()->frame() : 0; 52 LocalFrame* frame = view() ? view()->frame() : 0;
54 if (frame && !isSimulated) { 53 if (frame && !isSimulated) {
55 if (FrameView* frameView = frame->view()) { 54 if (FrameView* frameView = frame->view()) {
56 scrollPosition = frameView->scrollPosition();
57 adjustedPageLocation = frameView->windowToContents(windowLocation); 55 adjustedPageLocation = frameView->windowToContents(windowLocation);
58 float scaleFactor = 1 / frame->pageZoomFactor(); 56 float scaleFactor = 1 / frame->pageZoomFactor();
59 if (scaleFactor != 1.0f) { 57 if (scaleFactor != 1.0f) {
60 adjustedPageLocation.scale(scaleFactor, scaleFactor); 58 adjustedPageLocation.scale(scaleFactor, scaleFactor);
61 scrollPosition.scale(scaleFactor, scaleFactor);
62 } 59 }
63 } 60 }
64 } 61 }
65 62
66 m_clientLocation = adjustedPageLocation - toLayoutSize(scrollPosition); 63 m_clientLocation = adjustedPageLocation;
67 m_pageLocation = adjustedPageLocation; 64 m_pageLocation = adjustedPageLocation;
68 65
69 initCoordinates(); 66 initCoordinates();
70 } 67 }
71 68
72 void MouseRelatedEvent::initCoordinates() 69 void MouseRelatedEvent::initCoordinates()
73 { 70 {
74 // Set up initial values for coordinates. 71 // Set up initial values for coordinates.
75 // Correct values are computed lazily, see computeRelativePosition. 72 // Correct values are computed lazily, see computeRelativePosition.
76 m_layerLocation = m_pageLocation; 73 m_layerLocation = m_pageLocation;
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
211 // See Microsoft documentation and <http://www.quirksmode.org/dom/w3c_events .html>. 208 // See Microsoft documentation and <http://www.quirksmode.org/dom/w3c_events .html>.
212 return m_clientLocation.y(); 209 return m_clientLocation.y();
213 } 210 }
214 211
215 void MouseRelatedEvent::trace(Visitor* visitor) 212 void MouseRelatedEvent::trace(Visitor* visitor)
216 { 213 {
217 UIEventWithKeyState::trace(visitor); 214 UIEventWithKeyState::trace(visitor);
218 } 215 }
219 216
220 } // namespace blink 217 } // namespace blink
OLDNEW
« no previous file with comments | « sky/engine/core/dom/Touch.cpp ('k') | sky/engine/core/frame/FrameView.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698