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

Issue 17756003: Colors in views::StyledLabel. (Closed)

Created:
7 years, 6 months ago by fdoray
Modified:
7 years, 5 months ago
CC:
chromium-reviews, tfarina, oshima+watch_chromium.org, stevenjb+watch_chromium.org, nkostylev+watch_chromium.org, davemoore+watch_chromium.org, sky
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Visibility:
Public.

Description

Colors in views::StyledLabel. Add the possibility to specify a custom foreground color when defining the style of a text range in a views::StyledLabel. Also support auto color readability in views::StyledLabel, to automatically adjust the foreground colors when they are not readable over the background color. Necessary to comply with the mock of the bookmark sync promo (crbug.com/244279). TEST=No user visible change introduced by this CL. Custom colors will be used in the bookmark sync promo (crbug.com/244279). BUG=244630 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=211471

Patch Set 1 #

Total comments: 6

Patch Set 2 : Color readability + Tests #

Patch Set 3 : Static function to get the default color of links #

Patch Set 4 : Style fix #

Total comments: 2

Patch Set 5 : Colors from SkColor.h #

Total comments: 6

Patch Set 6 : Remove unused method SetAutoColorReadabilityEnabled #

Patch Set 7 : Rename SetBackgroundColor -> SetDisplayedOnBackgroundColor #

Total comments: 2

Patch Set 8 : Static variable in GetDefaultEnabledColor #

Patch Set 9 : No static variables #

Patch Set 10 : Rebase #

Unified diffs Side-by-side diffs Delta from patch set Stats (+131 lines, -43 lines) Patch
M chrome/browser/chromeos/ui/echo_dialog_view.cc View 2 chunks +4 lines, -4 lines 0 comments Download
M chrome/browser/ui/views/autofill/autofill_dialog_views.cc View 1 2 3 4 5 6 7 8 9 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/browser/ui/views/sync/profile_signin_confirmation_dialog_views.cc View 1 2 3 4 5 6 3 chunks +8 lines, -5 lines 0 comments Download
M ui/views/controls/link.h View 1 2 2 chunks +3 lines, -0 lines 0 comments Download
M ui/views/controls/link.cc View 1 2 3 4 5 6 7 8 2 chunks +17 lines, -22 lines 0 comments Download
M ui/views/controls/styled_label.h View 1 2 3 4 5 6 4 chunks +16 lines, -0 lines 0 comments Download
M ui/views/controls/styled_label.cc View 1 2 3 4 5 6 10 chunks +28 lines, -12 lines 0 comments Download
M ui/views/controls/styled_label_unittest.cc View 1 2 3 4 5 6 2 chunks +53 lines, -0 lines 0 comments Download

Messages

