Chromium Code Reviews| 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 901 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 912 WebContents* ContentViewCoreImpl::GetWebContents() const { | 912 WebContents* ContentViewCoreImpl::GetWebContents() const { |
| 913 return web_contents_; | 913 return web_contents_; |
| 914 } | 914 } |
| 915 | 915 |
| 916 void ContentViewCoreImpl::SetFocus(JNIEnv* env, | 916 void ContentViewCoreImpl::SetFocus(JNIEnv* env, |
| 917 const JavaParamRef<jobject>& obj, | 917 const JavaParamRef<jobject>& obj, |
| 918 jboolean focused) { | 918 jboolean focused) { |
| 919 SetFocusInternal(focused); | 919 SetFocusInternal(focused); |
| 920 } | 920 } |
| 921 | 921 |
| 922 void ContentViewCoreImpl::SetDeviceScaleFactor(JNIEnv* env, | |
| 923 const JavaParamRef<jobject>& obj, | |
| 924 jfloat device_scale) { | |
| 925 DVLOG(1) << __FUNCTION__ << " " << device_scale; | |
| 926 dpi_scale_ = device_scale; | |
|
boliu
2016/08/02 18:09:27
this should probably do more than just set the val
Tima Vaisburd
2016/08/16 00:21:01
Did not quite get your idea. I think everything th
| |
| 927 } | |
| 928 | |
| 922 void ContentViewCoreImpl::SetFocusInternal(bool focused) { | 929 void ContentViewCoreImpl::SetFocusInternal(bool focused) { |
| 923 if (!GetRenderWidgetHostViewAndroid()) | 930 if (!GetRenderWidgetHostViewAndroid()) |
| 924 return; | 931 return; |
| 925 | 932 |
| 926 if (focused) | 933 if (focused) |
| 927 GetRenderWidgetHostViewAndroid()->Focus(); | 934 GetRenderWidgetHostViewAndroid()->Focus(); |
| 928 else | 935 else |
| 929 GetRenderWidgetHostViewAndroid()->Blur(); | 936 GetRenderWidgetHostViewAndroid()->Blur(); |
| 930 } | 937 } |
| 931 | 938 |
| (...skipping 716 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1648 return ScopedJavaLocalRef<jobject>(); | 1655 return ScopedJavaLocalRef<jobject>(); |
| 1649 | 1656 |
| 1650 return view->GetJavaObject(); | 1657 return view->GetJavaObject(); |
| 1651 } | 1658 } |
| 1652 | 1659 |
| 1653 bool RegisterContentViewCore(JNIEnv* env) { | 1660 bool RegisterContentViewCore(JNIEnv* env) { |
| 1654 return RegisterNativesImpl(env) && JNI_DragEvent::RegisterNativesImpl(env); | 1661 return RegisterNativesImpl(env) && JNI_DragEvent::RegisterNativesImpl(env); |
| 1655 } | 1662 } |
| 1656 | 1663 |
| 1657 } // namespace content | 1664 } // namespace content |
| OLD | NEW |