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

Unified Diff: views/widget/tooltip_manager_win.cc

Issue 7253016: Merge 88897 - Disables tooltips if we can't create the tooltip window. I still don't (Closed) Base URL: svn://svn.chromium.org/chrome/branches/782/src/
Patch Set: 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/tooltip_manager_win.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: views/widget/tooltip_manager_win.cc
===================================================================
--- views/widget/tooltip_manager_win.cc (revision 90643)
+++ views/widget/tooltip_manager_win.cc (working copy)
@@ -36,7 +36,8 @@
HWND window = CreateWindowEx(
WS_EX_TRANSPARENT | l10n_util::GetExtendedTooltipStyles(),
TOOLTIPS_CLASS, NULL, 0 , 0, 0, 0, 0, NULL, NULL, NULL, NULL);
- ui::CheckWindowCreated(window);
+ if (!window)
+ return gfx::Font();
HFONT hfont = reinterpret_cast<HFONT>(SendMessage(window, WM_GETFONT, 0, 0));
gfx::Font font = hfont ? gfx::Font(hfont) : gfx::Font();
DestroyWindow(window);
@@ -90,13 +91,14 @@
DestroyWindow(keyboard_tooltip_hwnd_);
}
-void TooltipManagerWin::Init() {
+bool TooltipManagerWin::Init() {
// Create the tooltip control.
tooltip_hwnd_ = CreateWindowEx(
WS_EX_TRANSPARENT | l10n_util::GetExtendedTooltipStyles(),
TOOLTIPS_CLASS, NULL, TTS_NOPREFIX, 0, 0, 0, 0,
GetParent(), NULL, NULL, NULL);
- ui::CheckWindowCreated(tooltip_hwnd_);
+ if (!tooltip_hwnd_)
+ return false;
l10n_util::AdjustUIFontForWindow(tooltip_hwnd_);
@@ -117,6 +119,7 @@
toolinfo_.lpszText = LPSTR_TEXTCALLBACK;
SetRectEmpty(&toolinfo_.rect);
SendMessage(tooltip_hwnd_, TTM_ADDTOOL, 0, (LPARAM)&toolinfo_);
+ return true;
}
gfx::NativeView TooltipManagerWin::GetParent() {
@@ -335,7 +338,9 @@
keyboard_tooltip_hwnd_ = CreateWindowEx(
WS_EX_TRANSPARENT | l10n_util::GetExtendedTooltipStyles(),
TOOLTIPS_CLASS, NULL, 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL);
- ui::CheckWindowCreated(keyboard_tooltip_hwnd_);
+ if (!keyboard_tooltip_hwnd_)
+ return;
+
SendMessage(keyboard_tooltip_hwnd_, TTM_SETMAXTIPWIDTH, 0,
std::numeric_limits<short>::max());
int tooltip_width;
« no previous file with comments | « views/widget/tooltip_manager_win.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698