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

Side by Side Diff: content/child/web_gesture_curve_impl.cc

Issue 660883003: Use scoped_ptr::Pass instead of scoped_ptr::PassAs<T>. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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 | « content/child/child_thread.cc ('k') | content/common/gpu/media/v4l2_video_device.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/child/web_gesture_curve_impl.h" 5 #include "content/child/web_gesture_curve_impl.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "third_party/WebKit/public/platform/WebFloatSize.h" 8 #include "third_party/WebKit/public/platform/WebFloatSize.h"
9 #include "third_party/WebKit/public/platform/WebGestureCurveTarget.h" 9 #include "third_party/WebKit/public/platform/WebGestureCurveTarget.h"
10 #include "ui/events/gestures/fling_curve.h" 10 #include "ui/events/gestures/fling_curve.h"
(...skipping 15 matching lines...) Expand all
26 auto scroller = make_scoped_ptr(new ui::Scroller(ui::Scroller::Config())); 26 auto scroller = make_scoped_ptr(new ui::Scroller(ui::Scroller::Config()));
27 scroller->Fling(0, 27 scroller->Fling(0,
28 0, 28 0,
29 initial_velocity.x(), 29 initial_velocity.x(),
30 initial_velocity.y(), 30 initial_velocity.y(),
31 INT_MIN, 31 INT_MIN,
32 INT_MAX, 32 INT_MAX,
33 INT_MIN, 33 INT_MIN,
34 INT_MAX, 34 INT_MAX,
35 base::TimeTicks()); 35 base::TimeTicks());
36 return scroller.PassAs<ui::GestureCurve>(); 36 return scroller.Pass();
37 #else 37 #else
38 return scoped_ptr<ui::GestureCurve>( 38 return make_scoped_ptr(
39 new ui::FlingCurve(initial_velocity, base::TimeTicks())); 39 new ui::FlingCurve(initial_velocity, base::TimeTicks()));
40 #endif 40 #endif
41 } 41 }
42 42
43 } // namespace 43 } // namespace
44 44
45 // static 45 // static
46 scoped_ptr<WebGestureCurve> WebGestureCurveImpl::CreateFromDefaultPlatformCurve( 46 scoped_ptr<WebGestureCurve> WebGestureCurveImpl::CreateFromDefaultPlatformCurve(
47 const gfx::Vector2dF& initial_velocity, 47 const gfx::Vector2dF& initial_velocity,
48 const gfx::Vector2dF& initial_offset) { 48 const gfx::Vector2dF& initial_offset) {
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 return still_active; 88 return still_active;
89 89
90 // scrollBy() could delete this curve if the animation is over, so don't touch 90 // scrollBy() could delete this curve if the animation is over, so don't touch
91 // any member variables after making that call. 91 // any member variables after making that call.
92 bool did_scroll = target->scrollBy(blink::WebFloatSize(delta), 92 bool did_scroll = target->scrollBy(blink::WebFloatSize(delta),
93 blink::WebFloatSize(velocity)); 93 blink::WebFloatSize(velocity));
94 return did_scroll && still_active; 94 return did_scroll && still_active;
95 } 95 }
96 96
97 } // namespace content 97 } // namespace content
OLDNEW
« no previous file with comments | « content/child/child_thread.cc ('k') | content/common/gpu/media/v4l2_video_device.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698