| OLD | NEW |
| 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 <stddef.h> | 7 #include <stddef.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 866 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 877 WebContents* ContentViewCoreImpl::GetWebContents() const { | 877 WebContents* ContentViewCoreImpl::GetWebContents() const { |
| 878 return web_contents_; | 878 return web_contents_; |
| 879 } | 879 } |
| 880 | 880 |
| 881 void ContentViewCoreImpl::SetFocus(JNIEnv* env, | 881 void ContentViewCoreImpl::SetFocus(JNIEnv* env, |
| 882 const JavaParamRef<jobject>& obj, | 882 const JavaParamRef<jobject>& obj, |
| 883 jboolean focused) { | 883 jboolean focused) { |
| 884 SetFocusInternal(focused); | 884 SetFocusInternal(focused); |
| 885 } | 885 } |
| 886 | 886 |
| 887 void ContentViewCoreImpl::SetDeviceScaleFactor(JNIEnv* env, |
| 888 const JavaParamRef<jobject>& obj, |
| 889 jfloat device_scale) { |
| 890 DVLOG(1) << __FUNCTION__ << " " << device_scale; |
| 891 dpi_scale_ = device_scale; |
| 892 } |
| 893 |
| 887 void ContentViewCoreImpl::SetFocusInternal(bool focused) { | 894 void ContentViewCoreImpl::SetFocusInternal(bool focused) { |
| 888 if (!GetRenderWidgetHostViewAndroid()) | 895 if (!GetRenderWidgetHostViewAndroid()) |
| 889 return; | 896 return; |
| 890 | 897 |
| 891 if (focused) | 898 if (focused) |
| 892 GetRenderWidgetHostViewAndroid()->Focus(); | 899 GetRenderWidgetHostViewAndroid()->Focus(); |
| 893 else | 900 else |
| 894 GetRenderWidgetHostViewAndroid()->Blur(); | 901 GetRenderWidgetHostViewAndroid()->Blur(); |
| 895 } | 902 } |
| 896 | 903 |
| (...skipping 705 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1602 return ScopedJavaLocalRef<jobject>(); | 1609 return ScopedJavaLocalRef<jobject>(); |
| 1603 | 1610 |
| 1604 return view->GetJavaObject(); | 1611 return view->GetJavaObject(); |
| 1605 } | 1612 } |
| 1606 | 1613 |
| 1607 bool RegisterContentViewCore(JNIEnv* env) { | 1614 bool RegisterContentViewCore(JNIEnv* env) { |
| 1608 return RegisterNativesImpl(env); | 1615 return RegisterNativesImpl(env); |
| 1609 } | 1616 } |
| 1610 | 1617 |
| 1611 } // namespace content | 1618 } // namespace content |
| OLD | NEW |