| Index: content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
|
| diff --git a/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java b/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
|
| index fa307c41c8729f8a60ea5f8d306654f94aec0aa2..0ce8c44e9e51140c1803f39350245ed28b826099 100644
|
| --- a/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
|
| +++ b/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
|
| @@ -159,19 +159,19 @@ public class ContentViewCore implements MotionEventDelegate, NavigationClient {
|
| /**
|
| * Interface for subscribing to content size changes.
|
| */
|
| - public static interface ContentSizeChangeListener {
|
| + public static interface PageScaleChangeListener {
|
| /**
|
| - * Called when the content size changes.
|
| - * The containing view may want to adjust its size to match the content.
|
| - */
|
| - void onContentSizeChanged(int contentWidthPix, int contentHeightPix);
|
| + * Lets client listen on the scaling changes on delayed, throttled
|
| + * and best-effort basis. Used for WebView.onScaleChanged.
|
| + */
|
| + void onScaleChanged(float oldScale, float newScale);
|
| }
|
|
|
| private final Context mContext;
|
| private ViewGroup mContainerView;
|
| private InternalAccessDelegate mContainerViewInternals;
|
| private WebContentsObserverAndroid mWebContentsObserver;
|
| - private ContentSizeChangeListener mContentSizeChangeListener;
|
| + private PageScaleChangeListener mPageScaleChangeListener;
|
|
|
| private ContentViewClient mContentViewClient;
|
|
|
| @@ -665,8 +665,8 @@ public class ContentViewCore implements MotionEventDelegate, NavigationClient {
|
| return mContentViewClient;
|
| }
|
|
|
| - public void setContentSizeChangeListener(ContentSizeChangeListener listener) {
|
| - mContentSizeChangeListener = listener;
|
| + public void setPageScaleChangeListener(PageScaleChangeListener listener) {
|
| + mPageScaleChangeListener = listener;
|
| }
|
|
|
| public int getBackgroundColor() {
|
| @@ -1970,11 +1970,11 @@ public class ContentViewCore implements MotionEventDelegate, NavigationClient {
|
| (int) mRenderCoordinates.getScrollYPix());
|
| }
|
|
|
| - if (pageScaleChanged) {
|
| + if (pageScaleChanged && mPageScaleChangeListener != null) {
|
| // This function should be called back from native as soon
|
| // as the scroll is applied to the backbuffer. We should only
|
| // update mNativeScrollX/Y here for consistency.
|
| - getContentViewClient().onScaleChanged(
|
| + mPageScaleChangeListener.onScaleChanged(
|
| mRenderCoordinates.getPageScaleFactor(), pageScaleFactor);
|
| }
|
|
|
| @@ -1984,17 +1984,6 @@ public class ContentViewCore implements MotionEventDelegate, NavigationClient {
|
| viewportWidth, viewportHeight,
|
| pageScaleFactor, minPageScaleFactor, maxPageScaleFactor);
|
|
|
| - if (contentSizeChanged) {
|
| - getContentViewClient().onContentSizeChanged(
|
| - mRenderCoordinates.getContentWidthCss(),
|
| - mRenderCoordinates.getContentHeightCss());
|
| - if (mContentSizeChangeListener != null) {
|
| - mContentSizeChangeListener.onContentSizeChanged(
|
| - mRenderCoordinates.getContentWidthPixInt(),
|
| - mRenderCoordinates.getContentHeightPixInt());
|
| - }
|
| - }
|
| -
|
| if (needTemporarilyHideHandles) temporarilyHideTextHandles();
|
| if (needUpdateZoomControls) mZoomManager.updateZoomControls();
|
|
|
|
|