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

Issue 2898593002: WebView: choose loud vs. quiet interstitial (Closed)

Created:
3 years, 7 months ago by Nate Fischer
Modified:
3 years, 7 months ago
CC:
agrieve+watch_chromium.org, android-webview-reviews_chromium.org, blundell+watchlist_chromium.org, chromium-reviews, darin-cc_chromium.org, droger+watchlist_chromium.org, edwardjung, grt+watch_chromium.org, jam, sdefresne+watchlist_chromium.org, timvolodine, vakh+watch_chromium.org
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

WebView: choose loud vs. quiet interstitial This CL lets WebView choose between a Loud vs. Quiet blocking page when blocking malicious content. This changes the constructor of BaseBlockingPage to accept an ErrorUiType parameter indicating the correct SafeBrowsingErrorUI to instantiate. It includes three states to cover interstitials that are loud, giant, or small (to handle small and giant slightly differently in native code). BaseSafeBrowsingErrorUI now has GetHTMLTemplateId(), which returns the proper resource ID for the blocking page's HTML template. This fixes a crash during the i18n stage when using the wrong HTML. GetErrorUiType() has been plumbed out to native, allowing WebView native code to differentiate between the three interstitial states. This adds the resources for the quiet interstitial, which corresponds to the following apk size increases: - SystemWebViewGoogle.apk's en-US.pak (6877 -> 7248) (+371) - SystemWebViewGoogle.apk's resources.pak (417015 -> 427494) (+10479) BUG=718545 Review-Url: https://codereview.chromium.org/2898593002 Cr-Commit-Position: refs/heads/master@{#474858} Committed: https://chromium.googlesource.com/chromium/src/+/96bd408ae32e5925624d5f4359687df707205de3

Patch Set 1 #

Patch Set 2 : Update WebView test for behavior change #

Total comments: 6

Patch Set 3 : Rebase and fix patch conflict #

Total comments: 4

Patch Set 4 : Move GetHTMLTemplateId() to SafeBrowsingErrorUI, instantiate sb_error_ui_ in constructor body, fix … #

Patch Set 5 : Fix wrong ErrorUiType for chrome (leftover from debugging) #

Patch Set 6 : Switch to JNI enums (java_cpp_enum), move error type logic to Java #

Patch Set 7 : Move enum back to protected scope, since it's allowed #

Patch Set 8 : Rename test #

Total comments: 6

Patch Set 9 : Fixing comments from Selim #

Patch Set 10 : Add set_sb_error_ui, move ErrorUiType enum to AW code #

Patch Set 11 : Rebase, fix merge conflicts #

Unified diffs Side-by-side diffs Delta from patch set Stats (+134 lines, -30 lines) Patch
M android_webview/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 2 chunks +7 lines, -0 lines 0 comments Download
M android_webview/browser/aw_contents.h View 1 2 3 4 5 1 chunk +2 lines, -1 line 0 comments Download
M android_webview/browser/aw_contents.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +10 lines, -2 lines 0 comments Download
M android_webview/browser/aw_safe_browsing_blocking_page.h View 1 2 3 4 5 6 7 8 9 2 chunks +7 lines, -1 line 0 comments Download
M android_webview/browser/aw_safe_browsing_blocking_page.cc View 1 2 3 4 5 6 7 8 9 4 chunks +19 lines, -3 lines 0 comments Download
M android_webview/browser/aw_safe_browsing_ui_manager.h View 1 2 3 4 5 2 chunks +8 lines, -2 lines 0 comments Download
M android_webview/browser/aw_safe_browsing_ui_manager.cc View 1 2 3 4 5 2 chunks +8 lines, -1 line 0 comments Download
M android_webview/java/src/org/chromium/android_webview/AwContents.java View 1 2 3 4 5 6 7 8 9 10 2 chunks +12 lines, -4 lines 0 comments Download
M android_webview/javatests/src/org/chromium/android_webview/test/SafeBrowsingTest.java View 1 2 3 4 5 6 7 8 9 10 1 chunk +12 lines, -8 lines 0 comments Download
M android_webview/ui/grit_resources_whitelist.txt View 1 chunk +1 line, -0 lines 0 comments Download
M android_webview/ui/grit_strings_whitelist.txt View 1 chunk +4 lines, -0 lines 0 comments Download
M components/safe_browsing/base_blocking_page.h View 1 2 3 4 5 6 7 8 9 3 chunks +7 lines, -3 lines 0 comments Download
M components/safe_browsing/base_blocking_page.cc View 1 2 3 4 5 6 7 8 9 3 chunks +12 lines, -4 lines 0 comments Download
M components/security_interstitials/DEPS View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M components/security_interstitials/content/security_interstitial_page.h View 1 chunk +2 lines, -0 lines 0 comments Download
M components/security_interstitials/content/security_interstitial_page.cc View 1 chunk +5 lines, -1 line 0 comments Download
M components/security_interstitials/core/BUILD.gn View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M components/security_interstitials/core/base_safe_browsing_error_ui.h View 1 2 3 1 chunk +2 lines, -0 lines 0 comments Download
M components/security_interstitials/core/safe_browsing_loud_error_ui.h View 1 2 3 1 chunk +2 lines, -0 lines 0 comments Download
M components/security_interstitials/core/safe_browsing_loud_error_ui.cc View 1 2 3 2 chunks +5 lines, -0 lines 0 comments Download
M components/security_interstitials/core/safe_browsing_quiet_error_ui.h View 1 2 3 1 chunk +2 lines, -0 lines 0 comments Download
M components/security_interstitials/core/safe_browsing_quiet_error_ui.cc View 1 2 3 2 chunks +5 lines, -0 lines 0 comments Download

