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

Side by Side Diff: sky/engine/core/dom/Touch.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 | « no previous file | sky/engine/core/events/MouseRelatedEvent.cpp » ('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 2008, The Android Open Source Project 2 * Copyright 2008, The Android Open Source Project
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * * Redistributions of source code must retain the above copyright 7 * * Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * * Redistributions in binary form must reproduce the above copyright 9 * * Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 15 matching lines...) Expand all
26 #include "config.h" 26 #include "config.h"
27 27
28 #include "core/dom/Touch.h" 28 #include "core/dom/Touch.h"
29 29
30 #include "core/frame/FrameView.h" 30 #include "core/frame/FrameView.h"
31 #include "core/frame/LocalFrame.h" 31 #include "core/frame/LocalFrame.h"
32 #include "platform/geometry/FloatPoint.h" 32 #include "platform/geometry/FloatPoint.h"
33 33
34 namespace blink { 34 namespace blink {
35 35
36 static FloatPoint contentsOffset(LocalFrame* frame)
37 {
38 if (!frame)
39 return FloatPoint();
40 FrameView* frameView = frame->view();
41 if (!frameView)
42 return FloatPoint();
43 float scale = 1.0f / frame->pageZoomFactor();
44 return FloatPoint(frameView->scrollPosition()).scaledBy(scale);
45 }
46
47 Touch::Touch(LocalFrame* frame, EventTarget* target, unsigned identifier, const FloatPoint& screenPos, const FloatPoint& pagePos, const FloatSize& radius, float rotationAngle, float force) 36 Touch::Touch(LocalFrame* frame, EventTarget* target, unsigned identifier, const FloatPoint& screenPos, const FloatPoint& pagePos, const FloatSize& radius, float rotationAngle, float force)
48 : m_target(target) 37 : m_target(target)
49 , m_identifier(identifier) 38 , m_identifier(identifier)
50 , m_clientPos(pagePos - contentsOffset(frame)) 39 , m_clientPos(pagePos)
51 , m_screenPos(screenPos) 40 , m_screenPos(screenPos)
52 , m_pagePos(pagePos) 41 , m_pagePos(pagePos)
53 , m_radius(radius) 42 , m_radius(radius)
54 , m_rotationAngle(rotationAngle) 43 , m_rotationAngle(rotationAngle)
55 , m_force(force) 44 , m_force(force)
56 { 45 {
57 ScriptWrappable::init(this); 46 ScriptWrappable::init(this);
58 float scaleFactor = frame ? frame->pageZoomFactor() : 1.0f; 47 float scaleFactor = frame ? frame->pageZoomFactor() : 1.0f;
59 m_absoluteLocation = roundedLayoutPoint(pagePos.scaledBy(scaleFactor)); 48 m_absoluteLocation = roundedLayoutPoint(pagePos.scaledBy(scaleFactor));
60 } 49 }
(...skipping 16 matching lines...) Expand all
77 { 66 {
78 return adoptRefWillBeNoop(new Touch(eventTarget, m_identifier, m_clientPos, m_screenPos, m_pagePos, m_radius, m_rotationAngle, m_force, m_absoluteLocation)) ; 67 return adoptRefWillBeNoop(new Touch(eventTarget, m_identifier, m_clientPos, m_screenPos, m_pagePos, m_radius, m_rotationAngle, m_force, m_absoluteLocation)) ;
79 } 68 }
80 69
81 void Touch::trace(Visitor* visitor) 70 void Touch::trace(Visitor* visitor)
82 { 71 {
83 visitor->trace(m_target); 72 visitor->trace(m_target);
84 } 73 }
85 74
86 } // namespace blink 75 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | sky/engine/core/events/MouseRelatedEvent.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698