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

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: Improved 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
« no previous file with comments | « views/widget/native_widget_win.h ('k') | views/widget/tooltip_manager_win.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..d06b47e11bd23c58cc8d4171acc00000ea36e7ce 100644
--- a/views/widget/native_widget_win.cc
+++ b/views/widget/native_widget_win.cc
@@ -1162,6 +1162,12 @@ LRESULT NativeWidgetWin::OnCreate(CREATESTRUCT* create_struct) {
} else {
tooltip_manager_.reset(new TooltipManagerWin(GetWidget()));
}
+ if (!tooltip_manager_->Init()) {
+ // There was a problem creating the TooltipManager. Common error is 127.
+ // See 82193 for details.
+ 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 +1484,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
« no previous file with comments | « views/widget/native_widget_win.h ('k') | views/widget/tooltip_manager_win.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698