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

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

Issue 1386403003: Resize only the virtual viewport when the OSK triggers a resize. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: s/InsetConsumerView/InsetObserverView Created 4 years, 9 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 752 matching lines...) Expand 10 before | Expand all | Expand 10 after
763 ScopedJavaLocalRef<jobject> ContentViewCoreImpl::GetContext() const { 763 ScopedJavaLocalRef<jobject> ContentViewCoreImpl::GetContext() const {
764 JNIEnv* env = AttachCurrentThread(); 764 JNIEnv* env = AttachCurrentThread();
765 765
766 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); 766 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env);
767 if (obj.is_null()) 767 if (obj.is_null())
768 return ScopedJavaLocalRef<jobject>(); 768 return ScopedJavaLocalRef<jobject>();
769 769
770 return Java_ContentViewCore_getContext(env, obj.obj()); 770 return Java_ContentViewCore_getContext(env, obj.obj());
771 } 771 }
772 772
773 gfx::Size ContentViewCoreImpl::GetViewSizeWithOSKHidden() const {
774 gfx::Size size_pix;
775 JNIEnv* env = AttachCurrentThread();
776 ScopedJavaLocalRef<jobject> j_obj = java_ref_.get(env);
777 if (j_obj.is_null())
778 return size_pix = gfx::Size();
779 size_pix = gfx::Size(
780 Java_ContentViewCore_getViewportWidthPix(env, j_obj.obj()),
781 Java_ContentViewCore_getViewportHeightWithOSKHiddenPix(env, j_obj.obj()));
782
783 gfx::Size size_dip = gfx::ScaleToCeiledSize(size_pix, 1.0f / dpi_scale());
784 if (DoTopControlsShrinkBlinkSize())
785 size_dip.Enlarge(0, -GetTopControlsHeightDip());
786 return size_dip;
787 }
788
773 gfx::Size ContentViewCoreImpl::GetViewSize() const { 789 gfx::Size ContentViewCoreImpl::GetViewSize() const {
774 gfx::Size size = GetViewportSizeDip(); 790 gfx::Size size = GetViewportSizeDip();
775 if (DoTopControlsShrinkBlinkSize()) 791 if (DoTopControlsShrinkBlinkSize())
776 size.Enlarge(0, -GetTopControlsHeightDip()); 792 size.Enlarge(0, -GetTopControlsHeightDip());
777 return size; 793 return size;
778 } 794 }
779 795
780 gfx::Size ContentViewCoreImpl::GetPhysicalBackingSize() const { 796 gfx::Size ContentViewCoreImpl::GetPhysicalBackingSize() const {
781 JNIEnv* env = AttachCurrentThread(); 797 JNIEnv* env = AttachCurrentThread();
782 ScopedJavaLocalRef<jobject> j_obj = java_ref_.get(env); 798 ScopedJavaLocalRef<jobject> j_obj = java_ref_.get(env);
(...skipping 776 matching lines...) Expand 10 before | Expand all | Expand 10 after
1559 return ScopedJavaLocalRef<jobject>(); 1575 return ScopedJavaLocalRef<jobject>();
1560 1576
1561 return view->GetJavaObject(); 1577 return view->GetJavaObject();
1562 } 1578 }
1563 1579
1564 bool RegisterContentViewCore(JNIEnv* env) { 1580 bool RegisterContentViewCore(JNIEnv* env) {
1565 return RegisterNativesImpl(env); 1581 return RegisterNativesImpl(env);
1566 } 1582 }
1567 1583
1568 } // namespace content 1584 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/android/content_view_core_impl.h ('k') | content/browser/renderer_host/render_widget_host_view_android.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698