summaryrefslogtreecommitdiffstats
path: root/webkit
diff options
context:
space:
mode:
authorrjkroege@chromium.org <rjkroege@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-12-04 01:16:11 +0000
committerrjkroege@chromium.org <rjkroege@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-12-04 01:16:11 +0000
commite9798ce0ce1255b0253c1fbe4bee4f5fbbf2731d (patch)
tree6681228825de3ac56d40250e59f9655e2235a551 /webkit
parent0c13eda2a3ecfd0ceb1c281d8d27084c44e9648e (diff)
downloadchromium_src-e9798ce0ce1255b0253c1fbe4bee4f5fbbf2731d.zip
chromium_src-e9798ce0ce1255b0253c1fbe4bee4f5fbbf2731d.tar.gz
chromium_src-e9798ce0ce1255b0253c1fbe4bee4f5fbbf2731d.tar.bz2
Removed reference to unnecessary WebFlingAnimator.
BUG=157656 Review URL: https://chromiumcodereview.appspot.com/11280255 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@170857 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit')
-rw-r--r--webkit/glue/fling_animator_impl_android.cc28
-rw-r--r--webkit/glue/fling_animator_impl_android.h24
-rw-r--r--webkit/glue/webkitplatformsupport_impl.cc6
-rw-r--r--webkit/glue/webkitplatformsupport_impl.h5
4 files changed, 22 insertions, 41 deletions
diff --git a/webkit/glue/fling_animator_impl_android.cc b/webkit/glue/fling_animator_impl_android.cc
index dfe1ada4..b4ba447 100644
--- a/webkit/glue/fling_animator_impl_android.cc
+++ b/webkit/glue/fling_animator_impl_android.cc
@@ -8,6 +8,7 @@
#include "base/android/scoped_java_ref.h"
#include "base/logging.h"
#include "third_party/WebKit/Source/Platform/chromium/public/WebGestureCurveTarget.h"
+#include "third_party/WebKit/Source/Platform/chromium/public/WebPoint.h"
#include "ui/gfx/vector2d.h"
using base::android::AttachCurrentThread;
@@ -48,29 +49,28 @@ FlingAnimatorImpl::~FlingAnimatorImpl()
{
}
-void FlingAnimatorImpl::startFling(const WebKit::WebFloatPoint& velocity,
- const WebKit::WebRect& /* range */)
+void FlingAnimatorImpl::StartFling(const gfx::PointF& velocity)
{
- // Ignore "range" as it's always empty -- see http://webkit.org/b/96403
+ // No bounds on the fling. See http://webkit.org/b/96403
// Instead, use the largest possible bounds for minX/maxX/minY/maxY. The
// compositor will ignore any attempt to scroll beyond the end of the page.
- DCHECK(velocity.x || velocity.y);
+ DCHECK(velocity.x() || velocity.y());
if (is_active_)
- cancelFling();
+ CancelFling();
is_active_ = true;
JNIEnv* env = AttachCurrentThread();
env->CallVoidMethod(java_scroller_.obj(), fling_method_id_, 0, 0,
- static_cast<int>(velocity.x),
- static_cast<int>(velocity.y),
+ static_cast<int>(velocity.x()),
+ static_cast<int>(velocity.y()),
INT_MIN, INT_MAX, INT_MIN, INT_MAX);
CheckException(env);
}
-void FlingAnimatorImpl::cancelFling()
+void FlingAnimatorImpl::CancelFling()
{
if (!is_active_)
return;
@@ -81,7 +81,7 @@ void FlingAnimatorImpl::cancelFling()
CheckException(env);
}
-bool FlingAnimatorImpl::updatePosition()
+bool FlingAnimatorImpl::UpdatePosition()
{
JNIEnv* env = AttachCurrentThread();
bool result = env->CallBooleanMethod(java_scroller_.obj(),
@@ -90,10 +90,10 @@ bool FlingAnimatorImpl::updatePosition()
return is_active_ = result;
}
-WebKit::WebPoint FlingAnimatorImpl::getCurrentPosition()
+gfx::Point FlingAnimatorImpl::GetCurrentPosition()
{
JNIEnv* env = AttachCurrentThread();
- WebKit::WebPoint position(
+ gfx::Point position(
env->CallIntMethod(java_scroller_.obj(), getX_method_id_),
env->CallIntMethod(java_scroller_.obj(), getY_method_id_));
CheckException(env);
@@ -102,10 +102,10 @@ WebKit::WebPoint FlingAnimatorImpl::getCurrentPosition()
bool FlingAnimatorImpl::apply(double time,
WebKit::WebGestureCurveTarget* target) {
- if (!updatePosition())
+ if (!UpdatePosition())
return false;
- gfx::Point current_position = getCurrentPosition();
+ gfx::Point current_position = GetCurrentPosition();
gfx::Vector2d diff(current_position - last_position_);
WebKit::WebPoint scroll_amount(diff.x(), diff.y());
target->scrollBy(scroll_amount);
@@ -117,7 +117,7 @@ FlingAnimatorImpl* FlingAnimatorImpl::CreateAndroidGestureCurve(
const WebKit::WebFloatPoint& velocity,
const WebKit::WebSize&) {
FlingAnimatorImpl* gesture_curve = new FlingAnimatorImpl();
- gesture_curve->startFling(velocity, WebKit::WebRect());
+ gesture_curve->StartFling(velocity);
return gesture_curve;
}
diff --git a/webkit/glue/fling_animator_impl_android.h b/webkit/glue/fling_animator_impl_android.h
index a4adfe4..8d3758b 100644
--- a/webkit/glue/fling_animator_impl_android.h
+++ b/webkit/glue/fling_animator_impl_android.h
@@ -6,13 +6,11 @@
#define WEBKIT_GLUE_FLING_ANIMATOR_IMPL_ANDROID_H_
#include "base/android/scoped_java_ref.h"
-#include "third_party/WebKit/Source/Platform/chromium/public/WebFlingAnimator.h"
#include "third_party/WebKit/Source/Platform/chromium/public/WebFloatPoint.h"
#include "third_party/WebKit/Source/Platform/chromium/public/WebGestureCurve.h"
-#include "third_party/WebKit/Source/Platform/chromium/public/WebPoint.h"
-#include "third_party/WebKit/Source/Platform/chromium/public/WebRect.h"
#include "third_party/WebKit/Source/Platform/chromium/public/WebSize.h"
#include "ui/gfx/point.h"
+#include "ui/gfx/point_f.h"
namespace WebKit {
class WebGestureCurveTarget;
@@ -20,10 +18,7 @@ class WebGestureCurveTarget;
namespace webkit_glue {
-// TODO(rjkroege): Remove WebFlingAnimator once all of the gesture curve
-// implementation has moved to Chromium.
-class FlingAnimatorImpl : public WebKit::WebFlingAnimator,
- public WebKit::WebGestureCurve {
+class FlingAnimatorImpl : public WebKit::WebGestureCurve {
public:
FlingAnimatorImpl();
virtual ~FlingAnimatorImpl();
@@ -32,18 +27,15 @@ class FlingAnimatorImpl : public WebKit::WebFlingAnimator,
const WebKit::WebFloatPoint& velocity,
const WebKit::WebSize&);
- // WebKit::WebFlingAnimator methods.
- virtual void startFling(const WebKit::WebFloatPoint& velocity,
- const WebKit::WebRect& range);
- // Returns true if the animation is not yet finished.
- virtual bool updatePosition();
- virtual WebKit::WebPoint getCurrentPosition();
- virtual void cancelFling();
-
- // WebKit::WebGestureCurve methods.
virtual bool apply(double time,
WebKit::WebGestureCurveTarget* target);
private:
+ void StartFling(const gfx::PointF& velocity);
+ // Returns true if the animation is not yet finished.
+ bool UpdatePosition();
+ gfx::Point GetCurrentPosition();
+ virtual void CancelFling();
+
bool is_active_;
// Java OverScroller instance and methods.
diff --git a/webkit/glue/webkitplatformsupport_impl.cc b/webkit/glue/webkitplatformsupport_impl.cc
index afd9820..dfa8a43 100644
--- a/webkit/glue/webkitplatformsupport_impl.cc
+++ b/webkit/glue/webkitplatformsupport_impl.cc
@@ -862,12 +862,6 @@ void WebKitPlatformSupportImpl::didStopWorkerRunLoop(
worker_task_runner->OnWorkerRunLoopStopped(runLoop);
}
-#if defined(OS_ANDROID)
-WebKit::WebFlingAnimator* WebKitPlatformSupportImpl::createFlingAnimator() {
- return new FlingAnimatorImpl();
-}
-#endif
-
WebKit::WebGestureCurve* WebKitPlatformSupportImpl::createFlingAnimationCurve(
int device_source,
const WebKit::WebFloatPoint& velocity,
diff --git a/webkit/glue/webkitplatformsupport_impl.h b/webkit/glue/webkitplatformsupport_impl.h
index 1d719f5..5bbea48 100644
--- a/webkit/glue/webkitplatformsupport_impl.h
+++ b/webkit/glue/webkitplatformsupport_impl.h
@@ -32,7 +32,6 @@ struct WebPluginInfo;
}
namespace WebKit {
-class WebFlingAnimator;
class WebSocketStreamHandle;
}
@@ -154,10 +153,6 @@ class WEBKIT_GLUE_EXPORT WebKitPlatformSupportImpl :
virtual void didStopWorkerRunLoop(
const WebKit::WebWorkerRunLoop& runLoop) OVERRIDE;
-#if defined(OS_ANDROID)
- virtual WebKit::WebFlingAnimator* createFlingAnimator();
-#endif
-
virtual WebKit::WebGestureCurve* createFlingAnimationCurve(
int device_source,
const WebKit::WebFloatPoint& velocity,