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

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

Issue 2502763003: Introduce ViewRoot to forward input/view events to native (Closed)
Patch Set: lazy creation Created 4 years 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 c49c4008940edc5f8ebf6c74c1c10ffca2da0fe4..f6c411a61034b86c416191abbad1c7799804d55c 100644
--- a/content/browser/android/content_view_core_impl.cc
+++ b/content/browser/android/content_view_core_impl.cc
@@ -218,9 +218,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));
+ gfx::Size physical_size(GetViewAndroid()->GetPhysicalBackingSize());
boliu 2016/12/02 23:53:22 this and below seems redundant, retrieve the physi
Jinsuk Kim 2016/12/05 11:07:44 I don't think it is necessary to set the bounds he
GetViewAndroid()->GetLayer()->SetBounds(physical_size);
// Currently, the only use case we have for overriding a user agent involves
@@ -722,16 +720,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);
@@ -1250,9 +1238,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));
+ gfx::Size physical_size(GetViewAndroid()->GetPhysicalBackingSize());
GetViewAndroid()->GetLayer()->SetBounds(physical_size);
SendScreenRectsAndResizeWidget();

Powered by Google App Engine
This is Rietveld 408576698