Messages

Total messages: 70 (43 generated)
Nate Fischer
PTAL jialiul@: for components/safe_browsing and components/security_interstitials sgurun@: for android_webview FYI felt@ and edwardjung@ I will ...
3 years, 7 months ago (2017-05-20 04:55:54 UTC) #8
felt
Ideally the BaseBlockingPage shouldn't need to know the difference between LOUD/QUIET/GIANT. I think the reason ...
3 years, 7 months ago (2017-05-22 16:57:41 UTC) #11
felt
On 2017/05/22 16:57:41, felt wrote: > Ideally the BaseBlockingPage shouldn't need to know the difference ...
3 years, 7 months ago (2017-05-22 17:00:51 UTC) #12
Jialiu Lin
safe_browsing and security_interstitial LGTM % nits. https://codereview.chromium.org/2898593002/diff/20001/components/safe_browsing/base_blocking_page.cc File components/safe_browsing/base_blocking_page.cc (right): https://codereview.chromium.org/2898593002/diff/20001/components/safe_browsing/base_blocking_page.cc#newcode62 components/safe_browsing/base_blocking_page.cc:62: sb_error_ui_(error_type == ErrorUiType::LOUD ...
3 years, 7 months ago (2017-05-22 17:06:00 UTC) #13
sgurun-gerrit only
https://codereview.chromium.org/2898593002/diff/40001/android_webview/browser/aw_safe_browsing_blocking_page.cc File android_webview/browser/aw_safe_browsing_blocking_page.cc (right): https://codereview.chromium.org/2898593002/diff/40001/android_webview/browser/aw_safe_browsing_blocking_page.cc#newcode68 android_webview/browser/aw_safe_browsing_blocking_page.cc:68: ErrorUiType errorType; Have Java return the type rather than ...
3 years, 7 months ago (2017-05-22 21:05:30 UTC) #14
Nate Fischer
Jialiu, your comments should be addressed. Selim, I'll do the Java enum in the next ...
3 years, 7 months ago (2017-05-22 23:13:46 UTC) #15
Nate Fischer
Sorry, meant to click "dry run," not "commit"
3 years, 7 months ago (2017-05-22 23:49:52 UTC) #21
Nate Fischer
sgurun@, PTAL jochen@, can you approve for the change to //components/security_interstitials/DEPS?
3 years, 7 months ago (2017-05-23 01:37:39 UTC) #25
Jialiu Lin
Thanks ntfschr! Could you add felt@ to reviewer list too?
3 years, 7 months ago (2017-05-23 02:20:38 UTC) #28
Nate Fischer
On 2017/05/23 02:20:38, Jialiu Lin wrote: > Thanks ntfschr! Could you add felt@ to reviewer ...
3 years, 7 months ago (2017-05-23 03:27:18 UTC) #33
jochen (gone - plz use gerrit)
deps lgtm please wait for others to approve the change
3 years, 7 months ago (2017-05-23 11:12:06 UTC) #39
sgurun-gerrit only
lgtm after addressing these two comments. https://codereview.chromium.org/2898593002/diff/120001/android_webview/java/src/org/chromium/android_webview/AwContents.java File android_webview/java/src/org/chromium/android_webview/AwContents.java (right): https://codereview.chromium.org/2898593002/diff/120001/android_webview/java/src/org/chromium/android_webview/AwContents.java#newcode2974 android_webview/java/src/org/chromium/android_webview/AwContents.java:2974: if (!canShowInterstitial()) return ...
3 years, 7 months ago (2017-05-23 17:09:16 UTC) #40
felt
On 2017/05/23 17:09:16, sgurun wrote: > lgtm after addressing these two comments. > > https://codereview.chromium.org/2898593002/diff/120001/android_webview/java/src/org/chromium/android_webview/AwContents.java ...
3 years, 7 months ago (2017-05-23 17:10:11 UTC) #41
Nate Fischer
Thanks, all! Comments should be addressed, I'll wait for Felt's review. https://codereview.chromium.org/2898593002/diff/120001/android_webview/java/src/org/chromium/android_webview/AwContents.java File android_webview/java/src/org/chromium/android_webview/AwContents.java (right): ...
3 years, 7 months ago (2017-05-23 20:01:06 UTC) #44
sgurun-gerrit only
https://codereview.chromium.org/2898593002/diff/120001/android_webview/java/src/org/chromium/android_webview/AwContents.java File android_webview/java/src/org/chromium/android_webview/AwContents.java (right): https://codereview.chromium.org/2898593002/diff/120001/android_webview/java/src/org/chromium/android_webview/AwContents.java#newcode2974 android_webview/java/src/org/chromium/android_webview/AwContents.java:2974: if (!canShowInterstitial()) return false; On 2017/05/23 20:01:06, Nate Fischer ...
3 years, 7 months ago (2017-05-23 20:19:23 UTC) #45
Nate Fischer
https://codereview.chromium.org/2898593002/diff/120001/android_webview/java/src/org/chromium/android_webview/AwContents.java File android_webview/java/src/org/chromium/android_webview/AwContents.java (right): https://codereview.chromium.org/2898593002/diff/120001/android_webview/java/src/org/chromium/android_webview/AwContents.java#newcode2974 android_webview/java/src/org/chromium/android_webview/AwContents.java:2974: if (!canShowInterstitial()) return false; On 2017/05/23 20:19:23, sgurun wrote: ...
3 years, 7 months ago (2017-05-23 20:21:19 UTC) #46
Nate Fischer
felt@ friendly ping I'm in no rush to land, I just wanted to make sure ...
3 years, 7 months ago (2017-05-24 23:38:30 UTC) #49
felt
> > > Ideally the BaseBlockingPage shouldn't need to know the difference between > > ...
3 years, 7 months ago (2017-05-24 23:53:05 UTC) #50
sgurun-gerrit only
On 2017/05/24 23:53:05, felt wrote: > > > > Ideally the BaseBlockingPage shouldn't need to ...
3 years, 7 months ago (2017-05-25 00:32:50 UTC) #51
Nate Fischer
On 2017/05/25 00:32:50, sgurun wrote: > On 2017/05/24 23:53:05, felt wrote: > > > > ...
3 years, 7 months ago (2017-05-25 01:08:26 UTC) #52
felt
On 2017/05/25 01:08:26, Nate Fischer wrote: > On 2017/05/25 00:32:50, sgurun wrote: > > On ...
3 years, 7 months ago (2017-05-25 13:15:12 UTC) #53
Nate Fischer
On 2017/05/25 13:15:12, felt wrote: > On 2017/05/25 01:08:26, Nate Fischer wrote: > > On ...
3 years, 7 months ago (2017-05-25 19:37:31 UTC) #54
felt
On 2017/05/25 19:37:31, Nate Fischer wrote: > On 2017/05/25 13:15:12, felt wrote: > > On ...
3 years, 7 months ago (2017-05-25 19:48:20 UTC) #59
Jialiu Lin
BaseBlockingPage looks much better. Thanks! LGTM
3 years, 7 months ago (2017-05-25 20:21:10 UTC) #60
Nate Fischer
On 2017/05/25 20:21:10, Jialiu Lin wrote: > BaseBlockingPage looks much better. Thanks! > LGTM Thanks, ...
3 years, 7 months ago (2017-05-25 20:50:35 UTC) #63
commit-bot: I haz the power
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2898593002/180001
3 years, 7 months ago (2017-05-25 22:48:53 UTC) #67
commit-bot: I haz the power
3 years, 7 months ago (2017-05-26 01:01:53 UTC) #70
Message was sent while issue was closed.
Committed patchset #11 (id:180001) as
https://chromium.googlesource.com/chromium/src/+/96bd408ae32e5925624d5f435968...

Powered by Google App Engine
This is Rietveld 408576698