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

Side by Side Diff: content/browser/android/content_view_core_impl.cc

Issue 11793003: Relands: Telemetry: hooks "chrome.gpuBenchmarking.smoothScrollBy" with java on android. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Not dead! 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/browser/android/content_view_core_impl.h" 5 #include "content/browser/android/content_view_core_impl.h"
6 6
7 #include "base/android/jni_android.h" 7 #include "base/android/jni_android.h"
8 #include "base/android/jni_array.h" 8 #include "base/android/jni_array.h"
9 #include "base/android/jni_string.h" 9 #include "base/android/jni_string.h"
10 #include "base/android/scoped_java_ref.h" 10 #include "base/android/scoped_java_ref.h"
(...skipping 586 matching lines...) Expand 10 before | Expand all | Expand 10 after
597 JNIEnv* env = AttachCurrentThread(); 597 JNIEnv* env = AttachCurrentThread();
598 598
599 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); 599 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env);
600 if (obj.is_null()) 600 if (obj.is_null())
601 return; 601 return;
602 602
603 Java_ContentViewCore_requestExternalVideoSurface( 603 Java_ContentViewCore_requestExternalVideoSurface(
604 env, obj.obj(), static_cast<jint>(player_id)); 604 env, obj.obj(), static_cast<jint>(player_id));
605 } 605 }
606 606
607 ScopedJavaLocalRef<jobject> ContentViewCoreImpl::CreateSmoothScroller(
608 bool scroll_down, int mouse_event_x, int mouse_event_y) {
609 JNIEnv* env = AttachCurrentThread();
610
611 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env);
612 if (obj.is_null())
613 return ScopedJavaLocalRef<jobject>();
614 return Java_ContentViewCore_createSmoothScroller(
615 env, obj.obj(), scroll_down, mouse_event_x, mouse_event_y);
616 }
617
607 void ContentViewCoreImpl::NotifyGeometryChange(int player_id, 618 void ContentViewCoreImpl::NotifyGeometryChange(int player_id,
608 const gfx::RectF& rect) { 619 const gfx::RectF& rect) {
609 JNIEnv* env = AttachCurrentThread(); 620 JNIEnv* env = AttachCurrentThread();
610 621
611 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); 622 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env);
612 if (obj.is_null()) 623 if (obj.is_null())
613 return; 624 return;
614 625
615 Java_ContentViewCore_notifyGeometryChange(env, 626 Java_ContentViewCore_notifyGeometryChange(env,
616 obj.obj(), 627 obj.obj(),
(...skipping 906 matching lines...) Expand 10 before | Expand all | Expand 10 after
1523 reinterpret_cast<ui::ViewAndroid*>(view_android), 1534 reinterpret_cast<ui::ViewAndroid*>(view_android),
1524 reinterpret_cast<ui::WindowAndroid*>(window_android)); 1535 reinterpret_cast<ui::WindowAndroid*>(window_android));
1525 return reinterpret_cast<jint>(view); 1536 return reinterpret_cast<jint>(view);
1526 } 1537 }
1527 1538
1528 bool RegisterContentViewCore(JNIEnv* env) { 1539 bool RegisterContentViewCore(JNIEnv* env) {
1529 return RegisterNativesImpl(env); 1540 return RegisterNativesImpl(env);
1530 } 1541 }
1531 1542
1532 } // namespace content 1543 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698