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

Issue 470053004: [Win, Linux] Always display the avatar button text at the same size. (Closed)

Created:
6 years, 4 months ago by noms (inactive)
Modified:
6 years, 3 months ago
Reviewers:
msw, Peter Kasting
CC:
chromium-reviews, tfarina, ckocagil
Project:
chromium
Visibility:
Public.

Description

[Win, Linux] Always display the avatar button text at the same size. The problem is that some locales (Hindi) or platforms (Linux) have a bigger base font size for the default font (crbug.com/405994). If this is the case, we should decrease the font size to the one we expect, so that the font fits in the button correctly. Just adjusting the baseline is not always enough, as the new avatar button has a fixed size, and the text might not fit correctly regardless of the baseline adjustments. Screenshots: https://drive.google.com/folderview?id=0B1B1Up4p2NRMRHc5WTBxZWNrRm8&usp=sharing BUG=403466 TEST=Start Chrome with --enable-new-avatar-menu on Linux, or with --enable-new-avatar-menu and --lang-hi on Windows. The avatar button text should fit nicely in the button. Committed: https://crrev.com/899ae44e331661f709f463d6861a1dbceb9194f2 Cr-Commit-Position: refs/heads/master@{#292715}

Patch Set 1 #

Total comments: 5

Patch Set 2 : pull out omnibox code to a common place #

Total comments: 9

Patch Set 3 : nits + added a test #

Patch Set 4 : maybe made test better? #

Total comments: 8

Patch Set 5 : rebase + review comments and moar better test #

Total comments: 6

Patch Set 6 : nits #

Total comments: 4

Patch Set 7 : nits part 2 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+78 lines, -50 lines) Patch
M chrome/browser/ui/views/location_bar/location_bar_view.cc View 1 2 3 4 2 chunks +3 lines, -50 lines 0 comments Download
M chrome/browser/ui/views/profiles/new_avatar_button.cc View 1 2 3 4 5 6 1 chunk +6 lines, -0 lines 0 comments Download
M ui/gfx/font_list.h View 1 2 3 4 5 1 chunk +25 lines, -0 lines 0 comments Download
M ui/gfx/font_list.cc View 1 2 3 4 1 chunk +21 lines, -0 lines 0 comments Download
M ui/gfx/font_list_unittest.cc View 1 2 3 4 5 6 1 chunk +23 lines, -0 lines 0 comments Download

Messages

