summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjianli@chromium.org <jianli@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-05-02 06:07:40 +0000
committerjianli@chromium.org <jianli@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-05-02 06:07:40 +0000
commit0160a43b23afdcaafcb959c80978532cd2cca19f (patch)
treee5619b0f0bba46158bf5c754088dd5464ce8f038
parentd2b8b21984aa349f3fffbeddaa0265e631476d4d (diff)
downloadchromium_src-0160a43b23afdcaafcb959c80978532cd2cca19f.zip
chromium_src-0160a43b23afdcaafcb959c80978532cd2cca19f.tar.gz
chromium_src-0160a43b23afdcaafcb959c80978532cd2cca19f.tar.bz2
Fix bug 106809: Panels [WIN]: Tooltips appear behind panels until panels are minimized and restored
The tooltip window is first created when the render widget host window sets its bounds. At that time, the render widget host window has not set its top-level window to the browser window yet. When the browser window is top-most window, like panel, the tooltip window is not able to inherit top-most style from it. I changed the code to delay the creation of tooltip window until we really want to show the tooltip text. BUG=106809 TEST=Manual test by creating tab/popup/panel windows with tooltip and verify the text Review URL: http://codereview.chromium.org/10292002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@134872 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--content/browser/renderer_host/render_widget_host_view_win.cc9
1 files changed, 3 insertions, 6 deletions
diff --git a/content/browser/renderer_host/render_widget_host_view_win.cc b/content/browser/renderer_host/render_widget_host_view_win.cc
index 975bd4e..fcfeac8 100644
--- a/content/browser/renderer_host/render_widget_host_view_win.cc
+++ b/content/browser/renderer_host/render_widget_host_view_win.cc
@@ -406,7 +406,6 @@ void RenderWidgetHostViewWin::DidBecomeSelected() {
if (web_contents_switch_paint_time_.is_null())
web_contents_switch_paint_time_ = TimeTicks::Now();
is_hidden_ = false;
- EnsureTooltip();
// |render_widget_host_| may be NULL if the WebContentsImpl is in the process
// of closing.
@@ -452,7 +451,6 @@ void RenderWidgetHostViewWin::SetBounds(const gfx::Rect& rect) {
SetWindowPos(NULL, point.x, point.y, rect.width(), rect.height(), swp_flags);
render_widget_host_->WasResized();
- EnsureTooltip();
}
gfx::NativeView RenderWidgetHostViewWin::GetNativeView() const {
@@ -873,6 +871,9 @@ void RenderWidgetHostViewWin::Destroy() {
}
void RenderWidgetHostViewWin::SetTooltipText(const string16& tooltip_text) {
+ if (!is_hidden_)
+ EnsureTooltip();
+
// Clamp the tooltip length to kMaxTooltipLength so that we don't
// accidentally DOS the user with a mega tooltip (since Windows doesn't seem
// to do this itself).
@@ -2529,10 +2530,6 @@ void RenderWidgetHostViewWin::DoPopupOrFullscreenInit(HWND parent_hwnd,
parent_hwnd_ = parent_hwnd;
Create(parent_hwnd_, NULL, NULL, WS_POPUP, ex_style);
MoveWindow(pos.x(), pos.y(), pos.width(), pos.height(), TRUE);
- // To show tooltip on popup window.(e.g. title in <select>)
- // Popups default to showing, which means |DidBecomeSelected()| isn't invoked.
- // Ensure the tooltip is created otherwise tooltips are never shown.
- EnsureTooltip();
ShowWindow(IsActivatable() ? SW_SHOW : SW_SHOWNA);
}