Chromium Code Reviews| 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 93e95b3df5aeba29952e178285429f7779b183de..b47c7bd56da0e5aab21a439a32fd827ecf074201 100644 |
| --- a/content/browser/android/content_view_core_impl.cc |
| +++ b/content/browser/android/content_view_core_impl.cc |
| @@ -229,12 +229,6 @@ ContentViewCoreImpl::ContentViewCoreImpl( |
| dpi_scale_(dpi_scale), |
| 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); |
| - |
| // Currently, the only use case we have for overriding a user agent involves |
| // spoofing a desktop Linux user agent for "Request desktop site". |
| // Automatically set it for all WebContents so that it is available when a |
| @@ -734,16 +728,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); |
| @@ -1266,11 +1250,6 @@ 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); |
| - |
| SendScreenRectsAndResizeWidget(); |
| } |
| @@ -1590,6 +1569,7 @@ jlong Init(JNIEnv* env, |
| "A ContentViewCoreImpl should be created with a valid WebContents."; |
| ui::ViewAndroid* view_android = web_contents->GetView()->GetNativeView(); |
| view_android->SetDelegate(jview_android_delegate); |
| + view_android->SetLayer(cc::Layer::Create()); |
|
boliu
2016/12/08 05:01:06
if this ViewAndroid didn't have a layer, then don'
Jinsuk Kim
2016/12/13 23:20:38
Yes you did, and this was my reply : "Yes, also th
boliu
2016/12/13 23:50:41
Ohh, didn't notice it's moved. That's fine then
|
| ui::WindowAndroid* window_android = |
| reinterpret_cast<ui::WindowAndroid*>(jwindow_android); |