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

Unified 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: Made WindowAndroid::content_offset() device scale independent, restored AwContents.onSizeChanged(),… Created 4 years, 4 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/android/content_view_core_impl.cc
diff --git a/content/browser/android/content_view_core_impl.cc b/content/browser/android/content_view_core_impl.cc
index bee676ccad0a560288c9ea6fa10aa8d949b1b53b..b42483def0ae467abfa3ed0f312f4c642ac99104 100644
--- a/content/browser/android/content_view_core_impl.cc
+++ b/content/browser/android/content_view_core_impl.cc
@@ -429,8 +429,7 @@ void ContentViewCoreImpl::UpdateFrameInfo(
if (obj.is_null() || !view_.GetWindowAndroid())
return;
- view_.GetWindowAndroid()->set_content_offset(
- gfx::ScaleVector2d(content_offset, dpi_scale_));
+ view_.GetWindowAndroid()->set_content_offset(content_offset);
boliu 2016/08/16 15:03:03 this change and it's fallout can be in a separate
Tima Vaisburd 2016/08/16 20:55:28 Created https://codereview.chromium.org/2249243002
page_scale_ = page_scale_factor;
@@ -909,6 +908,13 @@ void ContentViewCoreImpl::SetFocus(JNIEnv* env,
SetFocusInternal(focused);
}
+void ContentViewCoreImpl::SetDeviceScaleFactor(JNIEnv* env,
+ const JavaParamRef<jobject>& obj,
+ jfloat device_scale) {
+ DVLOG(1) << __FUNCTION__ << " " << device_scale;
+ dpi_scale_ = device_scale;
boliu 2016/08/16 15:03:03 what about all the places where dpi_scale() is cal
+}
+
void ContentViewCoreImpl::SetFocusInternal(bool focused) {
if (!GetRenderWidgetHostViewAndroid())
return;

Powered by Google App Engine
This is Rietveld 408576698