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

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

Issue 351683002: Adds link disambiguation popup support to Windows. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: adds mouse event support in popup bubble Created 6 years, 3 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 2012 The Chromium Authors. All rights reserved. 1 // Copyright 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 637 matching lines...) Expand 10 before | Expand all | Expand 10 after
648 if (j_obj.is_null()) 648 if (j_obj.is_null())
649 return; 649 return;
650 ScopedJavaLocalRef<jstring> jcontent_url = 650 ScopedJavaLocalRef<jstring> jcontent_url =
651 ConvertUTF8ToJavaString(env, content_url.spec()); 651 ConvertUTF8ToJavaString(env, content_url.spec());
652 Java_ContentViewCore_startContentIntent(env, 652 Java_ContentViewCore_startContentIntent(env,
653 j_obj.obj(), 653 j_obj.obj(),
654 jcontent_url.obj()); 654 jcontent_url.obj());
655 } 655 }
656 656
657 void ContentViewCoreImpl::ShowDisambiguationPopup( 657 void ContentViewCoreImpl::ShowDisambiguationPopup(
658 const gfx::Rect& target_rect, 658 const gfx::Rect& rect_pixels,
659 const SkBitmap& zoomed_bitmap) { 659 const SkBitmap& zoomed_bitmap) {
660 JNIEnv* env = AttachCurrentThread(); 660 JNIEnv* env = AttachCurrentThread();
661 661
662 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); 662 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env);
663 if (obj.is_null()) 663 if (obj.is_null())
664 return; 664 return;
665 665
666 ScopedJavaLocalRef<jobject> rect_object(CreateJavaRect(env, target_rect)); 666 ScopedJavaLocalRef<jobject> rect_object(CreateJavaRect(env, rect_pixels));
667 667
668 ScopedJavaLocalRef<jobject> java_bitmap = 668 ScopedJavaLocalRef<jobject> java_bitmap =
669 gfx::ConvertToJavaBitmap(&zoomed_bitmap); 669 gfx::ConvertToJavaBitmap(&zoomed_bitmap);
670 DCHECK(!java_bitmap.is_null()); 670 DCHECK(!java_bitmap.is_null());
671 671
672 Java_ContentViewCore_showDisambiguationPopup(env, 672 Java_ContentViewCore_showDisambiguationPopup(env,
673 obj.obj(), 673 obj.obj(),
674 rect_object.obj(), 674 rect_object.obj(),
675 java_bitmap.obj()); 675 java_bitmap.obj());
676 } 676 }
(...skipping 662 matching lines...) Expand 10 before | Expand all | Expand 10 after
1339 reinterpret_cast<ui::WindowAndroid*>(window_android), 1339 reinterpret_cast<ui::WindowAndroid*>(window_android),
1340 retained_objects_set); 1340 retained_objects_set);
1341 return reinterpret_cast<intptr_t>(view); 1341 return reinterpret_cast<intptr_t>(view);
1342 } 1342 }
1343 1343
1344 bool RegisterContentViewCore(JNIEnv* env) { 1344 bool RegisterContentViewCore(JNIEnv* env) {
1345 return RegisterNativesImpl(env); 1345 return RegisterNativesImpl(env);
1346 } 1346 }
1347 1347
1348 } // namespace content 1348 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698