Total messages: 30 (1 generated)
noms (inactive)
6 years, 4 months ago (2014-08-25 17:07:37 UTC) #1
msw
https://codereview.chromium.org/470053004/diff/1/chrome/browser/ui/views/profiles/new_avatar_button.cc File chrome/browser/ui/views/profiles/new_avatar_button.cc (right): https://codereview.chromium.org/470053004/diff/1/chrome/browser/ui/views/profiles/new_avatar_button.cc#newcode68 chrome/browser/ui/views/profiles/new_avatar_button.cc:68: SetFontList(GetFontList().DeriveWithSizeDelta( I think we might need to use the ...
6 years, 4 months ago (2014-08-25 19:17:21 UTC) #2
noms (inactive)
https://codereview.chromium.org/470053004/diff/1/chrome/browser/ui/views/profiles/new_avatar_button.cc File chrome/browser/ui/views/profiles/new_avatar_button.cc (right): https://codereview.chromium.org/470053004/diff/1/chrome/browser/ui/views/profiles/new_avatar_button.cc#newcode68 chrome/browser/ui/views/profiles/new_avatar_button.cc:68: SetFontList(GetFontList().DeriveWithSizeDelta( I originally had the font height, but it ...
6 years, 4 months ago (2014-08-25 19:19:36 UTC) #3
noms (inactive)
https://codereview.chromium.org/470053004/diff/1/chrome/browser/ui/views/profiles/new_avatar_button.cc File chrome/browser/ui/views/profiles/new_avatar_button.cc (right): https://codereview.chromium.org/470053004/diff/1/chrome/browser/ui/views/profiles/new_avatar_button.cc#newcode68 chrome/browser/ui/views/profiles/new_avatar_button.cc:68: SetFontList(GetFontList().DeriveWithSizeDelta( I originally had the font height, but it ...
6 years, 4 months ago (2014-08-25 19:19:37 UTC) #4
msw
https://codereview.chromium.org/470053004/diff/1/chrome/browser/ui/views/profiles/new_avatar_button.cc File chrome/browser/ui/views/profiles/new_avatar_button.cc (right): https://codereview.chromium.org/470053004/diff/1/chrome/browser/ui/views/profiles/new_avatar_button.cc#newcode68 chrome/browser/ui/views/profiles/new_avatar_button.cc:68: SetFontList(GetFontList().DeriveWithSizeDelta( On 2014/08/25 19:19:36, Monica Dinculescu wrote: > I ...
6 years, 4 months ago (2014-08-25 19:43:49 UTC) #5
noms (inactive)
https://codereview.chromium.org/470053004/diff/1/chrome/browser/ui/views/profiles/new_avatar_button.cc File chrome/browser/ui/views/profiles/new_avatar_button.cc (right): https://codereview.chromium.org/470053004/diff/1/chrome/browser/ui/views/profiles/new_avatar_button.cc#newcode68 chrome/browser/ui/views/profiles/new_avatar_button.cc:68: SetFontList(GetFontList().DeriveWithSizeDelta( So what I had was: const int kDisplayFontSize ...
6 years, 4 months ago (2014-08-25 20:06:02 UTC) #6
msw
https://codereview.chromium.org/470053004/diff/1/chrome/browser/ui/views/profiles/new_avatar_button.cc File chrome/browser/ui/views/profiles/new_avatar_button.cc (right): https://codereview.chromium.org/470053004/diff/1/chrome/browser/ui/views/profiles/new_avatar_button.cc#newcode68 chrome/browser/ui/views/profiles/new_avatar_button.cc:68: SetFontList(GetFontList().DeriveWithSizeDelta( On 2014/08/25 20:06:02, Monica Dinculescu wrote: > So ...
6 years, 4 months ago (2014-08-25 20:13:51 UTC) #7
noms (inactive)
I pulled out the font-shrinking function out of the omnibox, and I think it would ...
6 years, 3 months ago (2014-08-27 21:49:42 UTC) #8
noms (inactive)
Screenshots with the patch applied: glass: https://drive.google.com/open?id=0B1B1Up4p2NRMejR1VXZMNkcxeHM&authuser=1 theme: https://drive.google.com/open?id=0B1B1Up4p2NRMZ19zRE1nMjRwRVE&authuser=1
6 years, 3 months ago (2014-08-28 14:11:53 UTC) #9
noms (inactive)
Ping?
6 years, 3 months ago (2014-08-28 19:23:39 UTC) #10
noms (inactive)
noms@chromium.org changed reviewers: + pkasting@chromium.org
6 years, 3 months ago (2014-08-28 19:28:36 UTC) #11
noms (inactive)
+ Peter, as I think this is originally his code :)
6 years, 3 months ago (2014-08-28 19:28:36 UTC) #12
Peter Kasting
Is there a way to unittest this, now that it's a public API? Otherwise, I'm ...
6 years, 3 months ago (2014-08-28 19:34:18 UTC) #13
msw
https://codereview.chromium.org/470053004/diff/20001/chrome/browser/ui/views/profiles/new_avatar_button.cc File chrome/browser/ui/views/profiles/new_avatar_button.cc (right): https://codereview.chromium.org/470053004/diff/20001/chrome/browser/ui/views/profiles/new_avatar_button.cc#newcode21 chrome/browser/ui/views/profiles/new_avatar_button.cc:21: const int kDisplayFontHeight = 15; Was this height derived ...
6 years, 3 months ago (2014-08-28 19:40:03 UTC) #14
noms (inactive)
I've added a test, but it doesn't look particularly inspiring to me. I wanted to ...
6 years, 3 months ago (2014-08-28 20:36:25 UTC) #15
noms (inactive)
Patch set 4 has a slightly less hacky test, though I'm not sure why the ...
6 years, 3 months ago (2014-08-28 20:49:44 UTC) #16
Peter Kasting
On 2014/08/28 20:49:44, Monica Dinculescu wrote: > Patch set 4 has a slightly less hacky ...
6 years, 3 months ago (2014-08-28 21:06:35 UTC) #17
msw
https://codereview.chromium.org/470053004/diff/20001/chrome/browser/ui/views/profiles/new_avatar_button.cc File chrome/browser/ui/views/profiles/new_avatar_button.cc (right): https://codereview.chromium.org/470053004/diff/20001/chrome/browser/ui/views/profiles/new_avatar_button.cc#newcode21 chrome/browser/ui/views/profiles/new_avatar_button.cc:21: const int kDisplayFontHeight = 15; On 2014/08/28 20:36:25, Monica ...
6 years, 3 months ago (2014-08-28 21:43:51 UTC) #18
Peter Kasting
https://codereview.chromium.org/470053004/diff/60001/ui/gfx/font_list.h File ui/gfx/font_list.h (right): https://codereview.chromium.org/470053004/diff/60001/ui/gfx/font_list.h#newcode124 ui/gfx/font_list.h:124: // The expected layout: On 2014/08/28 21:43:50, msw wrote: ...
6 years, 3 months ago (2014-08-28 21:52:03 UTC) #19
noms (inactive)
https://codereview.chromium.org/470053004/diff/20001/chrome/browser/ui/views/profiles/new_avatar_button.cc File chrome/browser/ui/views/profiles/new_avatar_button.cc (right): https://codereview.chromium.org/470053004/diff/20001/chrome/browser/ui/views/profiles/new_avatar_button.cc#newcode21 chrome/browser/ui/views/profiles/new_avatar_button.cc:21: const int kDisplayFontHeight = 15; I went with adding ...
6 years, 3 months ago (2014-08-29 17:10:29 UTC) #20
msw
LGTM with nits. https://codereview.chromium.org/470053004/diff/100001/chrome/browser/ui/views/profiles/new_avatar_button.cc File chrome/browser/ui/views/profiles/new_avatar_button.cc (right): https://codereview.chromium.org/470053004/diff/100001/chrome/browser/ui/views/profiles/new_avatar_button.cc#newcode24 chrome/browser/ui/views/profiles/new_avatar_button.cc:24: const int kDisplayFontHeight = 15; nit: ...
6 years, 3 months ago (2014-08-29 17:25:59 UTC) #21
noms (inactive)
https://codereview.chromium.org/470053004/diff/100001/chrome/browser/ui/views/profiles/new_avatar_button.cc File chrome/browser/ui/views/profiles/new_avatar_button.cc (right): https://codereview.chromium.org/470053004/diff/100001/chrome/browser/ui/views/profiles/new_avatar_button.cc#newcode24 chrome/browser/ui/views/profiles/new_avatar_button.cc:24: const int kDisplayFontHeight = 15; On 2014/08/29 17:25:58, msw ...
6 years, 3 months ago (2014-08-29 18:03:20 UTC) #22
Peter Kasting
LGTM https://codereview.chromium.org/470053004/diff/120001/chrome/browser/ui/views/profiles/new_avatar_button.cc File chrome/browser/ui/views/profiles/new_avatar_button.cc (right): https://codereview.chromium.org/470053004/diff/120001/chrome/browser/ui/views/profiles/new_avatar_button.cc#newcode65 chrome/browser/ui/views/profiles/new_avatar_button.cc:65: // is larger than this, it will be ...
6 years, 3 months ago (2014-08-29 18:12:27 UTC) #23
noms (inactive)
Yay, thanks everyone! https://codereview.chromium.org/470053004/diff/120001/chrome/browser/ui/views/profiles/new_avatar_button.cc File chrome/browser/ui/views/profiles/new_avatar_button.cc (right): https://codereview.chromium.org/470053004/diff/120001/chrome/browser/ui/views/profiles/new_avatar_button.cc#newcode65 chrome/browser/ui/views/profiles/new_avatar_button.cc:65: // is larger than this, it ...
6 years, 3 months ago (2014-08-29 18:20:22 UTC) #24
noms (inactive)
https://codereview.chromium.org/470053004/diff/120001/ui/gfx/font_list_unittest.cc File ui/gfx/font_list_unittest.cc (right): https://codereview.chromium.org/470053004/diff/120001/ui/gfx/font_list_unittest.cc#newcode310 ui/gfx/font_list_unittest.cc:310: } On 2014/08/29 18:12:26, Peter Kasting wrote: > Nit: ...
6 years, 3 months ago (2014-08-29 18:20:45 UTC) #25
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/noms@chromium.org/470053004/140001
6 years, 3 months ago (2014-08-29 18:22:33 UTC) #27
commit-bot: I haz the power
FYI, CQ is re-trying this CL (attempt #1). The failing builders are: win_chromium_rel_swarming on tryserver.chromium.win ...
6 years, 3 months ago (2014-08-29 22:50:00 UTC) #28
commit-bot: I haz the power
Committed patchset #7 (id:140001) as f4be6629e20a1164019b34e4fda4888324d6114b
6 years, 3 months ago (2014-08-29 23:30:46 UTC) #29
commit-bot: I haz the power
6 years, 3 months ago (2014-09-10 03:11:40 UTC) #30
Message was sent while issue was closed.
Patchset 7 (id:??) landed as
https://crrev.com/899ae44e331661f709f463d6861a1dbceb9194f2
Cr-Commit-Position: refs/heads/master@{#292715}

Powered by Google App Engine
This is Rietveld 408576698