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

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: rebase 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
« no previous file with comments | « android_webview/native/aw_contents.h ('k') | android_webview/native/aw_settings.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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> 7 #include <limits>
8 8
9 #include "android_webview/browser/aw_browser_context.h" 9 #include "android_webview/browser/aw_browser_context.h"
10 #include "android_webview/browser/aw_browser_main_parts.h" 10 #include "android_webview/browser/aw_browser_main_parts.h"
(...skipping 825 matching lines...) Expand 10 before | Expand all | Expand 10 after
836 836
837 void AwContents::OnWebLayoutPageScaleFactorChanged(float page_scale_factor) { 837 void AwContents::OnWebLayoutPageScaleFactorChanged(float page_scale_factor) {
838 JNIEnv* env = AttachCurrentThread(); 838 JNIEnv* env = AttachCurrentThread();
839 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); 839 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env);
840 if (obj.is_null()) 840 if (obj.is_null())
841 return; 841 return;
842 Java_AwContents_onWebLayoutPageScaleFactorChanged(env, obj.obj(), 842 Java_AwContents_onWebLayoutPageScaleFactorChanged(env, obj.obj(),
843 page_scale_factor); 843 page_scale_factor);
844 } 844 }
845 845
846 void AwContents::OnWebLayoutContentsSizeChanged(
847 const gfx::Size& contents_size) {
848 JNIEnv* env = AttachCurrentThread();
849 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env);
850 if (obj.is_null())
851 return;
852 Java_AwContents_onWebLayoutContentsSizeChanged(
853 env, obj.obj(), contents_size.width(), contents_size.height());
854 }
855
846 jint AwContents::CapturePicture(JNIEnv* env, 856 jint AwContents::CapturePicture(JNIEnv* env,
847 jobject obj, 857 jobject obj,
848 int width, 858 int width,
849 int height) { 859 int height) {
850 return reinterpret_cast<jint>(new AwPicture( 860 return reinterpret_cast<jint>(new AwPicture(
851 browser_view_renderer_->CapturePicture(width, height))); 861 browser_view_renderer_->CapturePicture(width, height)));
852 } 862 }
853 863
854 void AwContents::EnableOnNewPicture(JNIEnv* env, 864 void AwContents::EnableOnNewPicture(JNIEnv* env,
855 jobject obj, 865 jobject obj,
856 jboolean enabled) { 866 jboolean enabled) {
857 browser_view_renderer_->EnableOnNewPicture(enabled); 867 browser_view_renderer_->EnableOnNewPicture(enabled);
858 } 868 }
859 869
860 void AwContents::SetJsOnlineProperty(JNIEnv* env, 870 void AwContents::SetJsOnlineProperty(JNIEnv* env,
861 jobject obj, 871 jobject obj,
862 jboolean network_up) { 872 jboolean network_up) {
863 render_view_host_ext_->SetJsOnlineProperty(network_up); 873 render_view_host_ext_->SetJsOnlineProperty(network_up);
864 } 874 }
865 875
866 } // namespace android_webview 876 } // namespace android_webview
OLDNEW
« no previous file with comments | « android_webview/native/aw_contents.h ('k') | android_webview/native/aw_settings.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698