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

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

Issue 23899004: Use contents size for android_webview layout. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: always use contents size (preferred size is no more) 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 "android_webview/browser/aw_browser_context.h" 7 #include "android_webview/browser/aw_browser_context.h"
8 #include "android_webview/browser/aw_browser_main_parts.h" 8 #include "android_webview/browser/aw_browser_main_parts.h"
9 #include "android_webview/browser/gpu_memory_buffer_factory_impl.h" 9 #include "android_webview/browser/gpu_memory_buffer_factory_impl.h"
10 #include "android_webview/browser/in_process_view_renderer.h" 10 #include "android_webview/browser/in_process_view_renderer.h"
(...skipping 764 matching lines...) Expand 10 before | Expand all | Expand 10 after
775 775
776 void AwContents::OnWebLayoutPageScaleFactorChanged(float page_scale_factor) { 776 void AwContents::OnWebLayoutPageScaleFactorChanged(float page_scale_factor) {
777 JNIEnv* env = AttachCurrentThread(); 777 JNIEnv* env = AttachCurrentThread();
778 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); 778 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env);
779 if (obj.is_null()) 779 if (obj.is_null())
780 return; 780 return;
781 Java_AwContents_onWebLayoutPageScaleFactorChanged(env, obj.obj(), 781 Java_AwContents_onWebLayoutPageScaleFactorChanged(env, obj.obj(),
782 page_scale_factor); 782 page_scale_factor);
783 } 783 }
784 784
785 void AwContents::OnWebLayoutContentsSizeChanged(
786 const gfx::Size& contents_size) {
787 JNIEnv* env = AttachCurrentThread();
788 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env);
789 if (obj.is_null())
790 return;
791 Java_AwContents_onWebLayoutContentsSizeChanged(
792 env, obj.obj(), contents_size.width(), contents_size.height());
793 }
794
785 jint AwContents::CapturePicture(JNIEnv* env, 795 jint AwContents::CapturePicture(JNIEnv* env,
786 jobject obj, 796 jobject obj,
787 int width, 797 int width,
788 int height) { 798 int height) {
789 return reinterpret_cast<jint>(new AwPicture( 799 return reinterpret_cast<jint>(new AwPicture(
790 browser_view_renderer_->CapturePicture(width, height))); 800 browser_view_renderer_->CapturePicture(width, height)));
791 } 801 }
792 802
793 void AwContents::EnableOnNewPicture(JNIEnv* env, 803 void AwContents::EnableOnNewPicture(JNIEnv* env,
794 jobject obj, 804 jobject obj,
795 jboolean enabled) { 805 jboolean enabled) {
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