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

Side by Side Diff: ui/events/blink/input_scroll_elasticity_controller.cc

Issue 1415953004: Move content/renderer input handling for web input events to ui (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 5 years 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 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/renderer/input/input_scroll_elasticity_controller.h" 5 #include "ui/events/blink/input_scroll_elasticity_controller.h"
6 6
7 #include <math.h> 7 #include <math.h>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "cc/input/input_handler.h" 10 #include "cc/input/input_handler.h"
11 #include "ui/gfx/geometry/vector2d_conversions.h" 11 #include "ui/gfx/geometry/vector2d_conversions.h"
12 12
13 // InputScrollElasticityController is based on 13 // InputScrollElasticityController is based on
14 // WebKit/Source/platform/mac/InputScrollElasticityController.mm 14 // WebKit/Source/platform/mac/InputScrollElasticityController.mm
15 /* 15 /*
(...skipping 14 matching lines...) Expand all
30 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS 30 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
31 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 31 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
32 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 32 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
33 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 33 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
34 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 34 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
35 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 35 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
36 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 36 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
37 * THE POSSIBILITY OF SUCH DAMAGE. 37 * THE POSSIBILITY OF SUCH DAMAGE.
38 */ 38 */
39 39
40 namespace content { 40 namespace ui {
41 41
42 namespace { 42 namespace {
43 43
44 const float kScrollVelocityZeroingTimeout = 0.10f; 44 const float kScrollVelocityZeroingTimeout = 0.10f;
45 const float kRubberbandMinimumRequiredDeltaBeforeStretch = 10; 45 const float kRubberbandMinimumRequiredDeltaBeforeStretch = 10;
46 46
47 const float kRubberbandStiffness = 20; 47 const float kRubberbandStiffness = 20;
48 const float kRubberbandAmplitude = 0.31f; 48 const float kRubberbandAmplitude = 0.31f;
49 const float kRubberbandPeriod = 1.6f; 49 const float kRubberbandPeriod = 1.6f;
50 50
(...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after
400 momentum_animation_reset_at_next_frame_ = true; 400 momentum_animation_reset_at_next_frame_ = true;
401 break; 401 break;
402 default: 402 default:
403 // These cases should not be hit because the stretch must be zero in the 403 // These cases should not be hit because the stretch must be zero in the
404 // Inactive and MomentumScroll states. 404 // Inactive and MomentumScroll states.
405 NOTREACHED(); 405 NOTREACHED();
406 break; 406 break;
407 } 407 }
408 } 408 }
409 409
410 } // namespace content 410 } // namespace ui
OLDNEW
« no previous file with comments | « ui/events/blink/input_scroll_elasticity_controller.h ('k') | ui/events/blink/input_scroll_elasticity_controller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698