|
|
Created:
3 years, 8 months ago by Nate Fischer Modified:
3 years, 8 months ago Reviewers:
sgurun-gerrit only CC:
agrieve+watch_chromium.org, android-webview-reviews_chromium.org, chromium-reviews Target Ref:
refs/heads/master Project:
chromium Visibility:
Public. |
DescriptionWebView: carefully check size for SafeBrowsing interstitial
In the case of a SafeBrowsing hit, we want 3 options for which warning
the user sees:
1. No interstitial - the WebView is invisible or unattached. Instead of
an interstitial, we immediately return a network error.
2. Big interstitial - if the WebView is large enough that it's probably
used for user navigation, then we should display the same
interstitial Chrome uses (a scary warning page to catch the user's
attention).
3. Small/Medium/Giant interstitial - if the WebView is small, it may be used
as a piece of a larger composed app page. In this case, we eventually
want to show a less-scary interstitial, since the page is typically
not the result of user navigation. We intend to treat giant webviews
the same way as either small or medium interstitials.
We don't yet have a small interstitial, so we handle cases 1 & 3 the
same for now (create a network error). Once the new interstitial is
implemented, we'll handle cases 1 & 3 separately.
BUG=702072
Review-Url: https://codereview.chromium.org/2833923002
Cr-Commit-Position: refs/heads/master@{#467119}
Committed: https://chromium.googlesource.com/chromium/src/+/22119b62178b195b177b6e5629624d80f52efcd1
Patch Set 1 #Patch Set 2 : Update docs and comments #Patch Set 3 : Change to 70%, treat giant views like small views, and add tests #Patch Set 4 : Fix logic error and update comments #
Total comments: 6
Patch Set 5 : Inline display width and height #Patch Set 6 : Remove CanShowInterstitial from native #
Total comments: 4
Patch Set 7 : Also check if attached, add @VisibleForTesting #
Messages
Total messages: 39 (29 generated)
The CQ bit was checked by ntfschr@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: win_chromium_rel_ng on master.tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_rel_...)
The CQ bit was checked by ntfschr@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
Description was changed from ========== WebView: carefully check size for SafeBrowsing interstitial In the case of a SafeBrowsing hit, we want 3 options for which warning the user sees: 1. No interstitial - the WebView is not visible, or it is larger than the screen, or parts of it extend off the device screen. Instead of an interstitial, we immediately return a network error. 2. Big interstitial - if the WebView is large enough that it's probably used for user navigation, then we should display the same interstitial Chrome uses (a scary warning page to catch the user's attention). 3. Small interstitial - if the WebView is small, it may be used as a piece of a larger composed app page. In this case, we eventually want to show a less-scary interstitial, since the page is typically not the result of user navigation. We don't yet have a small interstitial, so we handle cases 1 & 3 the same for now (create a network error). Once the new interstitial is implemented, we'll handle cases 1 & 3 separately. BUG=702072 ========== to ========== WebView: carefully check size for SafeBrowsing interstitial In the case of a SafeBrowsing hit, we want 3 options for which warning the user sees: 1. No interstitial - the WebView is not visible. Instead of an interstitial, we immediately return a network error. 2. Big interstitial - if the WebView is large enough that it's probably used for user navigation, then we should display the same interstitial Chrome uses (a scary warning page to catch the user's attention). 3. Small/Giant interstitial - if the WebView is small, it may be used as a piece of a larger composed app page. In this case, we eventually want to show a less-scary interstitial, since the page is typically not the result of user navigation. We don't yet have a small interstitial, so we handle cases 1 & 3 the same for now (create a network error). Once the new interstitial is implemented, we'll handle cases 1 & 3 separately. BUG=702072 ==========
The CQ bit was checked by ntfschr@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
The CQ bit was checked by ntfschr@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Description was changed from ========== WebView: carefully check size for SafeBrowsing interstitial In the case of a SafeBrowsing hit, we want 3 options for which warning the user sees: 1. No interstitial - the WebView is not visible. Instead of an interstitial, we immediately return a network error. 2. Big interstitial - if the WebView is large enough that it's probably used for user navigation, then we should display the same interstitial Chrome uses (a scary warning page to catch the user's attention). 3. Small/Giant interstitial - if the WebView is small, it may be used as a piece of a larger composed app page. In this case, we eventually want to show a less-scary interstitial, since the page is typically not the result of user navigation. We don't yet have a small interstitial, so we handle cases 1 & 3 the same for now (create a network error). Once the new interstitial is implemented, we'll handle cases 1 & 3 separately. BUG=702072 ========== to ========== WebView: carefully check size for SafeBrowsing interstitial In the case of a SafeBrowsing hit, we want 3 options for which warning the user sees: 1. No interstitial - the WebView is not visible. Instead of an interstitial, we immediately return a network error. 2. Big interstitial - if the WebView is large enough that it's probably used for user navigation, then we should display the same interstitial Chrome uses (a scary warning page to catch the user's attention). 3. Small/Giant interstitial - if the WebView is small, it may be used as a piece of a larger composed app page. In this case, we eventually want to show a less-scary interstitial, since the page is typically not the result of user navigation. We don't yet have a small interstitial, so we handle cases 1 & 3 the same for now (create a network error). Once the new interstitial is implemented, we'll handle cases 1 & 3 separately. This leaves CanShowInterstitial() exposed to native, since we'll eventually use it to distinguish between 1 & 3. BUG=702072 ==========
ntfschr@chromium.org changed reviewers: + sgurun@chromium.org
PTAL
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
https://codereview.chromium.org/2833923002/diff/60001/android_webview/java/sr... File android_webview/java/src/org/chromium/android_webview/AwContents.java (right): https://codereview.chromium.org/2833923002/diff/60001/android_webview/java/sr... android_webview/java/src/org/chromium/android_webview/AwContents.java:2928: int displayHeight = displayAndroid.getDisplayHeight(); nit: inline https://codereview.chromium.org/2833923002/diff/60001/android_webview/java/sr... android_webview/java/src/org/chromium/android_webview/AwContents.java:2929: int displayWidth = displayAndroid.getDisplayWidth(); nit:inline https://codereview.chromium.org/2833923002/diff/60001/android_webview/native/... File android_webview/native/aw_contents.cc (right): https://codereview.chromium.org/2833923002/diff/60001/android_webview/native/... android_webview/native/aw_contents.cc:1410: bool AwContents::CanShowInterstitial() { nobody seems to call this, what is your plan on this?
https://codereview.chromium.org/2833923002/diff/60001/android_webview/java/sr... File android_webview/java/src/org/chromium/android_webview/AwContents.java (right): https://codereview.chromium.org/2833923002/diff/60001/android_webview/java/sr... android_webview/java/src/org/chromium/android_webview/AwContents.java:2928: int displayHeight = displayAndroid.getDisplayHeight(); On 2017/04/24 at 22:44:10, sgurun wrote: > nit: inline done https://codereview.chromium.org/2833923002/diff/60001/android_webview/java/sr... android_webview/java/src/org/chromium/android_webview/AwContents.java:2929: int displayWidth = displayAndroid.getDisplayWidth(); On 2017/04/24 at 22:44:10, sgurun wrote: > nit:inline done https://codereview.chromium.org/2833923002/diff/60001/android_webview/native/... File android_webview/native/aw_contents.cc (right): https://codereview.chromium.org/2833923002/diff/60001/android_webview/native/... android_webview/native/aw_contents.cc:1410: bool AwContents::CanShowInterstitial() { On 2017/04/24 at 22:44:10, sgurun wrote: > nobody seems to call this, what is your plan on this? Once we support a second interstitial, we should use this to distinguish between when to use the big interstitial vs. small interstitial: if (CanShowBigInterstitial()) { // Use the big interstitial } else if (CanShowInterstitial()) { // Use the small interstitial } else { // Straight to network error } As you pointed out, we can remove this code now, but it sounds like we would be adding it back once we support this. Your call if we should remove it for now.
Description was changed from ========== WebView: carefully check size for SafeBrowsing interstitial In the case of a SafeBrowsing hit, we want 3 options for which warning the user sees: 1. No interstitial - the WebView is not visible. Instead of an interstitial, we immediately return a network error. 2. Big interstitial - if the WebView is large enough that it's probably used for user navigation, then we should display the same interstitial Chrome uses (a scary warning page to catch the user's attention). 3. Small/Giant interstitial - if the WebView is small, it may be used as a piece of a larger composed app page. In this case, we eventually want to show a less-scary interstitial, since the page is typically not the result of user navigation. We don't yet have a small interstitial, so we handle cases 1 & 3 the same for now (create a network error). Once the new interstitial is implemented, we'll handle cases 1 & 3 separately. This leaves CanShowInterstitial() exposed to native, since we'll eventually use it to distinguish between 1 & 3. BUG=702072 ========== to ========== WebView: carefully check size for SafeBrowsing interstitial In the case of a SafeBrowsing hit, we want 3 options for which warning the user sees: 1. No interstitial - the WebView is not visible. Instead of an interstitial, we immediately return a network error. 2. Big interstitial - if the WebView is large enough that it's probably used for user navigation, then we should display the same interstitial Chrome uses (a scary warning page to catch the user's attention). 3. Small/Medium/Giant interstitial - if the WebView is small, it may be used as a piece of a larger composed app page. In this case, we eventually want to show a less-scary interstitial, since the page is typically not the result of user navigation. We intend to treat giant webviews the same way as either small or medium interstitials. We don't yet have a small interstitial, so we handle cases 1 & 3 the same for now (create a network error). Once the new interstitial is implemented, we'll handle cases 1 & 3 separately. This leaves CanShowInterstitial() exposed to native, since we'll eventually use it to distinguish between 1 & 3. BUG=702072 ==========
As discussed offline, I removed the native parts of CanShowInterstitial, we'll add it back if we need it. No logic change in the Java code.
Description was changed from ========== WebView: carefully check size for SafeBrowsing interstitial In the case of a SafeBrowsing hit, we want 3 options for which warning the user sees: 1. No interstitial - the WebView is not visible. Instead of an interstitial, we immediately return a network error. 2. Big interstitial - if the WebView is large enough that it's probably used for user navigation, then we should display the same interstitial Chrome uses (a scary warning page to catch the user's attention). 3. Small/Medium/Giant interstitial - if the WebView is small, it may be used as a piece of a larger composed app page. In this case, we eventually want to show a less-scary interstitial, since the page is typically not the result of user navigation. We intend to treat giant webviews the same way as either small or medium interstitials. We don't yet have a small interstitial, so we handle cases 1 & 3 the same for now (create a network error). Once the new interstitial is implemented, we'll handle cases 1 & 3 separately. This leaves CanShowInterstitial() exposed to native, since we'll eventually use it to distinguish between 1 & 3. BUG=702072 ========== to ========== WebView: carefully check size for SafeBrowsing interstitial In the case of a SafeBrowsing hit, we want 3 options for which warning the user sees: 1. No interstitial - the WebView is not visible. Instead of an interstitial, we immediately return a network error. 2. Big interstitial - if the WebView is large enough that it's probably used for user navigation, then we should display the same interstitial Chrome uses (a scary warning page to catch the user's attention). 3. Small/Medium/Giant interstitial - if the WebView is small, it may be used as a piece of a larger composed app page. In this case, we eventually want to show a less-scary interstitial, since the page is typically not the result of user navigation. We intend to treat giant webviews the same way as either small or medium interstitials. We don't yet have a small interstitial, so we handle cases 1 & 3 the same for now (create a network error). Once the new interstitial is implemented, we'll handle cases 1 & 3 separately. BUG=702072 ==========
https://codereview.chromium.org/2833923002/diff/100001/android_webview/java/s... File android_webview/java/src/org/chromium/android_webview/AwContents.java (right): https://codereview.chromium.org/2833923002/diff/100001/android_webview/java/s... android_webview/java/src/org/chromium/android_webview/AwContents.java:2941: return mContainerView.getVisibility() == View.VISIBLE; We have a local variable mIsViewVisible. Can you check if there is a difference between using mIsViewVisible vs. using mContainerView.getVisibility in this case. https://codereview.chromium.org/2833923002/diff/100001/android_webview/java/s... android_webview/java/src/org/chromium/android_webview/AwContents.java:2952: protected boolean canShowBigInterstitial() { nit: use @visiblefortesting here and above
The CQ bit was checked by ntfschr@chromium.org to run a CQ dry run
https://codereview.chromium.org/2833923002/diff/100001/android_webview/java/s... File android_webview/java/src/org/chromium/android_webview/AwContents.java (right): https://codereview.chromium.org/2833923002/diff/100001/android_webview/java/s... android_webview/java/src/org/chromium/android_webview/AwContents.java:2941: return mContainerView.getVisibility() == View.VISIBLE; On 2017/04/25 at 00:04:38, sgurun wrote: > We have a local variable mIsViewVisible. Can you check if there is a difference between using mIsViewVisible vs. using mContainerView.getVisibility in this case. I see no difference. Switched to mIsViewVisible. Also, this doesn't check if it's actually attached, so I'm also using mIsAttachedToWindow. https://codereview.chromium.org/2833923002/diff/100001/android_webview/java/s... android_webview/java/src/org/chromium/android_webview/AwContents.java:2952: protected boolean canShowBigInterstitial() { On 2017/04/25 at 00:04:38, sgurun wrote: > nit: use @visiblefortesting > here and above done
Dry run: CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
lgtm
Description was changed from ========== WebView: carefully check size for SafeBrowsing interstitial In the case of a SafeBrowsing hit, we want 3 options for which warning the user sees: 1. No interstitial - the WebView is not visible. Instead of an interstitial, we immediately return a network error. 2. Big interstitial - if the WebView is large enough that it's probably used for user navigation, then we should display the same interstitial Chrome uses (a scary warning page to catch the user's attention). 3. Small/Medium/Giant interstitial - if the WebView is small, it may be used as a piece of a larger composed app page. In this case, we eventually want to show a less-scary interstitial, since the page is typically not the result of user navigation. We intend to treat giant webviews the same way as either small or medium interstitials. We don't yet have a small interstitial, so we handle cases 1 & 3 the same for now (create a network error). Once the new interstitial is implemented, we'll handle cases 1 & 3 separately. BUG=702072 ========== to ========== WebView: carefully check size for SafeBrowsing interstitial In the case of a SafeBrowsing hit, we want 3 options for which warning the user sees: 1. No interstitial - the WebView is invisible or unattached. Instead of an interstitial, we immediately return a network error. 2. Big interstitial - if the WebView is large enough that it's probably used for user navigation, then we should display the same interstitial Chrome uses (a scary warning page to catch the user's attention). 3. Small/Medium/Giant interstitial - if the WebView is small, it may be used as a piece of a larger composed app page. In this case, we eventually want to show a less-scary interstitial, since the page is typically not the result of user navigation. We intend to treat giant webviews the same way as either small or medium interstitials. We don't yet have a small interstitial, so we handle cases 1 & 3 the same for now (create a network error). Once the new interstitial is implemented, we'll handle cases 1 & 3 separately. BUG=702072 ==========
Thanks!
The CQ bit was checked by ntfschr@chromium.org
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
CQ is committing da patch. Bot data: {"patchset_id": 120001, "attempt_start_ts": 1493155339911360, "parent_rev": "ac414937946e8e50537698495b6eb8887875c453", "commit_rev": "22119b62178b195b177b6e5629624d80f52efcd1"}
Message was sent while issue was closed.
Description was changed from ========== WebView: carefully check size for SafeBrowsing interstitial In the case of a SafeBrowsing hit, we want 3 options for which warning the user sees: 1. No interstitial - the WebView is invisible or unattached. Instead of an interstitial, we immediately return a network error. 2. Big interstitial - if the WebView is large enough that it's probably used for user navigation, then we should display the same interstitial Chrome uses (a scary warning page to catch the user's attention). 3. Small/Medium/Giant interstitial - if the WebView is small, it may be used as a piece of a larger composed app page. In this case, we eventually want to show a less-scary interstitial, since the page is typically not the result of user navigation. We intend to treat giant webviews the same way as either small or medium interstitials. We don't yet have a small interstitial, so we handle cases 1 & 3 the same for now (create a network error). Once the new interstitial is implemented, we'll handle cases 1 & 3 separately. BUG=702072 ========== to ========== WebView: carefully check size for SafeBrowsing interstitial In the case of a SafeBrowsing hit, we want 3 options for which warning the user sees: 1. No interstitial - the WebView is invisible or unattached. Instead of an interstitial, we immediately return a network error. 2. Big interstitial - if the WebView is large enough that it's probably used for user navigation, then we should display the same interstitial Chrome uses (a scary warning page to catch the user's attention). 3. Small/Medium/Giant interstitial - if the WebView is small, it may be used as a piece of a larger composed app page. In this case, we eventually want to show a less-scary interstitial, since the page is typically not the result of user navigation. We intend to treat giant webviews the same way as either small or medium interstitials. We don't yet have a small interstitial, so we handle cases 1 & 3 the same for now (create a network error). Once the new interstitial is implemented, we'll handle cases 1 & 3 separately. BUG=702072 Review-Url: https://codereview.chromium.org/2833923002 Cr-Commit-Position: refs/heads/master@{#467119} Committed: https://chromium.googlesource.com/chromium/src/+/22119b62178b195b177b6e562962... ==========
Message was sent while issue was closed.
Committed patchset #7 (id:120001) as https://chromium.googlesource.com/chromium/src/+/22119b62178b195b177b6e562962... |