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

Unified Diff: content/browser/android/content_view_core_impl.cc

Issue 2842693005: Store physical backing size in ViewAndroid (Closed)
Patch Set: no cvc/eventf Created 3 years, 8 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 f79636db8f4ea8c4b370091484c3ce0fa47be532..de5cd5715e3e5cc73ec3a4e71b6f908d815a8d1c 100644
--- a/content/browser/android/content_view_core_impl.cc
+++ b/content/browser/android/content_view_core_impl.cc
@@ -221,10 +221,7 @@ ContentViewCoreImpl::ContentViewCoreImpl(
device_orientation_(0),
accessibility_enabled_(false) {
GetViewAndroid()->SetLayer(cc::Layer::Create());
- gfx::Size physical_size(
- Java_ContentViewCore_getPhysicalBackingWidthPix(env, obj),
- Java_ContentViewCore_getPhysicalBackingHeightPix(env, obj));
- GetViewAndroid()->GetLayer()->SetBounds(physical_size);
+ GetViewAndroid()->UpdateLayerBounds();
boliu 2017/04/29 00:18:40 SetLayer should just do this automatically
Jinsuk Kim 2017/04/30 00:23:50 Done.
// Currently, the only use case we have for overriding a user agent involves
// spoofing a desktop Linux user agent for "Request desktop site".
@@ -656,16 +653,6 @@ gfx::Size ContentViewCoreImpl::GetViewSize() const {
return size;
}
-gfx::Size ContentViewCoreImpl::GetPhysicalBackingSize() const {
- JNIEnv* env = AttachCurrentThread();
- ScopedJavaLocalRef<jobject> j_obj = java_ref_.get(env);
- if (j_obj.is_null())
- return gfx::Size();
- return gfx::Size(
- Java_ContentViewCore_getPhysicalBackingWidthPix(env, j_obj),
- Java_ContentViewCore_getPhysicalBackingHeightPix(env, j_obj));
-}
-
gfx::Size ContentViewCoreImpl::GetViewportSizePix() const {
JNIEnv* env = AttachCurrentThread();
ScopedJavaLocalRef<jobject> j_obj = java_ref_.get(env);
@@ -1030,11 +1017,7 @@ void ContentViewCoreImpl::RemoveJavascriptInterface(
void ContentViewCoreImpl::WasResized(JNIEnv* env,
const JavaParamRef<jobject>& obj) {
- gfx::Size physical_size(
- Java_ContentViewCore_getPhysicalBackingWidthPix(env, obj),
- Java_ContentViewCore_getPhysicalBackingHeightPix(env, obj));
- GetViewAndroid()->GetLayer()->SetBounds(physical_size);
-
+ GetViewAndroid()->UpdateLayerBounds();
boliu 2017/04/29 00:18:40 this intuitively makes no sense, because now that
Jinsuk Kim 2017/04/30 00:23:49 It was added here: https://codereview.chromium.org
SendScreenRectsAndResizeWidget();
}

Powered by Google App Engine
This is Rietveld 408576698