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

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

Issue 10993089: Upstream Android implementation of WebContentsViewDelegate. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 8 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 | 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 361 matching lines...) Expand 10 before | Expand all | Expand 10 after
372 end_rect.y(), 372 end_rect.y(),
373 end_rect.right(), 373 end_rect.right(),
374 end_rect.bottom())); 374 end_rect.bottom()));
375 Java_ContentViewCore_onSelectionBoundsChanged(env, obj.obj(), 375 Java_ContentViewCore_onSelectionBoundsChanged(env, obj.obj(),
376 start_rect_object.obj(), 376 start_rect_object.obj(),
377 start_dir, 377 start_dir,
378 end_rect_object.obj(), 378 end_rect_object.obj(),
379 end_dir); 379 end_dir);
380 } 380 }
381 381
382 void ContentViewCoreImpl::ShowPastePopup(int x, int y) {
383 JNIEnv* env = AttachCurrentThread();
384 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env);
385 if (obj.is_null())
386 return;
387 Java_ContentViewCore_showPastePopup(env, obj.obj(), static_cast<jint>(x),
388 static_cast<jint>(y));
389 }
390
382 void ContentViewCoreImpl::StartContentIntent(const GURL& content_url) { 391 void ContentViewCoreImpl::StartContentIntent(const GURL& content_url) {
383 JNIEnv* env = AttachCurrentThread(); 392 JNIEnv* env = AttachCurrentThread();
384 ScopedJavaLocalRef<jobject> j_obj = java_ref_.get(env); 393 ScopedJavaLocalRef<jobject> j_obj = java_ref_.get(env);
385 if (j_obj.is_null()) 394 if (j_obj.is_null())
386 return; 395 return;
387 ScopedJavaLocalRef<jstring> jcontent_url = 396 ScopedJavaLocalRef<jstring> jcontent_url =
388 ConvertUTF8ToJavaString(env, content_url.spec()); 397 ConvertUTF8ToJavaString(env, content_url.spec());
389 Java_ContentViewCore_startContentIntent(env, 398 Java_ContentViewCore_startContentIntent(env,
390 j_obj.obj(), 399 j_obj.obj(),
391 jcontent_url.obj()); 400 jcontent_url.obj());
(...skipping 574 matching lines...) Expand 10 before | Expand all | Expand 10 after
966 if (!HasField(env, clazz, "mNativeContentViewCore", "I")) { 975 if (!HasField(env, clazz, "mNativeContentViewCore", "I")) {
967 DLOG(ERROR) << "Unable to find ContentView.mNativeContentViewCore!"; 976 DLOG(ERROR) << "Unable to find ContentView.mNativeContentViewCore!";
968 return false; 977 return false;
969 } 978 }
970 g_native_content_view = GetFieldID(env, clazz, "mNativeContentViewCore", "I"); 979 g_native_content_view = GetFieldID(env, clazz, "mNativeContentViewCore", "I");
971 980
972 return RegisterNativesImpl(env) >= 0; 981 return RegisterNativesImpl(env) >= 0;
973 } 982 }
974 983
975 } // namespace content 984 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698