Correct blacklist entry message
[chromium-blink-merge.git] / ui / views / widget / aero_tooltip_manager.h
blob0f9db20faa4894f1a28ac07ed2421b3b27608947
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef UI_VIEWS_WIDGET_AERO_TOOLTIP_MANAGER_H_
6 #define UI_VIEWS_WIDGET_AERO_TOOLTIP_MANAGER_H_
8 #include "base/memory/ref_counted.h"
9 #include "ui/views/widget/tooltip_manager_win.h"
11 namespace views {
13 ///////////////////////////////////////////////////////////////////////////////
14 // AeroTooltipManager
16 // Default Windows tooltips are broken when using our custom window frame
17 // - as soon as the tooltip receives a WM_MOUSEMOVE event, it starts spewing
18 // NCHITTEST messages at its parent window (us). These messages have random
19 // x/y coordinates and can't be ignored, as the DwmDefWindowProc uses
20 // NCHITTEST messages to determine how to highlight the caption buttons
21 // (the buttons then flicker as the hit tests sent by the user's mouse
22 // trigger different effects to those sent by the tooltip).
24 // So instead, we have to partially implement tooltips ourselves using
25 // TTF_TRACKed tooltips.
27 // TODO(glen): Resolve this with Microsoft.
28 class AeroTooltipManager : public TooltipManagerWin {
29 public:
30 explicit AeroTooltipManager(Widget* widget);
31 virtual ~AeroTooltipManager();
33 virtual void OnMouse(UINT u_msg, WPARAM w_param, LPARAM l_param);
35 private:
36 void OnTimer();
38 class InitialTimer : public base::RefCounted<InitialTimer> {
39 public:
40 explicit InitialTimer(AeroTooltipManager* manager);
41 void Start(int time);
42 void Disown();
43 void Execute();
45 private:
46 friend class base::RefCounted<InitialTimer>;
48 ~InitialTimer() {}
50 AeroTooltipManager* manager_;
53 int initial_delay_;
54 scoped_refptr<InitialTimer> initial_timer_;
57 } // namespace views
59 #endif // UI_VIEWS_WIDGET_AERO_TOOLTIP_MANAGER_H_