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

Issue 2801583002: Use views::style for buttons, bootstrap ash_typography to do so. (Closed)

Created:
3 years, 8 months ago by tapted
Modified:
3 years, 7 months ago
Reviewers:
Peter Kasting, sky
CC:
chromium-reviews, tfarina, chrome-apps-syd-reviews_chromium.org, Evan Stade
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Use views::style for buttons, bootstrap ash_typography to do so. This makes LabelButton::AdjustFontSize() obsolete. LabelButton::SetFontSize() is also mostly obsolete. Remove it. Two remaining cases are button subclasses that are never "default" buttons so they can just set the font list on the button->label() directly. BUG=691891, 623987 TEST=LabelButtonTest.TextSizeFromContext (replaces AdjustFontSize) Review-Url: https://codereview.chromium.org/2801583002 Cr-Commit-Position: refs/heads/master@{#472019} Committed: https://chromium.googlesource.com/chromium/src/+/e3880da51bf9da14f748d00ac7b5741989107696

Patch Set 1 : add a test, make it pass. #

Patch Set 2 : Remove LabelButton::GetFontList, Use typography for ash toast ui #

Patch Set 3 : base off test cleanup in crrev/2799403002 #

Patch Set 4 : More self review #

Total comments: 31

Patch Set 5 : respond to comments #

Patch Set 6 : rebase for epic ash file move #

Total comments: 2

Patch Set 7 : Add back MD context #

Patch Set 8 : rebase #

Patch Set 9 : ResourceBundle: Make font weights relative to the base font weight. #

Patch Set 10 : Behaviour change: removes helper methods #

Patch Set 11 : Guh. Rebase again #

Patch Set 12 : Fix CrOS compile #

Patch Set 13 : rebase for ash/BUILD.gn #

Patch Set 14 : Revert to Patchset 8 (no relative font weights) #

Patch Set 15 : selfnits #

Total comments: 8

Patch Set 16 : Respond to comments #

Patch Set 17 : rebase for r471279 - label_button.*. use ash/public properly #

Patch Set 18 : placate gn check. new_avatar_button now just avatar_button #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+281 lines, -185 lines) Patch
M ash/public/cpp/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 2 chunks +3 lines, -0 lines 0 comments Download
A ash/public/cpp/ash_typography.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +35 lines, -0 lines 2 comments Download
A ash/public/cpp/ash_typography.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +23 lines, -0 lines 0 comments Download
M ash/system/session/logout_button_tray.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 2 chunks +4 lines, -2 lines 0 comments Download
M ash/system/toast/toast_overlay.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 5 chunks +4 lines, -14 lines 0 comments Download
M chrome/browser/ui/views/harmony/chrome_typography.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 2 chunks +14 lines, -2 lines 0 comments Download
M chrome/browser/ui/views/harmony/chrome_typography.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +4 lines, -0 lines 0 comments Download
M chrome/browser/ui/views/harmony/harmony_typography_provider.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 4 chunks +19 lines, -8 lines 0 comments Download
M chrome/browser/ui/views/harmony/layout_provider_unittest.cc View 1 2 3 4 5 6 7 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/browser/ui/views/profiles/avatar_button.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/ui/views/toolbar/app_menu.cc View 1 2 3 4 5 6 7 1 chunk +1 line, -1 line 0 comments Download
M ui/views/controls/button/label_button.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 5 chunks +10 lines, -9 lines 0 comments Download
M ui/views/controls/button/label_button.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 6 chunks +18 lines, -67 lines 0 comments Download
M ui/views/controls/button/label_button_unittest.cc View 1 2 3 4 5 6 7 8 9 10 4 chunks +39 lines, -18 lines 0 comments Download
M ui/views/controls/button/md_text_button.h View 1 2 3 5 6 3 chunks +4 lines, -7 lines 0 comments Download
M ui/views/controls/button/md_text_button.cc View 1 2 3 4 5 6 7 8 9 10 7 chunks +13 lines, -28 lines 0 comments Download
M ui/views/style/typography.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 3 chunks +13 lines, -3 lines 0 comments Download
M ui/views/style/typography_provider.h View 1 2 3 4 5 6 10 11 12 13 2 chunks +12 lines, -4 lines 0 comments Download
M ui/views/style/typography_provider.cc View 1 2 3 4 5 6 9 10 11 12 13 2 chunks +60 lines, -18 lines 0 comments Download
M ui/views/touchui/touch_selection_menu_runner_views.cc View 3 chunks +2 lines, -3 lines 0 comments Download

