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

Issue 1147363005: Create FormatUrlForSecurityDisplay helper function. (Closed)

Created:
5 years, 6 months ago by palmer
Modified:
5 years, 6 months ago
CC:
chromium-reviews
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Create FormatUrlForSecurityDisplay helper function. FormatUrlForSecurityDisplay provides a canonical, concise, human-friendly display for origins. Based heavily on earlier work by dewittj and felt. Thanks! BUG=402698 Committed: https://crrev.com/d72cc48699ed600c26911b0061f44aa9cfc39e62 Cr-Commit-Position: refs/heads/master@{#332736}

Patch Set 1 #

Patch Set 2 : Add a caller. #

Patch Set 3 : Change both call sites in content_setting_bubble_model, and supply the preferred languages! #

Total comments: 18

Patch Set 4 : Respond to comments, add tests with languages. #

Total comments: 26

Patch Set 5 : Respond to comments. #

Patch Set 6 : Add a test to ensure we show trailing dots in DNS names. #

Total comments: 6

Patch Set 7 : Recurse instead of duplicate; clean-up. #

Total comments: 9

Patch Set 8 : Respond to comments. #

Patch Set 9 : Rename to FormatUrlForSecurityDisplay. #

Total comments: 16

Patch Set 10 : Update some test expectations, and fix nits. #

Total comments: 6

Patch Set 11 : Change testing strategy, respond to comments. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+206 lines, -20 lines) Patch
M chrome/browser/ui/content_settings/content_setting_bubble_model.cc View 1 2 3 4 5 6 7 8 5 chunks +6 lines, -13 lines 0 comments Download
M chrome/browser/ui/content_settings/content_setting_bubble_model_unittest.cc View 1 2 3 4 5 6 7 8 9 8 chunks +22 lines, -7 lines 0 comments Download
M chrome/browser/ui/elide_url.h View 1 2 3 4 5 6 7 8 9 10 1 chunk +16 lines, -0 lines 0 comments Download
M chrome/browser/ui/elide_url.cc View 1 2 3 4 5 6 7 8 9 10 2 chunks +43 lines, -0 lines 0 comments Download
M chrome/browser/ui/elide_url_unittest.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +119 lines, -0 lines 0 comments Download

Messages

