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

Side by Side Diff: android_webview/native/aw_contents.cc

Issue 23478022: [android_webview] Fixes for wrap_content layouts. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix comment nit Created 7 years, 3 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 | Annotate | Revision Log
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 "android_webview/native/aw_contents.h" 5 #include "android_webview/native/aw_contents.h"
6 6
7 #include <limits>
8
7 #include "android_webview/browser/aw_browser_context.h" 9 #include "android_webview/browser/aw_browser_context.h"
8 #include "android_webview/browser/aw_browser_main_parts.h" 10 #include "android_webview/browser/aw_browser_main_parts.h"
9 #include "android_webview/browser/gpu_memory_buffer_factory_impl.h" 11 #include "android_webview/browser/gpu_memory_buffer_factory_impl.h"
10 #include "android_webview/browser/in_process_view_renderer.h" 12 #include "android_webview/browser/in_process_view_renderer.h"
11 #include "android_webview/browser/net_disk_cache_remover.h" 13 #include "android_webview/browser/net_disk_cache_remover.h"
12 #include "android_webview/browser/renderer_host/aw_resource_dispatcher_host_dele gate.h" 14 #include "android_webview/browser/renderer_host/aw_resource_dispatcher_host_dele gate.h"
13 #include "android_webview/common/aw_hit_test_data.h" 15 #include "android_webview/common/aw_hit_test_data.h"
14 #include "android_webview/native/aw_autofill_manager_delegate.h" 16 #include "android_webview/native/aw_autofill_manager_delegate.h"
15 #include "android_webview/native/aw_browser_dependency_factory.h" 17 #include "android_webview/native/aw_browser_dependency_factory.h"
16 #include "android_webview/native/aw_contents_client_bridge.h" 18 #include "android_webview/native/aw_contents_client_bridge.h"
(...skipping 28 matching lines...) Expand all
45 #include "content/public/browser/render_view_host.h" 47 #include "content/public/browser/render_view_host.h"
46 #include "content/public/browser/web_contents.h" 48 #include "content/public/browser/web_contents.h"
47 #include "content/public/common/renderer_preferences.h" 49 #include "content/public/common/renderer_preferences.h"
48 #include "content/public/common/ssl_status.h" 50 #include "content/public/common/ssl_status.h"
49 #include "jni/AwContents_jni.h" 51 #include "jni/AwContents_jni.h"
50 #include "net/cert/x509_certificate.h" 52 #include "net/cert/x509_certificate.h"
51 #include "third_party/skia/include/core/SkPicture.h" 53 #include "third_party/skia/include/core/SkPicture.h"
52 #include "ui/base/l10n/l10n_util_android.h" 54 #include "ui/base/l10n/l10n_util_android.h"
53 #include "ui/gfx/android/java_bitmap.h" 55 #include "ui/gfx/android/java_bitmap.h"
54 #include "ui/gfx/image/image.h" 56 #include "ui/gfx/image/image.h"
57 #include "ui/gfx/size.h"
55 58
56 struct AwDrawSWFunctionTable; 59 struct AwDrawSWFunctionTable;
57 struct AwDrawGLFunctionTable; 60 struct AwDrawGLFunctionTable;
58 61
59 using autofill::AutofillDriverImpl; 62 using autofill::AutofillDriverImpl;
60 using autofill::AutofillManager; 63 using autofill::AutofillManager;
61 using base::android::AttachCurrentThread; 64 using base::android::AttachCurrentThread;
62 using base::android::ConvertJavaStringToUTF16; 65 using base::android::ConvertJavaStringToUTF16;
63 using base::android::ConvertJavaStringToUTF8; 66 using base::android::ConvertJavaStringToUTF8;
64 using base::android::ConvertUTF16ToJavaString; 67 using base::android::ConvertUTF16ToJavaString;
(...skipping 687 matching lines...) Expand 10 before | Expand all | Expand 10 after
752 755
753 void AwContents::DidOverscroll(gfx::Vector2d overscroll_delta) { 756 void AwContents::DidOverscroll(gfx::Vector2d overscroll_delta) {
754 JNIEnv* env = AttachCurrentThread(); 757 JNIEnv* env = AttachCurrentThread();
755 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); 758 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env);
756 if (obj.is_null()) 759 if (obj.is_null())
757 return; 760 return;
758 Java_AwContents_didOverscroll( 761 Java_AwContents_didOverscroll(
759 env, obj.obj(), overscroll_delta.x(), overscroll_delta.y()); 762 env, obj.obj(), overscroll_delta.x(), overscroll_delta.y());
760 } 763 }
761 764
762 void AwContents::SetDipScale(JNIEnv* env, jobject obj, jfloat dipScale) { 765 void AwContents::SetDipScale(JNIEnv* env, jobject obj, jfloat dip_scale) {
763 browser_view_renderer_->SetDipScale(dipScale); 766 browser_view_renderer_->SetDipScale(dip_scale);
764 } 767 }
765 768
766 void AwContents::SetDisplayedPageScaleFactor(JNIEnv* env, 769 void AwContents::SetDisplayedPageScaleFactor(JNIEnv* env,
767 jobject obj, 770 jobject obj,
768 jfloat pageScaleFactor) { 771 jfloat page_scale_factor) {
769 browser_view_renderer_->SetPageScaleFactor(pageScaleFactor); 772 browser_view_renderer_->SetPageScaleFactor(page_scale_factor);
773 }
774
775 void AwContents::SetFixedLayoutSize(JNIEnv* env,
776 jobject obj,
777 jint width_dip,
778 jint height_dip) {
779 render_view_host_ext_->SetFixedLayoutSize(gfx::Size(width_dip, height_dip));
770 } 780 }
771 781
772 void AwContents::ScrollTo(JNIEnv* env, jobject obj, jint xPix, jint yPix) { 782 void AwContents::ScrollTo(JNIEnv* env, jobject obj, jint xPix, jint yPix) {
773 browser_view_renderer_->ScrollTo(gfx::Vector2d(xPix, yPix)); 783 browser_view_renderer_->ScrollTo(gfx::Vector2d(xPix, yPix));
774 } 784 }
775 785
776 void AwContents::OnWebLayoutPageScaleFactorChanged(float page_scale_factor) { 786 void AwContents::OnWebLayoutPageScaleFactorChanged(float page_scale_factor) {
777 JNIEnv* env = AttachCurrentThread(); 787 JNIEnv* env = AttachCurrentThread();
778 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); 788 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env);
779 if (obj.is_null()) 789 if (obj.is_null())
(...skipping 16 matching lines...) Expand all
796 browser_view_renderer_->EnableOnNewPicture(enabled); 806 browser_view_renderer_->EnableOnNewPicture(enabled);
797 } 807 }
798 808
799 void AwContents::SetJsOnlineProperty(JNIEnv* env, 809 void AwContents::SetJsOnlineProperty(JNIEnv* env,
800 jobject obj, 810 jobject obj,
801 jboolean network_up) { 811 jboolean network_up) {
802 render_view_host_ext_->SetJsOnlineProperty(network_up); 812 render_view_host_ext_->SetJsOnlineProperty(network_up);
803 } 813 }
804 814
805 } // namespace android_webview 815 } // namespace android_webview
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698