Messages

Total messages: 134 (108 generated)
tapted
Hi Peter, please take a look. I think this is ready for review, but I'll ...
3 years, 8 months ago (2017-04-07 07:49:52 UTC) #42
Peter Kasting
Do we have any opportunity to reduce the number of new contexts by making small ...
3 years, 8 months ago (2017-04-08 01:38:54 UTC) #45
tapted
On 2017/04/08 01:38:54, Peter Kasting wrote: > Do we have any opportunity to reduce the ...
3 years, 8 months ago (2017-04-10 12:27:33 UTC) #62
Peter Kasting
https://codereview.chromium.org/2801583002/diff/230001/ui/views/style/typography.h File ui/views/style/typography.h (right): https://codereview.chromium.org/2801583002/diff/230001/ui/views/style/typography.h#newcode41 ui/views/style/typography.h:41: CONTEXT_BUTTON_MD, On 2017/04/10 12:27:33, tapted wrote: > On 2017/04/08 ...
3 years, 8 months ago (2017-04-10 22:56:02 UTC) #63
tapted
+sky for src/ash and ui/views OWNERS. And any other thoughts :). thanks! https://codereview.chromium.org/2801583002/diff/230001/ui/views/style/typography.h File ui/views/style/typography.h ...
3 years, 8 months ago (2017-04-11 01:56:50 UTC) #68
Peter Kasting
https://codereview.chromium.org/2801583002/diff/230001/ui/views/style/typography.h File ui/views/style/typography.h (right): https://codereview.chromium.org/2801583002/diff/230001/ui/views/style/typography.h#newcode41 ui/views/style/typography.h:41: CONTEXT_BUTTON_MD, On 2017/04/11 01:56:50, tapted wrote: > On 2017/04/10 ...
3 years, 8 months ago (2017-04-11 02:24:20 UTC) #69
tapted
https://codereview.chromium.org/2801583002/diff/230001/ui/views/style/typography.h File ui/views/style/typography.h (right): https://codereview.chromium.org/2801583002/diff/230001/ui/views/style/typography.h#newcode41 ui/views/style/typography.h:41: CONTEXT_BUTTON_MD, On 2017/04/11 02:24:20, Peter Kasting wrote: > On ...
3 years, 8 months ago (2017-04-12 07:31:48 UTC) #72
Peter Kasting
I gotta run for the moment, so don't have time to look closely, but I'm ...
3 years, 8 months ago (2017-04-13 00:50:00 UTC) #73
tapted
On 2017/04/13 00:50:00, Peter Kasting wrote: > I gotta run for the moment, so don't ...
3 years, 8 months ago (2017-04-13 00:56:36 UTC) #74
Peter Kasting
On 2017/04/13 00:56:36, tapted wrote: > On 2017/04/13 00:50:00, Peter Kasting wrote: > > I ...
3 years, 8 months ago (2017-04-13 03:53:17 UTC) #75
tapted
On 2017/04/13 03:53:17, Peter Kasting (catching up) wrote: > On 2017/04/13 00:56:36, tapted wrote: > ...
3 years, 7 months ago (2017-05-05 03:08:49 UTC) #78
sky
On 2017/05/05 03:08:49, tapted wrote: > On 2017/04/13 03:53:17, Peter Kasting (catching up) wrote: > ...
3 years, 7 months ago (2017-05-05 14:24:42 UTC) #89
Peter Kasting
On 2017/05/05 03:08:49, tapted wrote: > On 2017/04/13 03:53:17, Peter Kasting (catching up) wrote: > ...
3 years, 7 months ago (2017-05-06 03:03:16 UTC) #90
tapted
Peter, PTAL. I've basically reverted to patchset 8. As discussed in the Harmony sync, it ...
3 years, 7 months ago (2017-05-11 04:01:53 UTC) #101
Peter Kasting
On 2017/05/11 04:01:53, tapted wrote: > Peter, PTAL. I've basically reverted to patchset 8. > ...
3 years, 7 months ago (2017-05-11 06:07:13 UTC) #102
tapted
On 2017/05/11 06:07:13, Peter Kasting wrote: > On 2017/05/11 04:01:53, tapted wrote: > > Peter, ...
3 years, 7 months ago (2017-05-11 07:26:17 UTC) #103
Peter Kasting
OK, if this preserves existing behavior, then LGTM for now. I didn't re-review since plenty ...
3 years, 7 months ago (2017-05-11 15:42:46 UTC) #104
tapted
sky: please take a look for OWNERS. (principally the ash/* stuff, but it's all related) ...
3 years, 7 months ago (2017-05-12 01:57:05 UTC) #105
sky
https://codereview.chromium.org/2801583002/diff/510001/ash/ash_typography.cc File ash/ash_typography.cc (right): https://codereview.chromium.org/2801583002/diff/510001/ash/ash_typography.cc#newcode20 ash/ash_typography.cc:20: } Don't you need a default: NOTREACHED? https://codereview.chromium.org/2801583002/diff/510001/ash/ash_typography.h File ...
3 years, 7 months ago (2017-05-12 17:00:12 UTC) #106
tapted
https://codereview.chromium.org/2801583002/diff/510001/ash/ash_typography.cc File ash/ash_typography.cc (right): https://codereview.chromium.org/2801583002/diff/510001/ash/ash_typography.cc#newcode20 ash/ash_typography.cc:20: } On 2017/05/12 17:00:11, sky wrote: > Don't you ...
3 years, 7 months ago (2017-05-15 23:02:33 UTC) #124
Peter Kasting
https://codereview.chromium.org/2801583002/diff/590001/ash/public/cpp/ash_typography.h File ash/public/cpp/ash_typography.h (right): https://codereview.chromium.org/2801583002/diff/590001/ash/public/cpp/ash_typography.h#newcode5 ash/public/cpp/ash_typography.h:5: #ifndef ASH_PUBLIC_CPP_ASH_TYPOGRAPHY_H_ On 2017/05/15 23:02:33, tapted wrote: > I ...
3 years, 7 months ago (2017-05-15 23:29:47 UTC) #125
sky
LGTM
3 years, 7 months ago (2017-05-16 01:22:35 UTC) #126
tapted
Thanks all! On 2017/05/15 23:29:47, Peter Kasting wrote: > https://codereview.chromium.org/2801583002/diff/590001/ash/public/cpp/ash_typography.h > File ash/public/cpp/ash_typography.h (right): > ...
3 years, 7 months ago (2017-05-16 04:46:25 UTC) #127
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/2801583002/590001
3 years, 7 months ago (2017-05-16 04:47:07 UTC) #130
commit-bot: I haz the power
Committed patchset #18 (id:590001) as https://chromium.googlesource.com/chromium/src/+/e3880da51bf9da14f748d00ac7b5741989107696
3 years, 7 months ago (2017-05-16 05:35:34 UTC) #133
sky
3 years, 7 months ago (2017-05-17 15:29:04 UTC) #134
Message was sent while issue was closed.
On Mon, May 15, 2017 at 9:46 PM, <tapted@chromium.org> wrote:

> Thanks all!
>
> On 2017/05/15 23:29:47, Peter Kasting wrote:
> >
> https://codereview.chromium.org/2801583002/diff/590001/
> ash/public/cpp/ash_typography.h
> > File ash/public/cpp/ash_typography.h (right):
> >
> >
> https://codereview.chromium.org/2801583002/diff/590001/
> ash/public/cpp/ash_typography.h#newcode5
> > ash/public/cpp/ash_typography.h:5: #ifndef
> ASH_PUBLIC_CPP_ASH_TYPOGRAPHY_H_
> > On 2017/05/15 23:02:33, tapted wrote:
> > > I couldn't decide whether to drop the "ash_" and just call this
> typography.h
> -
> > > (the ash_ prefix is consistent with chrome_typography.h, but seems to
> diverge
> > a
> > > bit from other things in ash/public/cpp).
> >
> > You could solve this inconsistency by dropping it from both :)
>
> leaving as-is for now. Although it's unlikely happen in this particular
> case
> (and without source_set), I've run into same-named files causing conflicts
> when
> linking a target enough times that I'm wary of opting for that.
>

I have found that using distinct file names makes it easier in discussions,
otherwise you have to prefix that with the directory, e.g. look at the file
typography in ash, vs look at the file named ash_typography. In this case
it isn't that big of deal, but I've found it supremely confusing when we
have had two Window classes but in different packages.

  -Scott


>
> https://codereview.chromium.org/2801583002/
>

-- 
You received this message because you are subscribed to the Google Groups
"Chromium-reviews" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to chromium-reviews+unsubscribe@chromium.org.

Powered by Google App Engine
This is Rietveld 408576698