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::SetDIPScale(JNIEnv* env, | |
888 const JavaParamRef<jobject>& obj, | |
889 jfloat dipScale) { | |
890 dpi_scale_ = dipScale; | |
891 | |
892 // Force new layout. | |
893 RenderWidgetHostViewAndroid* view = GetRenderWidgetHostViewAndroid(); | |
894 if (view) | |
895 view->WasResized(); | |
boliu
2016/09/15 05:27:41
don't duplicate code, factor out the current CVCI:
Tima Vaisburd
2016/09/16 23:59:26
Done.
| |
896 } | |
897 | |
887 void ContentViewCoreImpl::SetFocusInternal(bool focused) { | 898 void ContentViewCoreImpl::SetFocusInternal(bool focused) { |
888 if (!GetRenderWidgetHostViewAndroid()) | 899 if (!GetRenderWidgetHostViewAndroid()) |
889 return; | 900 return; |
890 | 901 |
891 if (focused) | 902 if (focused) |
892 GetRenderWidgetHostViewAndroid()->Focus(); | 903 GetRenderWidgetHostViewAndroid()->Focus(); |
893 else | 904 else |
894 GetRenderWidgetHostViewAndroid()->Blur(); | 905 GetRenderWidgetHostViewAndroid()->Blur(); |
895 } | 906 } |
896 | 907 |
(...skipping 705 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1602 return ScopedJavaLocalRef<jobject>(); | 1613 return ScopedJavaLocalRef<jobject>(); |
1603 | 1614 |
1604 return view->GetJavaObject(); | 1615 return view->GetJavaObject(); |
1605 } | 1616 } |
1606 | 1617 |
1607 bool RegisterContentViewCore(JNIEnv* env) { | 1618 bool RegisterContentViewCore(JNIEnv* env) { |
1608 return RegisterNativesImpl(env); | 1619 return RegisterNativesImpl(env); |
1609 } | 1620 } |
1610 | 1621 |
1611 } // namespace content | 1622 } // namespace content |
OLD | NEW |