|
|
Chromium Code Reviews|
Created:
4 years, 2 months ago by Evan Stade Modified:
4 years, 2 months ago CC:
chromium-reviews, tfarina, James Su, shuchen+watch_chromium.org, yusukes+watch_chromium.org, nona+watch_chromium.org Target Ref:
refs/pending/heads/master Project:
chromium Visibility:
Public. |
DescriptionHarmony - Don't paint focus ring on textfield unless border requests it.
This fixes both the omnibox and the find in page textfield.
BUG=653361
Committed: https://crrev.com/e0077f601a2907c931e932d68ae2149b25e9ff3c
Cr-Commit-Position: refs/heads/master@{#424239}
Patch Set 1 #
Total comments: 4
Patch Set 2 : override setborder #
Total comments: 3
Patch Set 3 : uninstall #
Messages
Total messages: 29 (15 generated)
Description was changed from ========== Don't paint focus ring on unless border requests it. BUG=653361 ========== to ========== Harmony - Don't paint focus ring on unless border requests it. This fixes both the omnibox and the find in page textfield. BUG=653361 ==========
estade@chromium.org changed reviewers: + pkasting@chromium.org, sky@chromium.org
https://codereview.chromium.org/2395033002/diff/1/chrome/browser/ui/views/omn... File chrome/browser/ui/views/omnibox/omnibox_view_views.cc (left): https://codereview.chromium.org/2395033002/diff/1/chrome/browser/ui/views/omn... chrome/browser/ui/views/omnibox/omnibox_view_views.cc:132: SetBorder(views::Border::NullBorder()); +pkasting for this change this didn't have any effect as far as I could tell because location_bar_view_ also sets a border which overrides this.
LGTM for c/b/ui/ https://codereview.chromium.org/2395033002/diff/1/chrome/browser/ui/views/omn... File chrome/browser/ui/views/omnibox/omnibox_view_views.cc (left): https://codereview.chromium.org/2395033002/diff/1/chrome/browser/ui/views/omn... chrome/browser/ui/views/omnibox/omnibox_view_views.cc:132: SetBorder(views::Border::NullBorder()); On 2016/10/06 02:05:25, Evan Stade wrote: > +pkasting for this change > > this didn't have any effect as far as I could tell because location_bar_view_ > also sets a border which overrides this. I agree.
Description was changed from ========== Harmony - Don't paint focus ring on unless border requests it. This fixes both the omnibox and the find in page textfield. BUG=653361 ========== to ========== Harmony - Don't paint focus ring on textfield unless border requests it. This fixes both the omnibox and the find in page textfield. BUG=653361 ==========
https://codereview.chromium.org/2395033002/diff/1/ui/views/border.h File ui/views/border.h (right): https://codereview.chromium.org/2395033002/diff/1/ui/views/border.h#newcode84 ui/views/border.h:84: virtual bool ShouldAddFocusRing() const; Adding functions specific to certain controls doesn't scale well. Can this be a property of TextField? By that I mean can TextField get a specific setter as to whether the ring should be installed?
https://codereview.chromium.org/2395033002/diff/1/ui/views/border.h File ui/views/border.h (right): https://codereview.chromium.org/2395033002/diff/1/ui/views/border.h#newcode84 ui/views/border.h:84: virtual bool ShouldAddFocusRing() const; On 2016/10/06 19:34:42, sky wrote: > Adding functions specific to certain controls doesn't scale well. Can this be a > property of TextField? By that I mean can TextField get a specific setter as to > whether the ring should be installed? It could, but I strayed from that approach because it would be too easy to get wrong. Not only do we have to hunt down every present textfield with a custom border, but also in the future people have to realize the need for both calls. Another option would be to add OnFocus and OnBlur to Border, then have FocusableBorder be the one to install the focus ring. This would also allow us to remove some SchedulePaint calls which are only there to refresh the border after focus or blur.
On Thu, Oct 6, 2016 at 1:14 PM, <estade@chromium.org> wrote: > > https://codereview.chromium.org/2395033002/diff/1/ui/views/border.h > File ui/views/border.h (right): > > https://codereview.chromium.org/2395033002/diff/1/ui/views/border.h#newcode84 > ui/views/border.h:84: virtual bool ShouldAddFocusRing() const; > On 2016/10/06 19:34:42, sky wrote: >> Adding functions specific to certain controls doesn't scale well. Can > this be a >> property of TextField? By that I mean can TextField get a specific > setter as to >> whether the ring should be installed? > > It could, but I strayed from that approach because it would be too easy > to get wrong. Not only do we have to hunt down every present textfield > with a custom border, but also in the future people have to realize the > need for both calls. What about assuming if a custom border is set the focus ring isn't installed? > Another option would be to add OnFocus and OnBlur to Border, then have > FocusableBorder be the one to install the focus ring. This would also > allow us to remove some SchedulePaint calls which are only there to > refresh the border after focus or blur. -- 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.
On 2016/10/06 22:19:51, sky wrote: > On Thu, Oct 6, 2016 at 1:14 PM, <mailto:estade@chromium.org> wrote: > > > > https://codereview.chromium.org/2395033002/diff/1/ui/views/border.h > > File ui/views/border.h (right): > > > > https://codereview.chromium.org/2395033002/diff/1/ui/views/border.h#newcode84 > > ui/views/border.h:84: virtual bool ShouldAddFocusRing() const; > > On 2016/10/06 19:34:42, sky wrote: > >> Adding functions specific to certain controls doesn't scale well. Can > > this be a > >> property of TextField? By that I mean can TextField get a specific > > setter as to > >> whether the ring should be installed? > > > > It could, but I strayed from that approach because it would be too easy > > to get wrong. Not only do we have to hunt down every present textfield > > with a custom border, but also in the future people have to realize the > > need for both calls. > > What about assuming if a custom border is set the focus ring isn't installed? You mean overriding SetBorder? I thought of that, but if you SetBorder with a FocusableBorder it should reinstate the focus ring. That said, I don't see anywhere that actually does that, so I guess it will work and we don't need to worry overly much about hypotheticals. Also, I thought I remembered someone disliking that SetBorder was virtual and overriding it would make it harder to fix that. Anyway, updated. > > > Another option would be to add OnFocus and OnBlur to Border, then have > > FocusableBorder be the one to install the focus ring. This would also > > allow us to remove some SchedulePaint calls which are only there to > > refresh the border after focus or blur. > > -- > 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 mailto:chromium-reviews+unsubscribe@chromium.org. >
The CQ bit was checked by estade@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
https://codereview.chromium.org/2395033002/diff/20001/ui/views/controls/textf... File ui/views/controls/textfield/textfield.cc (right): https://codereview.chromium.org/2395033002/diff/20001/ui/views/controls/textf... ui/views/controls/textfield/textfield.cc:564: View::SetBorder(std::move(b)); Should you also call FocusRing::Uninstall?
https://codereview.chromium.org/2395033002/diff/20001/ui/views/controls/textf... File ui/views/controls/textfield/textfield.cc (right): https://codereview.chromium.org/2395033002/diff/20001/ui/views/controls/textf... ui/views/controls/textfield/textfield.cc:564: View::SetBorder(std::move(b)); On 2016/10/07 03:10:48, sky wrote: > Should you also call FocusRing::Uninstall? I didn't add that because it's dead code, but if you prefer it be here, I can add it (done in latest patchset).
The CQ bit was checked by estade@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
https://codereview.chromium.org/2395033002/diff/20001/ui/views/controls/textf... File ui/views/controls/textfield/textfield.cc (right): https://codereview.chromium.org/2395033002/diff/20001/ui/views/controls/textf... ui/views/controls/textfield/textfield.cc:564: View::SetBorder(std::move(b)); On 2016/10/10 17:08:28, Evan Stade wrote: > On 2016/10/07 03:10:48, sky wrote: > > Should you also call FocusRing::Uninstall? > > I didn't add that because it's dead code, but if you prefer it be here, I can > add it (done in latest patchset). Can you clarify what you mean by dead code? If there was a focus ring installed and someone called SetBorder(nullptr) wouldn't that mean the focus ring was never uninstalled? Maybe I'm missing something?
On 2016/10/10 19:55:19, sky wrote: > https://codereview.chromium.org/2395033002/diff/20001/ui/views/controls/textf... > File ui/views/controls/textfield/textfield.cc (right): > > https://codereview.chromium.org/2395033002/diff/20001/ui/views/controls/textf... > ui/views/controls/textfield/textfield.cc:564: View::SetBorder(std::move(b)); > On 2016/10/10 17:08:28, Evan Stade wrote: > > On 2016/10/07 03:10:48, sky wrote: > > > Should you also call FocusRing::Uninstall? > > > > I didn't add that because it's dead code, but if you prefer it be here, I can > > add it (done in latest patchset). > > Can you clarify what you mean by dead code? If there was a focus ring installed > and someone called SetBorder(nullptr) wouldn't that mean the focus ring was > never uninstalled? yes. I just don't think that currently ever happens (calling SetBorder after focus).
LGTM
The CQ bit was checked by estade@chromium.org
The patchset sent to the CQ was uploaded after l-g-t-m from pkasting@chromium.org Link to the patchset: https://codereview.chromium.org/2395033002/#ps40001 (title: "uninstall")
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Message was sent while issue was closed.
Description was changed from ========== Harmony - Don't paint focus ring on textfield unless border requests it. This fixes both the omnibox and the find in page textfield. BUG=653361 ========== to ========== Harmony - Don't paint focus ring on textfield unless border requests it. This fixes both the omnibox and the find in page textfield. BUG=653361 ==========
Message was sent while issue was closed.
Committed patchset #3 (id:40001)
Message was sent while issue was closed.
Description was changed from ========== Harmony - Don't paint focus ring on textfield unless border requests it. This fixes both the omnibox and the find in page textfield. BUG=653361 ========== to ========== Harmony - Don't paint focus ring on textfield unless border requests it. This fixes both the omnibox and the find in page textfield. BUG=653361 Committed: https://crrev.com/e0077f601a2907c931e932d68ae2149b25e9ff3c Cr-Commit-Position: refs/heads/master@{#424239} ==========
Message was sent while issue was closed.
Patchset 3 (id:??) landed as https://crrev.com/e0077f601a2907c931e932d68ae2149b25e9ff3c Cr-Commit-Position: refs/heads/master@{#424239} |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
