|
|
Created:
4 years, 2 months ago by Marco Koo Modified:
3 years, 9 months ago Reviewers:
Peter Kasting CC:
chromium-reviews, simonhong, zino Target Ref:
refs/pending/heads/master Project:
chromium Visibility:
Public. |
DescriptionFix a bug that viewed Omnibox hint when hint loses focus.
In the current implementation, If we input search engine
such as 'google.com' in omnibox, 'Press tab to search' hint
displays. Then the hint does not disappear in spite of
the loss of omnibox focus. So, I modified OnFocus() and
OnBlur() in omnibox_view_views.cc that focus changes affect
the visibility of any keyword hint.
BUG=649938
Review-Url: https://codereview.chromium.org/2373773002
Cr-Commit-Position: refs/heads/master@{#455429}
Committed: https://chromium.googlesource.com/chromium/src/+/8af82bd5840c4c51bb1e31055446808abda90e7b
Patch Set 1 : Add my name #Patch Set 2 : Fixed a bug that viewed Omnibox hint when hint loses focus #Patch Set 3 : Fixed a bug that viewed Omnibox hint when hint loses focus #Patch Set 4 : Revise code indentation and add comment #
Total comments: 7
Patch Set 5 : Fixed a bug that viewed Omnibox hint when hint loses focus #
Total comments: 4
Patch Set 6 : Fixed a bug that viewed Omnibox hint when hint loses focus #Patch Set 7 : Fixed a bug that viewed Omnibox hint when hint loses focus #Patch Set 8 : Fixed a bug that viewed Omnibox hint when hint loses focus #
Total comments: 2
Patch Set 9 : Fixed a bug that viewed Omnibox hint when hint loses focus. #
Total comments: 1
Patch Set 10 : Fixed a bug that viewed Omnibox hint when hint loses focus. #Patch Set 11 : Fixed a bug that viewed Omnibox hint when hint loses focus. #
Messages
Total messages: 58 (36 generated)
Description was changed from ========== Add my name ========== to ========== Add my name & Fixed a bug that sometimes viewed Omni hint box loses focus ==========
kei98301@gmail.com changed reviewers: + pkasting@chromium.org, simonhong@chromium.org, zino@chromium.org
Description was changed from ========== Add my name & Fixed a bug that sometimes viewed Omni hint box loses focus ========== to ========== Fixed a bug that sometimes viewed Omni hint box loses focus ==========
PTAL
jinho.bang@samsung.com changed reviewers: + jinho.bang@samsung.com - zino@chromium.org
Description was changed from ========== Fixed a bug that sometimes viewed Omni hint box loses focus ========== to ========== Fixed a bug that viewed Omnibox hint when hint loses focus ==========
kei98301@gmail.com changed reviewers: + zino@chromium.org - jinho.bang@samsung.com
kei98301@gmail.com changed reviewers: + jinho.bang@samsung.com - zino@chromium.org
Description was changed from ========== Fixed a bug that viewed Omnibox hint when hint loses focus ========== to ========== BUG=649938 ==========
Thanks for contributing to Chromium. A couple process notes: * Prefer to work on bugs that have been confirmed. I waffled on whether to WontFix this unconfirmed bug before deciding that fixing it was probably reasonable. But if I had closed the bug, your work would have been wasted. We have a lot of confirmed polish-level bugs out there we know we want tackled :) * Avoid adding multiple reviewers unless you need them. If you do need them, say exactly what you want each person to review. * Please review the Google/Chromium style guides, in particular on things like whitespace handling. If you're not confident in your style guide knowledge, run git cl format before uploading. (Note to self: Verify CLA status) https://codereview.chromium.org/2373773002/diff/60001/chrome/browser/ui/views... File chrome/browser/ui/views/location_bar/location_bar_view.cc (right): https://codereview.chromium.org/2373773002/diff/60001/chrome/browser/ui/views... chrome/browser/ui/views/location_bar/location_bar_view.cc:545: keyword_hint_view_->SetVisible(false); Might be clearer to set the visibility here based on the conditions currently below, then just check visible() down there, as we do for most of these other views. This could then be factored out to a helper function called UpdatedKeywordHintVisibility(). We could call that here, and the focus/blur handlers could call that + schedule a paint, and not need to relayout. (We know not doing a relayout is safe because this view is the innermost thing on the trailing edge, and autocollapses, so no other view positions or sizes are based on its visibility.) https://codereview.chromium.org/2373773002/diff/60001/chrome/browser/ui/views... chrome/browser/ui/views/location_bar/location_bar_view.cc:640: if (HasFocus() && !keyword.empty() && omnibox_view_->model()->is_keyword_hint() && 80 columns https://codereview.chromium.org/2373773002/diff/60001/chrome/browser/ui/views... chrome/browser/ui/views/location_bar/location_bar_view.cc:641: !omnibox_view_->IsImeComposing()) { Spaces, not tabs https://codereview.chromium.org/2373773002/diff/60001/chrome/browser/ui/views... chrome/browser/ui/views/location_bar/location_bar_view.cc:645: if (keyword_hint_view_->keyword() != keyword) Do not add trailing space https://codereview.chromium.org/2373773002/diff/60001/chrome/browser/ui/views... chrome/browser/ui/views/location_bar/location_bar_view.cc:648: Do not add second blank line https://codereview.chromium.org/2373773002/diff/60001/chrome/browser/ui/views... File chrome/browser/ui/views/omnibox/omnibox_view_views.cc (right): https://codereview.chromium.org/2373773002/diff/60001/chrome/browser/ui/views... chrome/browser/ui/views/omnibox/omnibox_view_views.cc:131: weak_ptr_factory_(this){ Do not remove space https://codereview.chromium.org/2373773002/diff/60001/chrome/browser/ui/views... chrome/browser/ui/views/omnibox/omnibox_view_views.cc:772: location_bar_view_->Layout(); Why make these calls here and not in the LocationBarView focus/blur handlers?
kei98301@gmail.com changed reviewers: - jinho.bang@samsung.com, simonhong@chromium.org
Thank you for your comment. I wonder what you think about this issue will be whether to be confirmed. As you commented, I added UpdatedKeywordHintVisibility() and made this call in the LocationBarView focus/blur handlers. but, it doesn't work. I think this call will be made in OmniboxViewViews. I wonder how you think. <location_bar_view.cc> modified : 644: if conditional 1231: OnFocus() add : 539: void LocationBarView::UpdatedKeywordHintVisibility() 1236: void LocationBarView::OnBlur() delete : 549: keyword_hint_view_->SetVisible(false); <location_bar_view.h> add : 341: void UpdatedKeywordHintVisibility(); 375: void OnBlur() override; <omnibox_view_view_.cc> Returned to format state.
On 2016/10/02 15:10:48, min wrote: > Thank you for your comment. > I wonder what you think about this issue will be whether to be confirmed. > As you commented, I added UpdatedKeywordHintVisibility() > and made this call in the LocationBarView focus/blur handlers. but, it doesn't > work. > I think this call will be made in OmniboxViewViews. > I wonder how you think. Make the changes I suggest below; if this still doesn't work, it's worth understanding why. Perhaps the issue is that if the omnibox has focus the location bar does not? https://codereview.chromium.org/2373773002/diff/80001/chrome/browser/ui/views... File chrome/browser/ui/views/location_bar/location_bar_view.cc (right): https://codereview.chromium.org/2373773002/diff/80001/chrome/browser/ui/views... chrome/browser/ui/views/location_bar/location_bar_view.cc:539: void LocationBarView::UpdatedKeywordHintVisibility() { Nit: Update, not Updated https://codereview.chromium.org/2373773002/diff/80001/chrome/browser/ui/views... chrome/browser/ui/views/location_bar/location_bar_view.cc:549: // keyword_hint_view_->SetVisible(false); This needs to call UpdateKeywordHintVisibility(). https://codereview.chromium.org/2373773002/diff/80001/chrome/browser/ui/views... chrome/browser/ui/views/location_bar/location_bar_view.cc:646: !omnibox_view_->IsImeComposing()) { You need all this logic to go in UpdateKeywordHintVisibility(), not just the focus check. https://codereview.chromium.org/2373773002/diff/80001/chrome/browser/ui/views... File chrome/browser/ui/views/location_bar/location_bar_view.h (right): https://codereview.chromium.org/2373773002/diff/80001/chrome/browser/ui/views... chrome/browser/ui/views/location_bar/location_bar_view.h:341: void UpdatedKeywordHintVisibility(); Add comment about what this does.
What's the status of this CL? Note also https://codereview.chromium.org/2381373003/ and my comments there.
Patchset #6 (id:100001) has been deleted
On 2016/10/02 19:01:37, Peter Kasting wrote: > On 2016/10/02 15:10:48, min wrote: > > Thank you for your comment. > > I wonder what you think about this issue will be whether to be confirmed. > > As you commented, I added UpdatedKeywordHintVisibility() > > and made this call in the LocationBarView focus/blur handlers. but, it doesn't > > work. > > I think this call will be made in OmniboxViewViews. > > I wonder how you think. > > Make the changes I suggest below; if this still doesn't work, it's worth > understanding why. Perhaps the issue is that if the omnibox has focus the > location bar does not? > > https://codereview.chromium.org/2373773002/diff/80001/chrome/browser/ui/views... > File chrome/browser/ui/views/location_bar/location_bar_view.cc (right): > > https://codereview.chromium.org/2373773002/diff/80001/chrome/browser/ui/views... > chrome/browser/ui/views/location_bar/location_bar_view.cc:539: void > LocationBarView::UpdatedKeywordHintVisibility() { > Nit: Update, not Updated > > https://codereview.chromium.org/2373773002/diff/80001/chrome/browser/ui/views... > chrome/browser/ui/views/location_bar/location_bar_view.cc:549: // > keyword_hint_view_->SetVisible(false); > This needs to call UpdateKeywordHintVisibility(). > > https://codereview.chromium.org/2373773002/diff/80001/chrome/browser/ui/views... > chrome/browser/ui/views/location_bar/location_bar_view.cc:646: > !omnibox_view_->IsImeComposing()) { > You need all this logic to go in UpdateKeywordHintVisibility(), not just the > focus check. > > https://codereview.chromium.org/2373773002/diff/80001/chrome/browser/ui/views... > File chrome/browser/ui/views/location_bar/location_bar_view.h (right): > > https://codereview.chromium.org/2373773002/diff/80001/chrome/browser/ui/views... > chrome/browser/ui/views/location_bar/location_bar_view.h:341: void > UpdatedKeywordHintVisibility(); > Add comment about what this does. I modified it according to your advice, but it doesn't work. I still think we have to fix the "chrome/browser/ui/views/omnibox/omnibox_view_views.cc". I wonder what do you think. <chrome/browser/ui/views/location_bar/location_bar_view.cc> 459: modified UpdatedKeywordHintVisibility to UpdateKeywordHintVisibility(); 469: added UpdateKeywordHintVisibility(); 555: turned if-conditional back <chrome/browser/ui/views/location_bar/location_bar_view.h> 333: added comment.
On 2017/02/12 06:19:55, min wrote: > I modified it according to your advice, but it doesn't work. How so?
Patchset #7 (id:140001) has been deleted
On 2017/02/12 07:36:39, Peter Kasting wrote: > On 2017/02/12 06:19:55, min wrote: > > I modified it according to your advice, but it doesn't work. > > How so? It works when done in this way. I think it would be better to fix the defect in this way. I wonder what do you think.
Just setting the visibility of the view seems potentially wrong, since the rest of layout is still going to assume it's there. We want to actually remove the decoration in the case where it isn't visible, I think. Otherwise, it could leave an empty hole where something else should have expanded to fill that space.
The CQ bit was checked by kei98301@gmail.com
The CQ bit was unchecked by kei98301@gmail.com
The CQ bit was checked by kei98301@gmail.com
The CQ bit was unchecked by kei98301@gmail.com
The CQ bit was unchecked by kei98301@gmail.com
On 2017/02/14 11:13:08, Peter Kasting wrote: > Just setting the visibility of the view seems potentially wrong, since the rest > of layout is still going to assume it's there. We want to actually remove the > decoration in the case where it isn't visible, I think. Otherwise, it could > leave an empty hole where something else should have expanded to fill that > space. According to your suggestion, When re-focusing omnibox, Layout have to create keyword hint. right? I mean If you follow your suggestion, it seems ambiguous when re-focused.
On 2017/02/15 04:31:23, min wrote: > On 2017/02/14 11:13:08, Peter Kasting wrote: > > Just setting the visibility of the view seems potentially wrong, since the > rest > > of layout is still going to assume it's there. We want to actually remove the > > decoration in the case where it isn't visible, I think. Otherwise, it could > > leave an empty hole where something else should have expanded to fill that > > space. > > According to your suggestion, When re-focusing omnibox, Layout have to create > keyword hint. right? Yes, we would need to re-layout when gaining or losing focus.
Patchset #8 (id:180001) has been deleted
Patchset #8 (id:200001) has been deleted
Could you check patch set 8? I call layout when gaining or losing focus.
LGTM https://codereview.chromium.org/2373773002/diff/220001/chrome/browser/ui/view... File chrome/browser/ui/views/omnibox/omnibox_view_views.cc (right): https://codereview.chromium.org/2373773002/diff/220001/chrome/browser/ui/view... chrome/browser/ui/views/omnibox/omnibox_view_views.cc:809: // Hint is being visible. If losing focus, Keyword hint is invisible. Nit: I would say "Focus changes can affect the visibility of any keyword hint." I'd use the same comment above as well. https://codereview.chromium.org/2373773002/diff/220001/chrome/browser/ui/view... chrome/browser/ui/views/omnibox/omnibox_view_views.cc:811: location_bar_view_->Layout(); This block should go above the SchedulePaint() call, so layout happens before painting could potentially happen.
min@, Could you update this issue? Once you fix the owner's comments, you can land this patch :) Please try it! Thanks.
On 2017/02/25 05:23:09, Peter Kasting wrote: > LGTM > > https://codereview.chromium.org/2373773002/diff/220001/chrome/browser/ui/view... > File chrome/browser/ui/views/omnibox/omnibox_view_views.cc (right): > > https://codereview.chromium.org/2373773002/diff/220001/chrome/browser/ui/view... > chrome/browser/ui/views/omnibox/omnibox_view_views.cc:809: // Hint is being > visible. If losing focus, Keyword hint is invisible. > Nit: I would say "Focus changes can affect the visibility of any keyword hint." > > I'd use the same comment above as well. > > https://codereview.chromium.org/2373773002/diff/220001/chrome/browser/ui/view... > chrome/browser/ui/views/omnibox/omnibox_view_views.cc:811: > location_bar_view_->Layout(); > This block should go above the SchedulePaint() call, so layout happens before > painting could potentially happen. Could you check patch set 9? thank you!
LGTM There's no need to get a re-review after LGTM if you've addressed all feedback; you can just check the commit checkbox. That said, in this case, you didn't actually quite implement all my feedback, so restating what didn't get addressed below. (And _that_ said, since my feedback was prefaced with "Nit:", that's permission to ignore it if you disagree, as long as you state a reason.) https://codereview.chromium.org/2373773002/diff/240001/chrome/browser/ui/view... File chrome/browser/ui/views/omnibox/omnibox_view_views.cc (right): https://codereview.chromium.org/2373773002/diff/240001/chrome/browser/ui/view... chrome/browser/ui/views/omnibox/omnibox_view_views.cc:778: // Re-focusing, keyword hint is visible. Nit: Use the same comment here as you changed to below.
The CQ bit was checked by kei98301@gmail.com
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/2373773002/#ps260001 (title: "Fixed a bug that viewed Omnibox hint when hint loses focus.")
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
Try jobs failed on following builders: chromium_presubmit on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presub...)
The CQ bit was checked by kei98301@gmail.com
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/2373773002/#ps280001 (title: "Fixed a bug that viewed Omnibox hint when hint loses focus.")
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
Try jobs failed on following builders: chromium_presubmit on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presub...)
Description was changed from ========== BUG=649938 ========== to ========== Fix a bug that viewed Omnibox hint when hint loses focus. In the current implementation, If we input search engine such as 'google.com' in omnibox, 'Press tab to search' hint displays. Then the hint does not disappear in spite of the loss of omnibox focus. So, I modified OnFocus() and OnBlur() in omnibox_view_views that focus changes affect the visibility of any keyword hint. BUG=649938 ==========
Description was changed from ========== Fix a bug that viewed Omnibox hint when hint loses focus. In the current implementation, If we input search engine such as 'google.com' in omnibox, 'Press tab to search' hint displays. Then the hint does not disappear in spite of the loss of omnibox focus. So, I modified OnFocus() and OnBlur() in omnibox_view_views that focus changes affect the visibility of any keyword hint. BUG=649938 ========== to ========== Fix a bug that viewed Omnibox hint when hint loses focus. In the current implementation, If we input search engine such as 'google.com' in omnibox, 'Press tab to search' hint displays. Then the hint does not disappear in spite of the loss of omnibox focus. So, I modified OnFocus() and OnBlur() in omnibox_view_views that focus changes affect the visibility of any keyword hint. BUG=649938 ==========
Description was changed from ========== Fix a bug that viewed Omnibox hint when hint loses focus. In the current implementation, If we input search engine such as 'google.com' in omnibox, 'Press tab to search' hint displays. Then the hint does not disappear in spite of the loss of omnibox focus. So, I modified OnFocus() and OnBlur() in omnibox_view_views that focus changes affect the visibility of any keyword hint. BUG=649938 ========== to ========== Fix a bug that viewed Omnibox hint when hint loses focus. In the current implementation, If we input search engine such as 'google.com' in omnibox, 'Press tab to search' hint displays. Then the hint does not disappear in spite of the loss of omnibox focus. So, I modified OnFocus() and OnBlur() in omnibox_view_views that focus changes affect the visibility of any keyword hint. BUG=649938 ==========
Description was changed from ========== Fix a bug that viewed Omnibox hint when hint loses focus. In the current implementation, If we input search engine such as 'google.com' in omnibox, 'Press tab to search' hint displays. Then the hint does not disappear in spite of the loss of omnibox focus. So, I modified OnFocus() and OnBlur() in omnibox_view_views that focus changes affect the visibility of any keyword hint. BUG=649938 ========== to ========== Fix a bug that viewed Omnibox hint when hint loses focus. In the current implementation, If we input search engine such as 'google.com' in omnibox, 'Press tab to search' hint displays. Then the hint does not disappear in spite of the loss of omnibox focus. So, I modified OnFocus() and OnBlur() in omnibox_view_views.cc that focus changes affect the visibility of any keyword hint. BUG=649938 ==========
The CQ bit was checked by kei98301@gmail.com 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...
Description was changed from ========== Fix a bug that viewed Omnibox hint when hint loses focus. In the current implementation, If we input search engine such as 'google.com' in omnibox, 'Press tab to search' hint displays. Then the hint does not disappear in spite of the loss of omnibox focus. So, I modified OnFocus() and OnBlur() in omnibox_view_views.cc that focus changes affect the visibility of any keyword hint. BUG=649938 ========== to ========== Fix a bug that viewed Omnibox hint when hint loses focus. In the current implementation, If we input search engine such as 'google.com' in omnibox, 'Press tab to search' hint displays. Then the hint does not disappear in spite of the loss of omnibox focus. So, I modified OnFocus() and OnBlur() in omnibox_view_views.cc that focus changes affect the visibility of any keyword hint. BUG=649938 ==========
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
The CQ bit was checked by kei98301@gmail.com
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
CQ is committing da patch. Bot data: {"patchset_id": 280001, "attempt_start_ts": 1488970615513870, "parent_rev": "20a32db5f9d9b7db0484cb5cdfbcf2c5d5cf2eb3", "commit_rev": "8af82bd5840c4c51bb1e31055446808abda90e7b"}
Message was sent while issue was closed.
Description was changed from ========== Fix a bug that viewed Omnibox hint when hint loses focus. In the current implementation, If we input search engine such as 'google.com' in omnibox, 'Press tab to search' hint displays. Then the hint does not disappear in spite of the loss of omnibox focus. So, I modified OnFocus() and OnBlur() in omnibox_view_views.cc that focus changes affect the visibility of any keyword hint. BUG=649938 ========== to ========== Fix a bug that viewed Omnibox hint when hint loses focus. In the current implementation, If we input search engine such as 'google.com' in omnibox, 'Press tab to search' hint displays. Then the hint does not disappear in spite of the loss of omnibox focus. So, I modified OnFocus() and OnBlur() in omnibox_view_views.cc that focus changes affect the visibility of any keyword hint. BUG=649938 Review-Url: https://codereview.chromium.org/2373773002 Cr-Commit-Position: refs/heads/master@{#455429} Committed: https://chromium.googlesource.com/chromium/src/+/8af82bd5840c4c51bb1e31055446... ==========
Message was sent while issue was closed.
Committed patchset #11 (id:280001) as https://chromium.googlesource.com/chromium/src/+/8af82bd5840c4c51bb1e31055446... |