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

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

Issue 2202123002: Make WebView respond to device scale change (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Combined two setSize methods again with question Created 4 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 <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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698