| OLD | NEW |
| 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.annotation.SuppressLint; | 7 import android.annotation.SuppressLint; |
| 8 import android.annotation.TargetApi; | 8 import android.annotation.TargetApi; |
| 9 import android.app.Activity; | 9 import android.app.Activity; |
| 10 import android.content.ComponentCallbacks2; | 10 import android.content.ComponentCallbacks2; |
| (...skipping 2835 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2846 final int scrollRangeY = mScrollOffsetManager.computeMaximumVerticalScro
llOffset(); | 2846 final int scrollRangeY = mScrollOffsetManager.computeMaximumVerticalScro
llOffset(); |
| 2847 // absorbGlow() will release the glow if it is not finished. | 2847 // absorbGlow() will release the glow if it is not finished. |
| 2848 mOverScrollGlow.absorbGlow(x, y, oldX, oldY, scrollRangeX, scrollRangeY, | 2848 mOverScrollGlow.absorbGlow(x, y, oldX, oldY, scrollRangeX, scrollRangeY, |
| 2849 (float) Math.hypot(velocityX, velocityY)); | 2849 (float) Math.hypot(velocityX, velocityY)); |
| 2850 | 2850 |
| 2851 if (mOverScrollGlow.isAnimating()) { | 2851 if (mOverScrollGlow.isAnimating()) { |
| 2852 postInvalidateOnAnimation(); | 2852 postInvalidateOnAnimation(); |
| 2853 } | 2853 } |
| 2854 } | 2854 } |
| 2855 | 2855 |
| 2856 @CalledByNative |
| 2857 private boolean canShowInterstitial() { |
| 2858 int loc[] = new int[2]; |
| 2859 mContainerView.getLocationOnScreen(loc); |
| 2860 // TODO(sgurun) implement a better strategy here. |
| 2861 if (mContainerView.getWidth() < 500 || mContainerView.getHeight() < 500)
{ |
| 2862 return false; |
| 2863 } |
| 2864 if (mContainerView.getVisibility() != View.VISIBLE) { |
| 2865 return false; |
| 2866 } |
| 2867 // TODO(timvolodine) other potential improvements mentioned: |
| 2868 // consider content, not attached webviews, giant webviews, .. |
| 2869 return true; |
| 2870 } |
| 2871 |
| 2856 // -------------------------------------------------------------------------
------------------ | 2872 // -------------------------------------------------------------------------
------------------ |
| 2857 // Helper methods | 2873 // Helper methods |
| 2858 // -------------------------------------------------------------------------
------------------ | 2874 // -------------------------------------------------------------------------
------------------ |
| 2859 | 2875 |
| 2860 private void setPageScaleFactorAndLimits( | 2876 private void setPageScaleFactorAndLimits( |
| 2861 float pageScaleFactor, float minPageScaleFactor, float maxPageScaleF
actor) { | 2877 float pageScaleFactor, float minPageScaleFactor, float maxPageScaleF
actor) { |
| 2862 if (mPageScaleFactor == pageScaleFactor | 2878 if (mPageScaleFactor == pageScaleFactor |
| 2863 && mMinPageScaleFactor == minPageScaleFactor | 2879 && mMinPageScaleFactor == minPageScaleFactor |
| 2864 && mMaxPageScaleFactor == maxPageScaleFactor) { | 2880 && mMaxPageScaleFactor == maxPageScaleFactor) { |
| 2865 return; | 2881 return; |
| (...skipping 510 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3376 | 3392 |
| 3377 private native void nativePostMessageToFrame(long nativeAwContents, String f
rameId, | 3393 private native void nativePostMessageToFrame(long nativeAwContents, String f
rameId, |
| 3378 String message, String targetOrigin, int[] msgPorts); | 3394 String message, String targetOrigin, int[] msgPorts); |
| 3379 | 3395 |
| 3380 private native void nativeCreateMessageChannel( | 3396 private native void nativeCreateMessageChannel( |
| 3381 long nativeAwContents, AppWebMessagePort[] ports); | 3397 long nativeAwContents, AppWebMessagePort[] ports); |
| 3382 | 3398 |
| 3383 private native void nativeGrantFileSchemeAccesstoChildProcess(long nativeAwC
ontents); | 3399 private native void nativeGrantFileSchemeAccesstoChildProcess(long nativeAwC
ontents); |
| 3384 private native void nativeResumeLoadingCreatedPopupWebContents(long nativeAw
Contents); | 3400 private native void nativeResumeLoadingCreatedPopupWebContents(long nativeAw
Contents); |
| 3385 } | 3401 } |
| OLD | NEW |