Total messages: 41 (4 generated)
palmer
Please take a look: A new function for presenting origins to users. With tests and ...
5 years, 6 months ago (2015-05-28 23:37:21 UTC) #2
palmer
> and an example caller (replacing 1 of only 2 call sites for > net::AppendFormattedHost). ...
5 years, 6 months ago (2015-05-28 23:38:01 UTC) #3
msw
I haven't done a full review... Why didn't you add the reviewers of the original ...
5 years, 6 months ago (2015-05-29 00:18:52 UTC) #5
palmer
https://codereview.chromium.org/1147363005/diff/40001/chrome/browser/ui/content_settings/content_setting_bubble_model.cc File chrome/browser/ui/content_settings/content_setting_bubble_model.cc (right): https://codereview.chromium.org/1147363005/diff/40001/chrome/browser/ui/content_settings/content_setting_bubble_model.cc#newcode42 chrome/browser/ui/content_settings/content_setting_bubble_model.cc:42: #include "net/base/net_util.h" On 2015/05/29 00:18:51, msw wrote: > Can ...
5 years, 6 months ago (2015-05-29 17:52:13 UTC) #6
palmer
> I haven't done a full review... Why didn't you add the reviewers of the ...
5 years, 6 months ago (2015-05-29 17:58:19 UTC) #7
dewittj
Does it make sense to also include an ElideOrigin method in this file as well? ...
5 years, 6 months ago (2015-05-29 18:05:42 UTC) #8
palmer
> Does it make sense to also include an ElideOrigin method in this file as ...
5 years, 6 months ago (2015-05-29 18:07:14 UTC) #9
Ryan Sleevi
Yes, definitely happy this is landing outside of //net, and this seems like a reasonable ...
5 years, 6 months ago (2015-05-29 18:28:32 UTC) #10
felt
https://codereview.chromium.org/1147363005/diff/60001/chrome/browser/ui/elide_url_unittest.cc File chrome/browser/ui/elide_url_unittest.cc (right): https://codereview.chromium.org/1147363005/diff/60001/chrome/browser/ui/elide_url_unittest.cc#newcode411 chrome/browser/ui/elide_url_unittest.cc:411: "en-US,en,am,zh", thought: I think it's important to test this ...
5 years, 6 months ago (2015-05-29 18:31:02 UTC) #11
brettw
https://codereview.chromium.org/1147363005/diff/60001/chrome/browser/ui/elide_url_unittest.cc File chrome/browser/ui/elide_url_unittest.cc (right): https://codereview.chromium.org/1147363005/diff/60001/chrome/browser/ui/elide_url_unittest.cc#newcode335 chrome/browser/ui/elide_url_unittest.cc:335: "file://localhost/usr/example/file.html", As Ryan mentioned, we should worry about UNC ...
5 years, 6 months ago (2015-05-29 20:12:16 UTC) #12
palmer
https://codereview.chromium.org/1147363005/diff/60001/chrome/browser/ui/elide_url.cc File chrome/browser/ui/elide_url.cc (right): https://codereview.chromium.org/1147363005/diff/60001/chrome/browser/ui/elide_url.cc#newcode308 chrome/browser/ui/elide_url.cc:308: if (!url.IsStandard() || url.is_empty() || !url.is_valid()) On 2015/05/29 18:28:31, ...
5 years, 6 months ago (2015-05-29 20:40:10 UTC) #13
brettw
https://codereview.chromium.org/1147363005/diff/60001/chrome/browser/ui/elide_url.cc File chrome/browser/ui/elide_url.cc (right): https://codereview.chromium.org/1147363005/diff/60001/chrome/browser/ui/elide_url.cc#newcode313 chrome/browser/ui/elide_url.cc:313: base::UTF8ToUTF16(url.path()); On 2015/05/29 20:40:10, palmer wrote: > On 2015/05/29 ...
5 years, 6 months ago (2015-05-29 20:43:08 UTC) #14
palmer
> Oh, and there's one more thing to consider about - how you want to ...
5 years, 6 months ago (2015-05-29 20:43:14 UTC) #15
Ryan Sleevi
On 2015/05/29 20:43:14, palmer wrote: > If SOP treats them differently, then I want to ...
5 years, 6 months ago (2015-05-29 21:00:09 UTC) #16
Ryan Sleevi
On 2015/05/29 20:43:14, palmer wrote: > If SOP treats them differently, then I want to ...
5 years, 6 months ago (2015-05-29 21:02:04 UTC) #17
Ryan Sleevi
https://codereview.chromium.org/1147363005/diff/60001/chrome/browser/ui/elide_url.cc File chrome/browser/ui/elide_url.cc (right): https://codereview.chromium.org/1147363005/diff/60001/chrome/browser/ui/elide_url.cc#newcode344 chrome/browser/ui/elide_url.cc:344: if (origin.port().length() > 0 && port != 0 && ...
5 years, 6 months ago (2015-05-29 21:13:51 UTC) #18
palmer
https://codereview.chromium.org/1147363005/diff/100001/chrome/browser/ui/elide_url.cc File chrome/browser/ui/elide_url.cc (right): https://codereview.chromium.org/1147363005/diff/100001/chrome/browser/ui/elide_url.cc#newcode316 chrome/browser/ui/elide_url.cc:316: return (base::ASCIIToUTF16(url::kFileScheme)) + scheme_separator + On 2015/05/29 21:13:51, Ryan ...
5 years, 6 months ago (2015-05-29 21:51:37 UTC) #19
palmer
> > When given "https://173.194.65.103:000" (test case "Invalid port 1"), the port > > is ...
5 years, 6 months ago (2015-05-29 21:53:34 UTC) #20
palmer
> From a quick scan, we have two modes - whether or not we enforce ...
5 years, 6 months ago (2015-05-29 22:13:38 UTC) #21
Ryan Sleevi
On 2015/05/29 22:13:38, palmer wrote: > > From a quick scan, we have two modes ...
5 years, 6 months ago (2015-05-29 22:18:15 UTC) #22
Ryan Sleevi
On 2015/05/29 22:13:38, palmer wrote: > Yow. > > brettw considers it a bad bug ...
5 years, 6 months ago (2015-05-29 22:20:55 UTC) #23
palmer
TL;DR: I *think* we only need to worry about the hostnames issue. As rsleevi says, ...
5 years, 6 months ago (2015-05-29 23:03:25 UTC) #24
Ryan Sleevi
Mostly good, although a few more things that came up with fresh eyes reviewing. https://codereview.chromium.org/1147363005/diff/120001/chrome/browser/ui/elide_url.cc ...
5 years, 6 months ago (2015-06-01 21:18:46 UTC) #25
palmer
https://codereview.chromium.org/1147363005/diff/120001/chrome/browser/ui/elide_url.cc File chrome/browser/ui/elide_url.cc (right): https://codereview.chromium.org/1147363005/diff/120001/chrome/browser/ui/elide_url.cc#newcode309 chrome/browser/ui/elide_url.cc:309: return net::FormatUrl(url, languages); Most pressing for me right now ...
5 years, 6 months ago (2015-06-01 23:30:34 UTC) #26
Ryan Sleevi
https://codereview.chromium.org/1147363005/diff/120001/chrome/browser/ui/elide_url.h File chrome/browser/ui/elide_url.h (right): https://codereview.chromium.org/1147363005/diff/120001/chrome/browser/ui/elide_url.h#newcode53 chrome/browser/ui/elide_url.h:53: // - Omits the port if it is the ...
5 years, 6 months ago (2015-06-02 01:08:14 UTC) #27
palmer
Calling it FormatUrlForSecurityDisplay now. msw and felt, as OWNERS, any thoughts?
5 years, 6 months ago (2015-06-02 21:00:46 UTC) #28
msw
https://codereview.chromium.org/1147363005/diff/160001/chrome/browser/ui/elide_url.cc File chrome/browser/ui/elide_url.cc (right): https://codereview.chromium.org/1147363005/diff/160001/chrome/browser/ui/elide_url.cc#newcode313 chrome/browser/ui/elide_url.cc:313: (base::ASCIIToUTF16(url::kStandardSchemeSeparator))); nit: drop extra parens around base::ASCII... https://codereview.chromium.org/1147363005/diff/160001/chrome/browser/ui/elide_url.h File ...
5 years, 6 months ago (2015-06-02 23:45:17 UTC) #29
palmer
https://codereview.chromium.org/1147363005/diff/160001/chrome/browser/ui/elide_url.cc File chrome/browser/ui/elide_url.cc (right): https://codereview.chromium.org/1147363005/diff/160001/chrome/browser/ui/elide_url.cc#newcode313 chrome/browser/ui/elide_url.cc:313: (base::ASCIIToUTF16(url::kStandardSchemeSeparator))); On 2015/06/02 23:45:16, msw wrote: > nit: drop ...
5 years, 6 months ago (2015-06-03 01:01:47 UTC) #30
msw
https://codereview.chromium.org/1147363005/diff/160001/chrome/browser/ui/elide_url_unittest.cc File chrome/browser/ui/elide_url_unittest.cc (right): https://codereview.chromium.org/1147363005/diff/160001/chrome/browser/ui/elide_url_unittest.cc#newcode210 chrome/browser/ui/elide_url_unittest.cc:210: const char* const languages; On 2015/06/03 01:01:46, palmer wrote: ...
5 years, 6 months ago (2015-06-03 01:19:21 UTC) #31
felt
https://codereview.chromium.org/1147363005/diff/180001/chrome/browser/ui/elide_url.cc File chrome/browser/ui/elide_url.cc (right): https://codereview.chromium.org/1147363005/diff/180001/chrome/browser/ui/elide_url.cc#newcode344 chrome/browser/ui/elide_url.cc:344: result += base::ASCIIToUTF16(":") + base::UTF8ToUTF16(origin.port()); should this use the ...
5 years, 6 months ago (2015-06-03 01:31:58 UTC) #32
felt
ui/content_settings lgtm
5 years, 6 months ago (2015-06-03 18:40:07 UTC) #33
Ryan Sleevi
I'll leave msw for the tests, but LGTM (knowing the caveats already discussed) Note: A ...
5 years, 6 months ago (2015-06-03 19:09:04 UTC) #34
palmer
https://codereview.chromium.org/1147363005/diff/160001/chrome/browser/ui/elide_url_unittest.cc File chrome/browser/ui/elide_url_unittest.cc (right): https://codereview.chromium.org/1147363005/diff/160001/chrome/browser/ui/elide_url_unittest.cc#newcode210 chrome/browser/ui/elide_url_unittest.cc:210: const char* const languages; On 2015/06/03 01:19:21, msw wrote: ...
5 years, 6 months ago (2015-06-03 21:24:38 UTC) #35
msw
lgtm
5 years, 6 months ago (2015-06-03 21:37:08 UTC) #36
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1147363005/200001
5 years, 6 months ago (2015-06-03 23:05:39 UTC) #39
commit-bot: I haz the power
Committed patchset #11 (id:200001)
5 years, 6 months ago (2015-06-03 23:50:57 UTC) #40
commit-bot: I haz the power
5 years, 6 months ago (2015-06-03 23:51:45 UTC) #41
Message was sent while issue was closed.
Patchset 11 (id:??) landed as
https://crrev.com/d72cc48699ed600c26911b0061f44aa9cfc39e62
Cr-Commit-Position: refs/heads/master@{#332736}

Powered by Google App Engine
This is Rietveld 408576698