diff options
author | pkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-31 19:35:58 +0000 |
---|---|---|
committer | pkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-31 19:35:58 +0000 |
commit | 638a737f0fb392349d2d69b1b91ee844f47eca03 (patch) | |
tree | a2577484f35b6ca393701a2229636a368ad55168 /views/widget | |
parent | 137b049fa3cfcd9545e85503cedc84513e9e9775 (diff) | |
download | chromium_src-638a737f0fb392349d2d69b1b91ee844f47eca03.zip chromium_src-638a737f0fb392349d2d69b1b91ee844f47eca03.tar.gz chromium_src-638a737f0fb392349d2d69b1b91ee844f47eca03.tar.bz2 |
Fix bug where the tooltip would not be erased if it had been non-empty and then was updated to be empty.
BUG=none
TEST=Start Chrome, type a letter in the omnibox, hover the Go button and wait for the tooltip. Then delete the character and move the mouse pointer a tiny bit. The tooltip should disappear.
Review URL: http://codereview.chromium.org/175032
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@24918 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views/widget')
-rw-r--r-- | views/widget/tooltip_manager_win.cc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/views/widget/tooltip_manager_win.cc b/views/widget/tooltip_manager_win.cc index 70aff1e..3c20da0 100644 --- a/views/widget/tooltip_manager_win.cc +++ b/views/widget/tooltip_manager_win.cc @@ -345,12 +345,12 @@ void TooltipManagerWin::UpdateTooltip(int x, int y) { gfx::Point view_point(x, y); View::ConvertPointToView(root_view, last_tooltip_view_, &view_point); std::wstring new_tooltip_text; - if (last_tooltip_view_->GetTooltipText(view_point.x(), view_point.y(), - &new_tooltip_text) && - new_tooltip_text != tooltip_text_) { + bool has_tooltip_text = last_tooltip_view_->GetTooltipText( + view_point.x(), view_point.y(), &new_tooltip_text); + if (!has_tooltip_text || (new_tooltip_text != tooltip_text_)) { // The text has changed, hide the popup. SendMessage(tooltip_hwnd_, TTM_POP, 0, 0); - if (!new_tooltip_text.empty() && tooltip_showing_) { + if (has_tooltip_text && !new_tooltip_text.empty() && tooltip_showing_) { // New text is valid, show the popup. SendMessage(tooltip_hwnd_, TTM_POPUP, 0, 0); } |