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

Side by Side Diff: android_webview/java/src/org/chromium/android_webview/AwContents.java

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
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 package org.chromium.android_webview; 5 package org.chromium.android_webview;
6 6
7 import android.content.pm.PackageManager; 7 import android.content.pm.PackageManager;
8 import android.content.res.Configuration; 8 import android.content.res.Configuration;
9 import android.graphics.Bitmap; 9 import android.graphics.Bitmap;
10 import android.graphics.Canvas; 10 import android.graphics.Canvas;
(...skipping 477 matching lines...) Expand 10 before | Expand all | Expand 10 after
488 boolean isAccessFromFileURLsGrantedByDefault, AwLayoutSizer layoutSi zer, 488 boolean isAccessFromFileURLsGrantedByDefault, AwLayoutSizer layoutSi zer,
489 boolean supportsLegacyQuirks) { 489 boolean supportsLegacyQuirks) {
490 mBrowserContext = browserContext; 490 mBrowserContext = browserContext;
491 mContainerView = containerView; 491 mContainerView = containerView;
492 mInternalAccessAdapter = internalAccessAdapter; 492 mInternalAccessAdapter = internalAccessAdapter;
493 mContentsClient = contentsClient; 493 mContentsClient = contentsClient;
494 mLayoutSizer = layoutSizer; 494 mLayoutSizer = layoutSizer;
495 mDIPScale = DeviceDisplayInfo.create(containerView.getContext()).getDIPS cale(); 495 mDIPScale = DeviceDisplayInfo.create(containerView.getContext()).getDIPS cale();
496 mLayoutSizer.setDelegate(new AwLayoutSizerDelegate()); 496 mLayoutSizer.setDelegate(new AwLayoutSizerDelegate());
497 mLayoutSizer.setDIPScale(mDIPScale); 497 mLayoutSizer.setDIPScale(mDIPScale);
498 mWebContentsDelegate = new AwWebContentsDelegateAdapter(contentsClient, 498 mWebContentsDelegate = new AwWebContentsDelegateAdapter(contentsClient, mContainerView);
499 mLayoutSizer.getPreferredSizeChangedListener(), mContainerView);
500 mContentsClientBridge = new AwContentsClientBridge(contentsClient); 499 mContentsClientBridge = new AwContentsClientBridge(contentsClient);
501 mZoomControls = new AwZoomControls(this); 500 mZoomControls = new AwZoomControls(this);
502 mIoThreadClient = new IoThreadClientImpl(); 501 mIoThreadClient = new IoThreadClientImpl();
503 mInterceptNavigationDelegate = new InterceptNavigationDelegateImpl(); 502 mInterceptNavigationDelegate = new InterceptNavigationDelegateImpl();
504 503
505 boolean hasInternetPermission = containerView.getContext().checkPermissi on( 504 boolean hasInternetPermission = containerView.getContext().checkPermissi on(
506 android.Manifest.permission.INTERNET, 505 android.Manifest.permission.INTERNET,
507 Process.myPid(), 506 Process.myPid(),
508 Process.myUid()) == PackageManager.PERMISSION_GRANTED; 507 Process.myUid()) == PackageManager.PERMISSION_GRANTED;
509 AwSettings.ZoomSupportChangeListener zoomListener = 508 AwSettings.ZoomSupportChangeListener zoomListener =
(...skipping 1275 matching lines...) Expand 10 before | Expand all | Expand 10 after
1785 return result; 1784 return result;
1786 } 1785 }
1787 1786
1788 @CalledByNative 1787 @CalledByNative
1789 private void onWebLayoutPageScaleFactorChanged(float webLayoutPageScaleFacto r) { 1788 private void onWebLayoutPageScaleFactorChanged(float webLayoutPageScaleFacto r) {
1790 // This change notification comes from the renderer thread, not from the cc/ impl thread. 1789 // This change notification comes from the renderer thread, not from the cc/ impl thread.
1791 mLayoutSizer.onPageScaleChanged(webLayoutPageScaleFactor); 1790 mLayoutSizer.onPageScaleChanged(webLayoutPageScaleFactor);
1792 } 1791 }
1793 1792
1794 @CalledByNative 1793 @CalledByNative
1794 private void onWebLayoutContentsSizeChanged(int widthCss, int heightCss) {
1795 // This change notification comes from the renderer thread, not from the cc/ impl thread.
1796 mLayoutSizer.onContentSizeChanged(widthCss, heightCss);
1797 }
1798
1799 @CalledByNative
1795 private void scrollContainerViewTo(int x, int y) { 1800 private void scrollContainerViewTo(int x, int y) {
1796 mScrollOffsetManager.scrollContainerViewTo(x, y); 1801 mScrollOffsetManager.scrollContainerViewTo(x, y);
1797 } 1802 }
1798 1803
1799 @CalledByNative 1804 @CalledByNative
1800 private void setAwAutofillManagerDelegate(AwAutofillManagerDelegate delegate ) { 1805 private void setAwAutofillManagerDelegate(AwAutofillManagerDelegate delegate ) {
1801 mAwAutofillManagerDelegate = delegate; 1806 mAwAutofillManagerDelegate = delegate;
1802 delegate.init(mContentViewCore); 1807 delegate.init(mContentViewCore);
1803 } 1808 }
1804 1809
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
1927 1932
1928 private native int nativeGetAwDrawGLViewContext(int nativeAwContents); 1933 private native int nativeGetAwDrawGLViewContext(int nativeAwContents);
1929 private native int nativeCapturePicture(int nativeAwContents, int width, int height); 1934 private native int nativeCapturePicture(int nativeAwContents, int width, int height);
1930 private native void nativeEnableOnNewPicture(int nativeAwContents, boolean e nabled); 1935 private native void nativeEnableOnNewPicture(int nativeAwContents, boolean e nabled);
1931 1936
1932 private native void nativeInvokeGeolocationCallback( 1937 private native void nativeInvokeGeolocationCallback(
1933 int nativeAwContents, boolean value, String requestingFrame); 1938 int nativeAwContents, boolean value, String requestingFrame);
1934 1939
1935 private native void nativeSetJsOnlineProperty(int nativeAwContents, boolean networkUp); 1940 private native void nativeSetJsOnlineProperty(int nativeAwContents, boolean networkUp);
1936 } 1941 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698