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

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

Issue 696503002: [Android] Use the Activity context for content selection handles (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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 687 matching lines...) Expand 10 before | Expand all | Expand 10 after
698 } 698 }
699 699
700 void ContentViewCoreImpl::DidStopFlinging() { 700 void ContentViewCoreImpl::DidStopFlinging() {
701 JNIEnv* env = AttachCurrentThread(); 701 JNIEnv* env = AttachCurrentThread();
702 702
703 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); 703 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env);
704 if (!obj.is_null()) 704 if (!obj.is_null())
705 Java_ContentViewCore_onNativeFlingStopped(env, obj.obj()); 705 Java_ContentViewCore_onNativeFlingStopped(env, obj.obj());
706 } 706 }
707 707
708 ScopedJavaLocalRef<jobject> ContentViewCoreImpl::GetContext() const {
709 JNIEnv* env = AttachCurrentThread();
710
711 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env);
712 if (obj.is_null())
713 return ScopedJavaLocalRef<jobject>();
714
715 return Java_ContentViewCore_getContext(env, obj.obj());
716 }
717
708 gfx::Size ContentViewCoreImpl::GetViewSize() const { 718 gfx::Size ContentViewCoreImpl::GetViewSize() const {
709 gfx::Size size = GetViewportSizeDip(); 719 gfx::Size size = GetViewportSizeDip();
710 size.Enlarge(0, -GetTopControlsLayoutHeightDip()); 720 size.Enlarge(0, -GetTopControlsLayoutHeightDip());
711 return size; 721 return size;
712 } 722 }
713 723
714 gfx::Size ContentViewCoreImpl::GetPhysicalBackingSize() const { 724 gfx::Size ContentViewCoreImpl::GetPhysicalBackingSize() const {
715 JNIEnv* env = AttachCurrentThread(); 725 JNIEnv* env = AttachCurrentThread();
716 ScopedJavaLocalRef<jobject> j_obj = java_ref_.get(env); 726 ScopedJavaLocalRef<jobject> j_obj = java_ref_.get(env);
717 if (j_obj.is_null()) 727 if (j_obj.is_null())
(...skipping 590 matching lines...) Expand 10 before | Expand all | Expand 10 after
1308 reinterpret_cast<ui::WindowAndroid*>(window_android), 1318 reinterpret_cast<ui::WindowAndroid*>(window_android),
1309 retained_objects_set); 1319 retained_objects_set);
1310 return reinterpret_cast<intptr_t>(view); 1320 return reinterpret_cast<intptr_t>(view);
1311 } 1321 }
1312 1322
1313 bool RegisterContentViewCore(JNIEnv* env) { 1323 bool RegisterContentViewCore(JNIEnv* env) {
1314 return RegisterNativesImpl(env); 1324 return RegisterNativesImpl(env);
1315 } 1325 }
1316 1326
1317 } // namespace content 1327 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/android/content_view_core_impl.h ('k') | content/browser/renderer_host/render_widget_host_view_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698