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

Issue 2854263003: Add quiet safe browsing interstitial for WebView (Closed)

Created:
3 years, 7 months ago by edwardjung
Modified:
3 years, 7 months ago
CC:
chromium-reviews
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Add quiet safe browsing interstitial for WebView BUG=716095 Review-Url: https://codereview.chromium.org/2854263003 Cr-Commit-Position: refs/heads/master@{#473150} Committed: https://chromium.googlesource.com/chromium/src/+/f9dfdb6d9dcd8c5f987fd7114bff3ebee6b8785f

Patch Set 1 #

Patch Set 2 : Common CSS changes #

Total comments: 13

Patch Set 3 : Update CSS #

Patch Set 4 : Add giant state #

Patch Set 5 : Updates to the HTML / CSS #

Total comments: 27

Patch Set 6 : Address dbeam comments #

Total comments: 8

Patch Set 7 : Add missing strings required for template #

Patch Set 8 : Add per-file line for grdp file in OWNERS #

Patch Set 9 : Add webview_quiet.js #

Patch Set 10 : Make the SafeBrowsingQuietErrorUI inherit BaseSafeBrowsingErrorUI #

Patch Set 11 : Fix tests #

Total comments: 8

Patch Set 12 : Add unit tests #

Patch Set 13 : Merge conflicts #

Total comments: 4

Patch Set 14 : Remove old safe_browsing_prefs.h include from test #

Total comments: 14

Patch Set 15 : Address felt comments #

Patch Set 16 : Correct i18nRaw #

Patch Set 17 : Fix nit #

Patch Set 18 : Fix unit test #

Unified diffs Side-by-side diffs Delta from patch set Stats (+678 lines, -88 lines) Patch
M chrome/browser/safe_browsing/safe_browsing_blocking_page.h View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/browser/safe_browsing/safe_browsing_blocking_page_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 4 chunks +238 lines, -0 lines 0 comments Download
M chrome/browser/safe_browsing/safe_browsing_service.h View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +1 line, -0 lines 0 comments Download
M components/OWNERS View 1 2 3 4 5 6 7 1 chunk +1 line, -0 lines 0 comments Download
M components/neterror/resources/neterror.html View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M components/resources/security_interstitials_resources.grdp View 1 1 chunk +1 line, -0 lines 0 comments Download
M components/safe_browsing/base_blocking_page.cc View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +1 line, -1 line 0 comments Download
M components/security_interstitials/core/BUILD.gn View 1 2 3 4 5 6 7 8 9 1 chunk +2 lines, -0 lines 0 comments Download
M components/security_interstitials/core/base_safe_browsing_error_ui.h View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -1 line 0 comments Download
M components/security_interstitials/core/browser/resources/extended_reporting.js View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +2 lines, -2 lines 0 comments Download
A components/security_interstitials/core/browser/resources/images/blocked.svg View 1 2 3 1 chunk +11 lines, -0 lines 0 comments Download
A components/security_interstitials/core/browser/resources/interstitial_common.css View 1 2 3 4 5 1 chunk +35 lines, -0 lines 0 comments Download
A components/security_interstitials/core/browser/resources/interstitial_common.js View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +46 lines, -0 lines 0 comments Download
M components/security_interstitials/core/browser/resources/interstitial_v2.css View 1 2 3 4 3 chunks +0 lines, -29 lines 0 comments Download
M components/security_interstitials/core/browser/resources/interstitial_v2.html View 1 2 3 4 5 3 chunks +6 lines, -5 lines 0 comments Download
M components/security_interstitials/core/browser/resources/interstitial_v2.js View 1 2 3 4 5 6 7 8 9 10 11 7 chunks +11 lines, -48 lines 0 comments Download
A components/security_interstitials/core/browser/resources/interstitial_webview_quiet.css View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +112 lines, -0 lines 0 comments Download
A components/security_interstitials/core/browser/resources/interstitial_webview_quiet.html View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +31 lines, -0 lines 0 comments Download
A components/security_interstitials/core/browser/resources/interstitial_webview_quiet.js View 1 2 3 4 5 6 7 8 1 chunk +10 lines, -0 lines 0 comments Download
M components/security_interstitials/core/safe_browsing_loud_error_ui.h View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -1 line 0 comments Download
M components/security_interstitials/core/safe_browsing_loud_error_ui.cc View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -1 line 0 comments Download
A components/security_interstitials/core/safe_browsing_quiet_error_ui.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +55 lines, -0 lines 0 comments Download
A components/security_interstitials/core/safe_browsing_quiet_error_ui.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 chunk +95 lines, -0 lines 0 comments Download
M components/security_interstitials_strings.grdp View 6 7 8 9 10 11 12 13 14 1 chunk +14 lines, -0 lines 0 comments Download

