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

Side by Side Diff: content/browser/web_contents/web_contents_android.cc

Issue 2708613002: Add EventForwarder for routing touch events (Closed)
Patch Set: unittests Created 3 years, 9 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/web_contents/web_contents_android.h" 5 #include "content/browser/web_contents/web_contents_android.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include "base/android/jni_android.h" 9 #include "base/android/jni_android.h"
10 #include "base/android/jni_array.h" 10 #include "base/android/jni_array.h"
(...skipping 20 matching lines...) Expand all
31 #include "content/common/view_messages.h" 31 #include "content/common/view_messages.h"
32 #include "content/public/browser/browser_context.h" 32 #include "content/public/browser/browser_context.h"
33 #include "content/public/browser/browser_thread.h" 33 #include "content/public/browser/browser_thread.h"
34 #include "content/public/browser/message_port_provider.h" 34 #include "content/public/browser/message_port_provider.h"
35 #include "content/public/browser/render_widget_host.h" 35 #include "content/public/browser/render_widget_host.h"
36 #include "content/public/browser/web_contents.h" 36 #include "content/public/browser/web_contents.h"
37 #include "content/public/common/content_switches.h" 37 #include "content/public/common/content_switches.h"
38 #include "jni/WebContentsImpl_jni.h" 38 #include "jni/WebContentsImpl_jni.h"
39 #include "net/android/network_library.h" 39 #include "net/android/network_library.h"
40 #include "ui/accessibility/ax_node_data.h" 40 #include "ui/accessibility/ax_node_data.h"
41 #include "ui/android/event_handler.h"
41 #include "ui/android/overscroll_refresh_handler.h" 42 #include "ui/android/overscroll_refresh_handler.h"
42 #include "ui/gfx/android/java_bitmap.h" 43 #include "ui/gfx/android/java_bitmap.h"
43 #include "ui/gfx/geometry/rect.h" 44 #include "ui/gfx/geometry/rect.h"
44 45
45 using base::android::AttachCurrentThread; 46 using base::android::AttachCurrentThread;
46 using base::android::ConvertJavaStringToUTF8; 47 using base::android::ConvertJavaStringToUTF8;
47 using base::android::ConvertJavaStringToUTF16; 48 using base::android::ConvertJavaStringToUTF16;
48 using base::android::ConvertUTF8ToJavaString; 49 using base::android::ConvertUTF8ToJavaString;
49 using base::android::ConvertUTF16ToJavaString; 50 using base::android::ConvertUTF16ToJavaString;
50 using base::android::JavaParamRef; 51 using base::android::JavaParamRef;
(...skipping 658 matching lines...) Expand 10 before | Expand all | Expand 10 after
709 jboolean value) { 710 jboolean value) {
710 web_contents_->SetHasPersistentVideo(value); 711 web_contents_->SetHasPersistentVideo(value);
711 } 712 }
712 713
713 bool WebContentsAndroid::HasActiveEffectivelyFullscreenVideo( 714 bool WebContentsAndroid::HasActiveEffectivelyFullscreenVideo(
714 JNIEnv* env, 715 JNIEnv* env,
715 const base::android::JavaParamRef<jobject>& obj) { 716 const base::android::JavaParamRef<jobject>& obj) {
716 return web_contents_->HasActiveEffectivelyFullscreenVideo(); 717 return web_contents_->HasActiveEffectivelyFullscreenVideo();
717 } 718 }
718 719
720 ScopedJavaLocalRef<jobject> WebContentsAndroid::CreateEventHandler(
721 JNIEnv* env,
722 const base::android::JavaParamRef<jobject>& obj) {
723 gfx::NativeView native_view = web_contents_->GetView()->GetNativeView();
724 return native_view->CreateEventHandler()->CreateJavaObject();
725 }
726
719 void WebContentsAndroid::OnFinishGetContentBitmap( 727 void WebContentsAndroid::OnFinishGetContentBitmap(
720 const JavaRef<jobject>& obj, 728 const JavaRef<jobject>& obj,
721 const JavaRef<jobject>& callback, 729 const JavaRef<jobject>& callback,
722 const SkBitmap& bitmap, 730 const SkBitmap& bitmap,
723 ReadbackResponse response) { 731 ReadbackResponse response) {
724 JNIEnv* env = base::android::AttachCurrentThread(); 732 JNIEnv* env = base::android::AttachCurrentThread();
725 ScopedJavaLocalRef<jobject> java_bitmap; 733 ScopedJavaLocalRef<jobject> java_bitmap;
726 if (response == READBACK_SUCCESS) 734 if (response == READBACK_SUCCESS)
727 java_bitmap = gfx::ConvertToJavaBitmap(&bitmap); 735 java_bitmap = gfx::ConvertToJavaBitmap(&bitmap);
728 Java_WebContentsImpl_onGetContentBitmapFinished(env, obj, callback, 736 Java_WebContentsImpl_onGetContentBitmapFinished(env, obj, callback,
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
760 env, obj, callback, id, http_status_code, jurl, jbitmaps, jsizes); 768 env, obj, callback, id, http_status_code, jurl, jbitmaps, jsizes);
761 } 769 }
762 770
763 void WebContentsAndroid::SetMediaSession( 771 void WebContentsAndroid::SetMediaSession(
764 const ScopedJavaLocalRef<jobject>& j_media_session) { 772 const ScopedJavaLocalRef<jobject>& j_media_session) {
765 JNIEnv* env = base::android::AttachCurrentThread(); 773 JNIEnv* env = base::android::AttachCurrentThread();
766 Java_WebContentsImpl_setMediaSession(env, obj_, j_media_session); 774 Java_WebContentsImpl_setMediaSession(env, obj_, j_media_session);
767 } 775 }
768 776
769 } // namespace content 777 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698