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

Unified Diff: content/browser/android/content_view_core_impl.cc

Issue 14268004: Add overscroll edge effect animations for Android. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use LazyInstance for overscroll resources Created 7 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/browser/android/content_view_core_impl.h ('k') | content/browser/android/edge_effect.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/android/content_view_core_impl.cc
diff --git a/content/browser/android/content_view_core_impl.cc b/content/browser/android/content_view_core_impl.cc
index 8bc6e47463906dcfc287eb06b0ea0342c0aaf3d0..cf088026c54e3d4c354626593a7f5209db3e4813 100644
--- a/content/browser/android/content_view_core_impl.cc
+++ b/content/browser/android/content_view_core_impl.cc
@@ -699,6 +699,14 @@ void ContentViewCoreImpl::SetVSyncNotificationEnabled(bool enabled) {
env, obj.obj(), static_cast<jboolean>(enabled));
}
+void ContentViewCoreImpl::SetNeedsAnimate() {
+ JNIEnv* env = AttachCurrentThread();
+ ScopedJavaLocalRef<jobject> obj = java_ref_.get(env);
+ if (obj.is_null())
+ return;
+ Java_ContentViewCore_setNeedsAnimate(env, obj.obj());
+}
+
ui::ViewAndroid* ContentViewCoreImpl::GetViewAndroid() const {
// view_android_ should never be null for Chrome.
DCHECK(view_android_);
@@ -1239,6 +1247,15 @@ void ContentViewCoreImpl::OnVSync(JNIEnv* env, jobject /* obj */,
view->SendVSync(base::TimeTicks::FromInternalValue(frame_time_micros));
}
+jboolean ContentViewCoreImpl::OnAnimate(JNIEnv* env, jobject /* obj */,
+ jlong frame_time_micros) {
+ RenderWidgetHostViewAndroid* view = GetRenderWidgetHostViewAndroid();
+ if (!view)
+ return false;
+
+ return view->Animate(base::TimeTicks::FromInternalValue(frame_time_micros));
+}
+
jboolean ContentViewCoreImpl::PopulateBitmapFromCompositor(JNIEnv* env,
jobject obj,
jobject jbitmap) {
« no previous file with comments | « content/browser/android/content_view_core_impl.h ('k') | content/browser/android/edge_effect.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698