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

Unified Diff: views/widget/native_widget_win.cc

Issue 6995157: Disables tooltips if we can't create the tooltip window. I still don't (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge to trunk and update comments Created 9 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: views/widget/native_widget_win.cc
diff --git a/views/widget/native_widget_win.cc b/views/widget/native_widget_win.cc
index 599bdd5f23dabd88236d62b6fa8b5d3ca5699971..d058be5b397458e78d329e3b83fe0d7685d01c5e 100644
--- a/views/widget/native_widget_win.cc
+++ b/views/widget/native_widget_win.cc
@@ -1162,6 +1162,10 @@ LRESULT NativeWidgetWin::OnCreate(CREATESTRUCT* create_struct) {
} else {
tooltip_manager_.reset(new TooltipManagerWin(GetWidget()));
}
+ if (!tooltip_manager_->Init()) {
Ben Goodger (Google) 2011/06/13 17:26:17 You might note the mystery of why this check exist
+ LOG_GETLASTERROR(WARNING) << "tooltip creation failed, disabling tooltips";
+ tooltip_manager_.reset();
+ }
// This message initializes the window so that focus border are shown for
// windows.
@@ -1478,7 +1482,8 @@ LRESULT NativeWidgetWin::OnMouseRange(UINT message,
MouseEvent event(msg);
if (!(event.flags() & ui::EF_IS_NON_CLIENT))
- tooltip_manager_->OnMouse(message, w_param, l_param);
+ if (tooltip_manager_.get())
+ tooltip_manager_->OnMouse(message, w_param, l_param);
if (event.type() == ui::ET_MOUSE_MOVED && !HasMouseCapture()) {
// Windows only fires WM_MOUSELEAVE events if the application begins

Powered by Google App Engine
This is Rietveld 408576698