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

Side by Side Diff: sky/engine/core/page/AutoscrollController.cpp

Issue 873963003: Remove more mouse-specific code (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Build fixes Created 5 years, 10 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
« no previous file with comments | « sky/engine/core/loader/EmptyClients.h ('k') | sky/engine/core/page/Chrome.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) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserv ed. 3 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserv ed.
4 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org) 4 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org)
5 * Copyright (C) 2012 Digia Plc. and/or its subsidiary(-ies) 5 * Copyright (C) 2012 Digia Plc. and/or its subsidiary(-ies)
6 * 6 *
7 * Redistribution and use in source and binary forms, with or without 7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions 8 * modification, are permitted provided that the following conditions
9 * are met: 9 * are met:
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 155
156 // FIXME: This would get get better animation fidelity if it used the monotonicF rameBeginTime instead 156 // FIXME: This would get get better animation fidelity if it used the monotonicF rameBeginTime instead
157 // of WTF::currentTime(). 157 // of WTF::currentTime().
158 void AutoscrollController::animate(double) 158 void AutoscrollController::animate(double)
159 { 159 {
160 if (!m_autoscrollRenderer) { 160 if (!m_autoscrollRenderer) {
161 stopAutoscroll(); 161 stopAutoscroll();
162 return; 162 return;
163 } 163 }
164 164
165 EventHandler& eventHandler = m_autoscrollRenderer->frame()->eventHandler();
166 switch (m_autoscrollType) { 165 switch (m_autoscrollType) {
167 case AutoscrollForDragAndDrop: 166 case AutoscrollForDragAndDrop:
168 if (WTF::currentTime() - m_dragAndDropAutoscrollStartTime > autoscrollDe lay) 167 if (WTF::currentTime() - m_dragAndDropAutoscrollStartTime > autoscrollDe lay)
169 m_autoscrollRenderer->autoscroll(m_dragAndDropAutoscrollReferencePos ition); 168 m_autoscrollRenderer->autoscroll(m_dragAndDropAutoscrollReferencePos ition);
170 break; 169 break;
171 case AutoscrollForSelection: 170 case AutoscrollForSelection:
172 if (!eventHandler.mousePressed()) {
173 stopAutoscroll();
174 return;
175 }
176 eventHandler.updateSelectionForMouseDrag();
177 m_autoscrollRenderer->autoscroll(eventHandler.lastKnownMousePosition());
178 break;
179 case NoAutoscroll: 171 case NoAutoscroll:
180 break; 172 break;
181 } 173 }
182 if (m_autoscrollType != NoAutoscroll) 174 if (m_autoscrollType != NoAutoscroll)
183 m_page.chrome().scheduleAnimation(); 175 m_page.chrome().scheduleAnimation();
184 } 176 }
185 177
186 void AutoscrollController::startAutoscroll() 178 void AutoscrollController::startAutoscroll()
187 { 179 {
188 m_page.chrome().scheduleAnimation(); 180 m_page.chrome().scheduleAnimation();
189 } 181 }
190 182
191 } // namespace blink 183 } // namespace blink
OLDNEW
« no previous file with comments | « sky/engine/core/loader/EmptyClients.h ('k') | sky/engine/core/page/Chrome.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698