Total messages: 43 (0 generated)
fdoray
Could you review this CL? Thanks.
7 years, 6 months ago (2013-06-25 21:55:49 UTC) #1
Roger Tawa OOO till Jul 10th
https://codereview.chromium.org/17756003/diff/1/chrome/browser/chromeos/ui/echo_dialog_view.cc File chrome/browser/chromeos/ui/echo_dialog_view.cc (right): https://codereview.chromium.org/17756003/diff/1/chrome/browser/chromeos/ui/echo_dialog_view.cc#newcode62 chrome/browser/chromeos/ui/echo_dialog_view.cc:62: views::StyledLabel::RangeStyleInfo::CreateForLink(); This changes |disable_line_wrapping| from false to true. Is ...
7 years, 6 months ago (2013-06-26 15:16:29 UTC) #2
fdoray
Answered Roger's comments. https://codereview.chromium.org/17756003/diff/1/chrome/browser/chromeos/ui/echo_dialog_view.cc File chrome/browser/chromeos/ui/echo_dialog_view.cc (right): https://codereview.chromium.org/17756003/diff/1/chrome/browser/chromeos/ui/echo_dialog_view.cc#newcode62 chrome/browser/chromeos/ui/echo_dialog_view.cc:62: views::StyledLabel::RangeStyleInfo::CreateForLink(); On 2013/06/26 15:16:29, Roger Tawa ...
7 years, 6 months ago (2013-06-26 17:06:38 UTC) #3
Roger Tawa OOO till Jul 10th
https://codereview.chromium.org/17756003/diff/1/ui/views/controls/styled_label.cc File ui/views/controls/styled_label.cc (right): https://codereview.chromium.org/17756003/diff/1/ui/views/controls/styled_label.cc#newcode80 ui/views/controls/styled_label.cc:80: result.color = SkColorSetRGB(0, 51, 153); On 2013/06/26 17:06:38, fdoray ...
7 years, 5 months ago (2013-06-27 13:34:32 UTC) #4
Peter Kasting
On 2013/06/27 13:34:32, Roger Tawa wrote: > Might want to ask Ben what his plans ...
7 years, 5 months ago (2013-06-27 17:52:18 UTC) #5
Ben Goodger (Google)
On 2013/06/27 17:52:18, Peter Kasting wrote: > On 2013/06/27 13:34:32, Roger Tawa wrote: > > ...
7 years, 5 months ago (2013-06-27 18:09:09 UTC) #6
fdoray
This new version fixes bug 244630. I realized that it could be useful for the ...
7 years, 5 months ago (2013-06-28 18:38:32 UTC) #7
fdoray
Style fix
7 years, 5 months ago (2013-07-02 13:35:12 UTC) #8
bcwhite
lgtm https://codereview.chromium.org/17756003/diff/17001/ui/views/controls/styled_label_unittest.cc File ui/views/controls/styled_label_unittest.cc (right): https://codereview.chromium.org/17756003/diff/17001/ui/views/controls/styled_label_unittest.cc#newcode16 ui/views/controls/styled_label_unittest.cc:16: const SkColor kBlack = SkColorSetRGB(0, 0, 0); The ...
7 years, 5 months ago (2013-07-02 14:22:13 UTC) #9
noms
lgtm
7 years, 5 months ago (2013-07-02 14:24:28 UTC) #10
fdoray
+achuith@chromium.org owner for echo_dialog_view.cc +estade@chromium.org owner for autofill_dialog_views.cc
7 years, 5 months ago (2013-07-02 14:36:46 UTC) #11
Roger Tawa OOO till Jul 10th
lgtm https://codereview.chromium.org/17756003/diff/1/chrome/browser/chromeos/ui/echo_dialog_view.cc File chrome/browser/chromeos/ui/echo_dialog_view.cc (right): https://codereview.chromium.org/17756003/diff/1/chrome/browser/chromeos/ui/echo_dialog_view.cc#newcode62 chrome/browser/chromeos/ui/echo_dialog_view.cc:62: views::StyledLabel::RangeStyleInfo::CreateForLink(); On 2013/06/26 17:06:38, fdoray wrote: > On ...
7 years, 5 months ago (2013-07-02 14:45:28 UTC) #12
fdoray
https://codereview.chromium.org/17756003/diff/17001/ui/views/controls/styled_label_unittest.cc File ui/views/controls/styled_label_unittest.cc (right): https://codereview.chromium.org/17756003/diff/17001/ui/views/controls/styled_label_unittest.cc#newcode16 ui/views/controls/styled_label_unittest.cc:16: const SkColor kBlack = SkColorSetRGB(0, 0, 0); On 2013/07/02 ...
7 years, 5 months ago (2013-07-02 16:49:21 UTC) #13
achuithb
lgtm for chromeos/ui
7 years, 5 months ago (2013-07-02 17:26:53 UTC) #14
Evan Stade
https://codereview.chromium.org/17756003/diff/26001/ui/views/controls/styled_label.h File ui/views/controls/styled_label.h (right): https://codereview.chromium.org/17756003/diff/26001/ui/views/controls/styled_label.h#newcode71 ui/views/controls/styled_label.h:71: void SetAutoColorReadabilityEnabled(bool enabled); is this used somewhere?
7 years, 5 months ago (2013-07-08 18:14:04 UTC) #15
fdoray
+sky@chromium.org
7 years, 5 months ago (2013-07-08 18:14:59 UTC) #16
sky
You have Ben as a reviewer on this one. Do you really need both of ...
7 years, 5 months ago (2013-07-08 20:41:47 UTC) #17
fdoray
On 2013/07/08 20:41:47, sky wrote: > You have Ben as a reviewer on this one. ...
7 years, 5 months ago (2013-07-09 12:36:09 UTC) #18
Ben Goodger (Google)
https://codereview.chromium.org/17756003/diff/26001/ui/views/controls/styled_label.h File ui/views/controls/styled_label.h (right): https://codereview.chromium.org/17756003/diff/26001/ui/views/controls/styled_label.h#newcode75 ui/views/controls/styled_label.h:75: void SetBackgroundColor(SkColor color); This name implies the background will ...
7 years, 5 months ago (2013-07-09 17:36:14 UTC) #19
fdoray
I answered the comments from Ben and Evan. https://codereview.chromium.org/17756003/diff/26001/ui/views/controls/styled_label.h File ui/views/controls/styled_label.h (right): https://codereview.chromium.org/17756003/diff/26001/ui/views/controls/styled_label.h#newcode71 ui/views/controls/styled_label.h:71: void ...
7 years, 5 months ago (2013-07-09 18:13:46 UTC) #20
Evan Stade
https://codereview.chromium.org/17756003/diff/26001/ui/views/controls/styled_label.h File ui/views/controls/styled_label.h (right): https://codereview.chromium.org/17756003/diff/26001/ui/views/controls/styled_label.h#newcode71 ui/views/controls/styled_label.h:71: void SetAutoColorReadabilityEnabled(bool enabled); On 2013/07/09 18:13:47, fdoray wrote: > ...
7 years, 5 months ago (2013-07-09 18:35:18 UTC) #21
Ben Goodger (Google)
SetTextContrastColor? -Ben On Tue, Jul 9, 2013 at 11:13 AM, <fdoray@chromium.org> wrote: > I answered ...
7 years, 5 months ago (2013-07-09 19:34:58 UTC) #22
Peter Kasting
On 2013/07/09 19:34:58, Ben Goodger (Google) wrote: > SetTextContrastColor? I don't like this because it ...
7 years, 5 months ago (2013-07-09 19:40:41 UTC) #23
fdoray
On 2013/07/09 19:40:41, Peter Kasting wrote: > On 2013/07/09 19:34:58, Ben Goodger (Google) wrote: > ...
7 years, 5 months ago (2013-07-09 20:04:40 UTC) #24
fdoray
I removed SetAutoColorReadabilityEnabled as requested by estade@. https://codereview.chromium.org/17756003/diff/26001/ui/views/controls/styled_label.h File ui/views/controls/styled_label.h (right): https://codereview.chromium.org/17756003/diff/26001/ui/views/controls/styled_label.h#newcode71 ui/views/controls/styled_label.h:71: void SetAutoColorReadabilityEnabled(bool ...
7 years, 5 months ago (2013-07-09 20:54:28 UTC) #25
Peter Kasting
On 2013/07/09 20:04:40, fdoray wrote: > On 2013/07/09 19:40:41, Peter Kasting wrote: > > On ...
7 years, 5 months ago (2013-07-09 20:58:00 UTC) #26
fdoray
On 2013/07/09 20:58:00, Peter Kasting wrote: > On 2013/07/09 20:04:40, fdoray wrote: > > On ...
7 years, 5 months ago (2013-07-10 15:51:08 UTC) #27
Evan Stade
I agree with Ben that it's very confusing. How about SetHasBackgroundColor?
7 years, 5 months ago (2013-07-10 23:50:13 UTC) #28
Peter Kasting
On 2013/07/10 23:50:13, Evan Stade wrote: > I agree with Ben that it's very confusing. ...
7 years, 5 months ago (2013-07-10 23:53:57 UTC) #29
Evan Stade
On 2013/07/10 23:53:57, Peter Kasting wrote: > On 2013/07/10 23:50:13, Evan Stade wrote: > > ...
7 years, 5 months ago (2013-07-11 00:08:41 UTC) #30
fdoray
On 2013/07/11 00:08:41, Evan Stade wrote: > On 2013/07/10 23:53:57, Peter Kasting wrote: > > ...
7 years, 5 months ago (2013-07-11 13:25:04 UTC) #31
Evan Stade
On 2013/07/11 13:25:04, fdoray wrote: > On 2013/07/11 00:08:41, Evan Stade wrote: > > On ...
7 years, 5 months ago (2013-07-11 16:26:23 UTC) #32
Ben Goodger (Google)
+1 On Thu, Jul 11, 2013 at 9:26 AM, <estade@chromium.org> wrote: > On 2013/07/11 13:25:04, ...
7 years, 5 months ago (2013-07-11 16:44:22 UTC) #33
fdoray
I changed the method name to SetDisplayedOnBackgroundColor. The CL can be reviewed again. On 2013/07/11 ...
7 years, 5 months ago (2013-07-11 17:26:54 UTC) #34
Evan Stade
https://codereview.chromium.org/17756003/diff/57001/ui/views/controls/link.cc File ui/views/controls/link.cc (right): https://codereview.chromium.org/17756003/diff/57001/ui/views/controls/link.cc#newcode39 ui/views/controls/link.cc:39: return color_utils::GetSysSkColor(COLOR_HOTLIGHT); I dont' know if this is an ...
7 years, 5 months ago (2013-07-11 17:54:38 UTC) #35
fdoray
I uploaded the change suggested by Evan. https://codereview.chromium.org/17756003/diff/57001/ui/views/controls/link.cc File ui/views/controls/link.cc (right): https://codereview.chromium.org/17756003/diff/57001/ui/views/controls/link.cc#newcode39 ui/views/controls/link.cc:39: return color_utils::GetSysSkColor(COLOR_HOTLIGHT); ...
7 years, 5 months ago (2013-07-11 19:56:25 UTC) #36
Evan Stade
lgtm
7 years, 5 months ago (2013-07-11 20:25:31 UTC) #37
Peter Kasting
It's actually wrong to use a static variable to store the result of GetSys[Sk]Color() result. ...
7 years, 5 months ago (2013-07-11 20:28:09 UTC) #38
fdoray
I've removed the static variables to store colors. Is it better this way?
7 years, 5 months ago (2013-07-11 20:37:51 UTC) #39
Peter Kasting
LGTM
7 years, 5 months ago (2013-07-11 20:40:25 UTC) #40
Ben Goodger (Google)
lgtm
7 years, 5 months ago (2013-07-11 23:08:01 UTC) #41
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/fdoray@chromium.org/17756003/85001
7 years, 5 months ago (2013-07-12 18:00:01 UTC) #42
commit-bot: I haz the power
7 years, 5 months ago (2013-07-12 23:11:41 UTC) #43
Message was sent while issue was closed.
Change committed as 211471

Powered by Google App Engine
This is Rietveld 408576698