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
Review URL: https://codereview.chromium.org/
23536075
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@225074 0039d316-1c4b-4281-b951-d872f2087c98