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

Issue 2556573002: Fix SizeLabelToMinWidth() function such that no unnecessary space (Closed)

Created:
4 years ago by Jialiu Lin
Modified:
4 years ago
Reviewers:
Peter Kasting
CC:
chromium-reviews, asanka, tfarina, dbeam+watch-downloads_chromium.org, Nathan Parker
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Fix SizeLabelToMinWidth() function such that no unnecessary space between warning label and Discard button on download shelf. Note, this bug has been there for more than 3 years. The string change in crrev.com/2443343002 exposed this issue. The reason this bug was only reproducible on Win is because Win's font is narrower than other OSs' (a.k.a label with the same text on Win yields a smaller width) BUG=668472 Committed: https://crrev.com/047611df69b7f337f96d4ce684d21cb69baeb0b8 Cr-Commit-Position: refs/heads/master@{#437563}

Patch Set 1 #

Patch Set 2 : nit #

Total comments: 12

Patch Set 3 : address comments from pkasting@ #

Patch Set 4 : nits #

Total comments: 22

Patch Set 5 : 2nd round comments #

Total comments: 10

Patch Set 6 : refactor code #

Patch Set 7 : change to static function #

Total comments: 10

Patch Set 8 : address final nits #

Patch Set 9 : change to ViewsTestBase #

Unified diffs Side-by-side diffs Delta from patch set Stats (+78 lines, -23 lines) Patch
M chrome/browser/ui/views/download/download_item_view.h View 1 2 3 4 5 6 7 3 chunks +10 lines, -1 line 0 comments Download
M chrome/browser/ui/views/download/download_item_view.cc View 1 2 3 4 5 6 7 4 chunks +26 lines, -22 lines 0 comments Download
A chrome/browser/ui/views/download/download_item_view_unittest.cc View 1 2 3 4 5 6 7 8 1 chunk +41 lines, -0 lines 0 comments Download
M chrome/test/BUILD.gn View 1 2 3 4 5 6 7 8 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 79 (59 generated)
Jialiu Lin
Hi pkasting@, Could you take a look at this CL? Thanks!
4 years ago (2016-12-05 22:24:30 UTC) #4
Peter Kasting
Can we unittest this function? It seems like this has no tests and could use ...
4 years ago (2016-12-06 05:48:20 UTC) #9
Jialiu Lin
Thanks, pkasting@! (And sorry about all these nits. I was in a rush.) I addressed ...
4 years ago (2016-12-06 23:42:33 UTC) #16
Peter Kasting
https://codereview.chromium.org/2556573002/diff/20001/chrome/browser/ui/views/download/download_item_view.cc File chrome/browser/ui/views/download/download_item_view.cc (right): https://codereview.chromium.org/2556573002/diff/20001/chrome/browser/ui/views/download/download_item_view.cc#newcode1024 chrome/browser/ui/views/download/download_item_view.cc:1024: dangerous_download_label_sized_ = true; On 2016/12/06 23:42:33, Jialiu Lin wrote: ...
4 years ago (2016-12-08 01:05:56 UTC) #33
Jialiu Lin
Thanks! https://codereview.chromium.org/2556573002/diff/20001/chrome/browser/ui/views/download/download_item_view.cc File chrome/browser/ui/views/download/download_item_view.cc (right): https://codereview.chromium.org/2556573002/diff/20001/chrome/browser/ui/views/download/download_item_view.cc#newcode1024 chrome/browser/ui/views/download/download_item_view.cc:1024: dangerous_download_label_sized_ = true; On 2016/12/08 01:05:56, Peter Kasting ...
4 years ago (2016-12-08 04:51:58 UTC) #41
Peter Kasting
https://codereview.chromium.org/2556573002/diff/180001/chrome/browser/ui/views/download/download_item_view.cc File chrome/browser/ui/views/download/download_item_view.cc (right): https://codereview.chromium.org/2556573002/diff/180001/chrome/browser/ui/views/download/download_item_view.cc#newcode228 chrome/browser/ui/views/download/download_item_view.cc:228: dangerous_download_label_ = nullptr; This potentially double-frees. Views is expecting ...
4 years ago (2016-12-08 05:10:24 UTC) #42
Jialiu Lin
Thanks pkasting@ for your thorough review! I wish the original author of this class thought ...
4 years ago (2016-12-08 07:47:40 UTC) #47
Peter Kasting
OK, let me step back and think. Your new test is really trying to test ...
4 years ago (2016-12-08 19:10:10 UTC) #50
Jialiu Lin
On 2016/12/08 19:10:10, Peter Kasting wrote: > OK, let me step back and think. > ...
4 years ago (2016-12-08 20:44:28 UTC) #54
Peter Kasting
LGTM https://codereview.chromium.org/2556573002/diff/240001/chrome/browser/ui/views/download/download_item_view.cc File chrome/browser/ui/views/download/download_item_view.cc (right): https://codereview.chromium.org/2556573002/diff/240001/chrome/browser/ui/views/download/download_item_view.cc#newcode1028 chrome/browser/ui/views/download/download_item_view.cc:1028: // If the label is already narrower than ...
4 years ago (2016-12-08 21:53:53 UTC) #55
Jialiu Lin
All final nits addressed. Thanks, pkasting@! I learnt a lot from your review. Cheers, https://codereview.chromium.org/2556573002/diff/240001/chrome/browser/ui/views/download/download_item_view.cc ...
4 years ago (2016-12-08 22:44:04 UTC) #58
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/2556573002/260001
4 years ago (2016-12-08 23:09:37 UTC) #61
commit-bot: I haz the power
Try jobs failed on following builders: mac_chromium_compile_dbg_ng on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/mac_chromium_compile_dbg_ng/builds/320303) mac_chromium_rel_ng on master.tryserver.chromium.mac (JOB_FAILED, ...
4 years ago (2016-12-08 23:21:39 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/2556573002/260001
4 years ago (2016-12-09 03:00:30 UTC) #65
commit-bot: I haz the power
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_ng/builds/346957)
4 years ago (2016-12-09 05:02:47 UTC) #67
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/2556573002/280001
4 years ago (2016-12-09 06:11:17 UTC) #70
commit-bot: I haz the power
Try jobs failed on following builders: linux_android_rel_ng on master.tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/linux_android_rel_ng/builds/195761)
4 years ago (2016-12-09 07:49:44 UTC) #72
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/2556573002/280001
4 years ago (2016-12-09 16:20:46 UTC) #74
commit-bot: I haz the power
Committed patchset #9 (id:280001)
4 years ago (2016-12-09 16:52:28 UTC) #77
commit-bot: I haz the power
4 years ago (2016-12-12 13:51:21 UTC) #79
Message was sent while issue was closed.
Patchset 9 (id:??) landed as
https://crrev.com/047611df69b7f337f96d4ce684d21cb69baeb0b8
Cr-Commit-Position: refs/heads/master@{#437563}

Powered by Google App Engine
This is Rietveld 408576698