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

Issue 23536075: Fix multiple problems with omnibox text handling across focus changes. (Closed)

Created:
7 years, 3 months ago by Peter Kasting
Modified:
7 years, 3 months ago
CC:
chromium-reviews, tfarina, James Su
Visibility:
Public.

Description

Fix multiple problems with omnibox text handling across focus changes. (1) RenderText was drawing unfocused selections with the non-selection background color, but the selected text color, leading to white-on-white text. Fix by drawing unfocused selected text as unselected. (2) OmniboxViewViews was preserving selections across focus changes using SaveStateToTab(), leading to problems when something about the omnibox state changed after the omnibox was unfocused -- a later state restoration would restore a selection model that no longer lined up with the rest of the omnibox state (e.g. the current text). Fix by tracking selection across focus changes in the same way OmniboxViewWin does. (3) On tab changes, OnTabChanged() could be followed by an OnBlur()/OnFocus() call if changing from a tab where the omnibox was focused to one where it wasn't (or vice versa). This led to the selection state being stomped. Fixed by making Browser give BrowserWindow first crack at handling the tab change. This makes tabbing out of the omnibox, changing tabs away and back, and tabbing back in correctly restore the selection even when changing between tabs that disagree about whether the omnibox is focused. BUG=293258 TEST=Following steps in bug comment 0 does not result in invisible text R=msw@chromium.org, shess@chromium.org, sky@chromium.org Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=225074

Patch Set 1 #

Total comments: 12

Patch Set 2 : #

Total comments: 2

Patch Set 3 : #

Patch Set 4 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+200 lines, -119 lines) Patch
M chrome/browser/ui/browser.cc View 1 2 3 2 chunks +16 lines, -5 lines 0 comments Download
M chrome/browser/ui/browser_window.h View 1 2 1 chunk +8 lines, -0 lines 0 comments Download
M chrome/browser/ui/cocoa/browser_window_cocoa.h View 1 2 1 chunk +4 lines, -0 lines 0 comments Download
M chrome/browser/ui/cocoa/browser_window_cocoa.mm View 1 2 1 chunk +11 lines, -0 lines 0 comments Download
M chrome/browser/ui/gtk/browser_window_gtk.h View 1 2 2 chunks +4 lines, -4 lines 0 comments Download
M chrome/browser/ui/gtk/browser_window_gtk.cc View 1 2 2 chunks +29 lines, -30 lines 0 comments Download
M chrome/browser/ui/views/frame/browser_view.h View 1 2 2 chunks +4 lines, -4 lines 0 comments Download
M chrome/browser/ui/views/frame/browser_view.cc View 1 2 2 chunks +48 lines, -51 lines 0 comments Download
M chrome/browser/ui/views/omnibox/omnibox_view_views.h View 1 3 chunks +8 lines, -0 lines 0 comments Download
M chrome/browser/ui/views/omnibox/omnibox_view_views.cc View 1 2 11 chunks +63 lines, -24 lines 0 comments Download
M chrome/test/base/test_browser_window.h View 1 2 1 chunk +4 lines, -0 lines 0 comments Download
M ui/gfx/render_text.cc View 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 12 (0 generated)
Peter Kasting
Two notes: (1) RenderText::ApplyCompositionAndSelectionStyles() can be called by RenderTextWin::ItemizeLogicalText(). It's not immediately clear to me ...
7 years, 3 months ago (2013-09-20 00:47:57 UTC) #1
msw
LGTM with nits; thanks for the fixes. https://codereview.chromium.org/23536075/diff/1/chrome/browser/ui/views/omnibox/omnibox_view_views.cc File chrome/browser/ui/views/omnibox/omnibox_view_views.cc (right): https://codereview.chromium.org/23536075/diff/1/chrome/browser/ui/views/omnibox/omnibox_view_views.cc#newcode76 chrome/browser/ui/views/omnibox/omnibox_view_views.cc:76: const gfx::Range ...
7 years, 3 months ago (2013-09-20 01:52:38 UTC) #2
Peter Kasting
The comments about "tab out, change tabs and back, tab back in" inspired me to ...
7 years, 3 months ago (2013-09-21 00:36:46 UTC) #3
msw
It seems like those latest changes are tangential, can you land them separately? https://codereview.chromium.org/23536075/diff/25001/chrome/browser/ui/views/omnibox/omnibox_view_views.cc File ...
7 years, 3 months ago (2013-09-21 00:43:11 UTC) #4
Peter Kasting
On 2013/09/21 00:43:11, msw wrote: > It seems like those latest changes are tangential, can ...
7 years, 3 months ago (2013-09-21 00:46:41 UTC) #5
sky
LGTM
7 years, 3 months ago (2013-09-23 15:05:46 UTC) #6
Peter Kasting
New snap up. This calls BrowserWindow from Browser instead of the other way around, to ...
7 years, 3 months ago (2013-09-24 00:40:48 UTC) #7
Scott Hess - ex-Googler
On 2013/09/24 00:40:48, Peter Kasting wrote: > shess, could you look at the cocoa/ files? ...
7 years, 3 months ago (2013-09-24 01:04:38 UTC) #8
Peter Kasting
On 2013/09/24 01:04:38, shess wrote: > On 2013/09/24 00:40:48, Peter Kasting wrote: > > shess, ...
7 years, 3 months ago (2013-09-24 01:35:35 UTC) #9
Peter Kasting
Ugh. Had to reorder stuff some more in Browser::ActiveTabChanged() to make a find bar test ...
7 years, 3 months ago (2013-09-24 02:31:40 UTC) #10
sky
SLGTM
7 years, 3 months ago (2013-09-24 14:28:41 UTC) #11
Peter Kasting
7 years, 3 months ago (2013-09-24 21:52:58 UTC) #12
Message was sent while issue was closed.
Committed patchset #4 manually as r225074 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698