Messages

Total messages: 76 (46 generated)
edwardjung
Here's an initial implementation of the quiet interstitial for your input. I have the details ...
3 years, 7 months ago (2017-05-03 02:26:20 UTC) #2
felt
Yeah, it would make sense to pull out the details section I think. Do that ...
3 years, 7 months ago (2017-05-05 04:17:33 UTC) #3
felt
https://codereview.chromium.org/2854263003/diff/20001/components/security_interstitials/core/browser/resources/interstitial_common.css File components/security_interstitials/core/browser/resources/interstitial_common.css (right): https://codereview.chromium.org/2854263003/diff/20001/components/security_interstitials/core/browser/resources/interstitial_common.css#newcode11 components/security_interstitials/core/browser/resources/interstitial_common.css:11: color: #646464; I think the preferred Chrome style is ...
3 years, 7 months ago (2017-05-05 04:35:01 UTC) #4
edwardjung
> Yeah, it would make sense to pull out the details section I think. Do ...
3 years, 7 months ago (2017-05-05 12:32:28 UTC) #5
edwardjung
PTAL made additional changes. The SafeBrowsingQuietErrorUI, now requires specifying whether it's a giant size webview. ...
3 years, 7 months ago (2017-05-08 16:27:33 UTC) #8
edwardjung
@dbeam could you take a look at the web UI parts of this CL on ...
3 years, 7 months ago (2017-05-08 16:29:24 UTC) #10
Dan Beam
https://codereview.chromium.org/2854263003/diff/80001/components/security_interstitials/core/browser/resources/interstitial_common.css File components/security_interstitials/core/browser/resources/interstitial_common.css (right): https://codereview.chromium.org/2854263003/diff/80001/components/security_interstitials/core/browser/resources/interstitial_common.css#newcode3 components/security_interstitials/core/browser/resources/interstitial_common.css:3: found in the LICENSE file. */ nit: /* Copyright ...
3 years, 7 months ago (2017-05-08 17:58:04 UTC) #13
edwardjung
Thanks Dan, PTAL. @jochen could you have a look at: components/security_interstitials_strings.grdp https://codereview.chromium.org/2854263003/diff/80001/components/security_interstitials/core/browser/resources/interstitial_common.css File components/security_interstitials/core/browser/resources/interstitial_common.css (right): ...
3 years, 7 months ago (2017-05-08 23:21:12 UTC) #15
jochen (gone - plz use gerrit)
can you add a per-file owners rule to the grdp file with /components/security_interstitials/OWNERS as owners?
3 years, 7 months ago (2017-05-09 16:22:25 UTC) #16
edwardjung
On 2017/05/09 16:22:25, jochen wrote: > can you add a per-file owners rule to the ...
3 years, 7 months ago (2017-05-09 17:28:04 UTC) #17
edwardjung
3 years, 7 months ago (2017-05-09 17:28:17 UTC) #19
edwardjung
> can you add a per-file owners rule to the grdp file with /components/security_interstitials/OWNERS as ...
3 years, 7 months ago (2017-05-09 19:29:57 UTC) #21
jochen (gone - plz use gerrit)
lgtm
3 years, 7 months ago (2017-05-09 19:38:12 UTC) #22
edwardjung
dbeam@ friendly ping!
3 years, 7 months ago (2017-05-10 20:13:10 UTC) #23
edwardjung
@felt, and dbeam, Please take another look, I've made some changes to: + Fix browser ...
3 years, 7 months ago (2017-05-15 16:16:12 UTC) #28
Dan Beam
sorry, forgot to publish https://codereview.chromium.org/2854263003/diff/80001/components/security_interstitials/core/browser/resources/interstitial_webview_quiet.html File components/security_interstitials/core/browser/resources/interstitial_webview_quiet.html (right): https://codereview.chromium.org/2854263003/diff/80001/components/security_interstitials/core/browser/resources/interstitial_webview_quiet.html#newcode24 components/security_interstitials/core/browser/resources/interstitial_webview_quiet.html:24: <p i18n-values=".innerHTML:explanationParagraph"></p> On 2017/05/08 23:21:11, ...
3 years, 7 months ago (2017-05-16 03:37:30 UTC) #29
edwardjung
Thanks Dan. @felt, @jialiul I've added basic unit tests for the new interstitial. Let me ...
3 years, 7 months ago (2017-05-16 13:59:11 UTC) #31
Jialiu Lin
Thanks for adding these tests edwardjung! c/b/safe_browsing LGTM with a couple of nits. BTW, you ...
3 years, 7 months ago (2017-05-16 17:25:42 UTC) #40
edwardjung
Thanks Jailiu! https://codereview.chromium.org/2854263003/diff/240001/chrome/browser/safe_browsing/safe_browsing_blocking_page_unittest.cc File chrome/browser/safe_browsing/safe_browsing_blocking_page_unittest.cc (right): https://codereview.chromium.org/2854263003/diff/240001/chrome/browser/safe_browsing/safe_browsing_blocking_page_unittest.cc#newcode991 chrome/browser/safe_browsing/safe_browsing_blocking_page_unittest.cc:991: ASSERT_EQ(str, l10n_util::GetStringUTF16(IDS_MALWARE_WEBVIEW_HEADING)); On 2017/05/16 17:25:42, Jialiu Lin ...
3 years, 7 months ago (2017-05-16 21:05:05 UTC) #43
felt
FYI I'll look at this first thing in the morning, I know you're eager to ...
3 years, 7 months ago (2017-05-17 05:14:18 UTC) #46
felt
looks good just a few small comments https://codereview.chromium.org/2854263003/diff/260001/chrome/browser/safe_browsing/safe_browsing_blocking_page_unittest.cc File chrome/browser/safe_browsing/safe_browsing_blocking_page_unittest.cc (right): https://codereview.chromium.org/2854263003/diff/260001/chrome/browser/safe_browsing/safe_browsing_blocking_page_unittest.cc#newcode150 chrome/browser/safe_browsing/safe_browsing_blocking_page_unittest.cc:150: meaning TODO ...
3 years, 7 months ago (2017-05-17 16:33:26 UTC) #47
edwardjung
Thanks, I'll look to improve the tests using the visibility method you sent across down ...
3 years, 7 months ago (2017-05-17 22:49:33 UTC) #50
felt
lgtm % one comment https://codereview.chromium.org/2854263003/diff/260001/components/security_interstitials/core/safe_browsing_quiet_error_ui.cc File components/security_interstitials/core/safe_browsing_quiet_error_ui.cc (right): https://codereview.chromium.org/2854263003/diff/260001/components/security_interstitials/core/safe_browsing_quiet_error_ui.cc#newcode80 components/security_interstitials/core/safe_browsing_quiet_error_ui.cc:80: load_time_data->SetString("explanationParagraph", On 2017/05/17 22:49:32, edwardjung ...
3 years, 7 months ago (2017-05-18 16:44:51 UTC) #53
edwardjung
Done, thanks. https://codereview.chromium.org/2854263003/diff/260001/components/security_interstitials/core/safe_browsing_quiet_error_ui.cc File components/security_interstitials/core/safe_browsing_quiet_error_ui.cc (right): https://codereview.chromium.org/2854263003/diff/260001/components/security_interstitials/core/safe_browsing_quiet_error_ui.cc#newcode80 components/security_interstitials/core/safe_browsing_quiet_error_ui.cc:80: load_time_data->SetString("explanationParagraph", On 2017/05/18 16:44:50, felt wrote: > ...
3 years, 7 months ago (2017-05-19 08:14:58 UTC) #64
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/2854263003/340001
3 years, 7 months ago (2017-05-19 10:37:42 UTC) #69
commit-bot: I haz the power
Committed patchset #18 (id:340001) as https://chromium.googlesource.com/chromium/src/+/f9dfdb6d9dcd8c5f987fd7114bff3ebee6b8785f
3 years, 7 months ago (2017-05-19 10:43:51 UTC) #72
Dan Beam
sooo jochen@ owns a lot of things. did you actually need a review from me? ...
3 years, 7 months ago (2017-05-19 19:14:23 UTC) #73
Dan Beam
btw, have you tried your code on iOS? I remembered recently than $i18n{} may not ...
3 years, 7 months ago (2017-05-19 19:15:44 UTC) #74
edwardjung
On 2017/05/19 19:15:44, Dan Beam wrote: > btw, have you tried your code on iOS? ...
3 years, 7 months ago (2017-05-19 19:20:21 UTC) #75
edwardjung
3 years, 7 months ago (2017-05-19 19:38:18 UTC) #76
Message was sent while issue was closed.
You're weren't needed for owner approval but we did need your review! Felt is a
owner of the safebrowsing resources but wanted someone with more experience of
reviewing HTML / JS / CSS to check the code. Apologies that I didn't wait for
your LGTM.

https://codereview.chromium.org/2854263003/diff/200001/components/resources/s...
File components/resources/security_interstitials_resources.grdp (right):

https://codereview.chromium.org/2854263003/diff/200001/components/resources/s...
components/resources/security_interstitials_resources.grdp:5: <include
name="IDR_SECURITY_INTERSTITIAL_QUIET_HTML"
file="../security_interstitials/core/browser/resources/interstitial_webview_quiet.html"
flattenhtml="true" type="BINDATA" />
On 2017/05/19 19:14:22, Dan Beam wrote:
> do you need to flattenhtml="true"?  are you relying on resources being
inlined?

Yes they need to be inlined, they aren't normal WebUI pages, the interstitials
can't reference external resources via chrome:// as they are blocked. This page
replaces the site the user would have seen.

https://codereview.chromium.org/2854263003/diff/200001/components/security_in...
File
components/security_interstitials/core/browser/resources/interstitial_webview_quiet.css
(right):

https://codereview.chromium.org/2854263003/diff/200001/components/security_in...
components/security_interstitials/core/browser/resources/interstitial_webview_quiet.css:18:
#details.hidden {
On 2017/05/19 19:14:22, Dan Beam wrote:
> uhhh, why is .hidden doing this rather than just using the hidden attribute?

The details fade in / out rather than just disappearing immediately hence the
use of the class versus the attribute.

https://codereview.chromium.org/2854263003/diff/200001/components/security_in...
File
components/security_interstitials/core/browser/resources/interstitial_webview_quiet.js
(right):

https://codereview.chromium.org/2854263003/diff/200001/components/security_in...
components/security_interstitials/core/browser/resources/interstitial_webview_quiet.js:7:
document.body.className = isGiantWebView ? 'giant' : '';
On 2017/05/19 19:14:22, Dan Beam wrote:
> nit: document.body.classList.toggle('giant',
> loadTimeData.getBoolean('is_giant'));

There is a second phase to this. I'll fix this in a follow up CL.

Powered by Google App Engine
This is Rietveld 408576698