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

Unified Diff: views/widget/tooltip_manager_win.h

Issue 114054: Splits TooltipManager so that it can be ported and stubs out the GTK... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 7 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_gtk.cc ('k') | views/widget/tooltip_manager_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: views/widget/tooltip_manager_win.h
===================================================================
--- views/widget/tooltip_manager_win.h (revision 17029)
+++ views/widget/tooltip_manager_win.h (working copy)
@@ -2,15 +2,17 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef VIEWS_WIDGET_TOOLTIP_MANAGER_H_
-#define VIEWS_WIDGET_TOOLTIP_MANAGER_H_
+#ifndef VIEWS_WIDGET_TOOLTIP_MANAGER_WIN_H_
+#define VIEWS_WIDGET_TOOLTIP_MANAGER_WIN_H_
#include <windows.h>
#include <commctrl.h>
-
#include <string>
+
#include "base/basictypes.h"
+#include "base/gfx/native_widget_types.h"
#include "base/task.h"
+#include "views/widget/tooltip_manager.h"
namespace gfx {
class Font;
@@ -21,8 +23,9 @@
class View;
class Widget;
-// TooltipManager takes care of the wiring to support tooltips for Views.
-// This class is intended to be used by Widgets. To use this, you must
+// TooltipManager implementation for Windows.
+//
+// This class is intended to be used by WidgetWin. To use this, you must
// do the following:
// Add the following to your MSG_MAP:
//
@@ -49,34 +52,24 @@
//
// Lastly, you'll need to override GetTooltipManager.
//
-// See XPFrame for an example of this in action.
-class TooltipManager {
+// See WidgetWin for an example of this in action.
+class TooltipManagerWin : public TooltipManager {
public:
- // Returns the height of tooltips. This should only be invoked from within
- // GetTooltipTextOrigin.
- static int GetTooltipHeight();
-
- // Returns the default font used by tooltips.
- static gfx::Font GetDefaultFont();
-
- // Returns the separator for lines of text in a tooltip.
- static const std::wstring& GetLineSeparator();
-
// Creates a TooltipManager for the specified Widget and parent window.
- TooltipManager(Widget* widget, HWND parent);
- virtual ~TooltipManager();
+ explicit TooltipManagerWin(Widget* widget);
+ virtual ~TooltipManagerWin();
// Notification that the view hierarchy has changed in some way.
- void UpdateTooltip();
+ virtual void UpdateTooltip();
// Invoked when the tooltip text changes for the specified views.
- void TooltipTextChanged(View* view);
+ virtual void TooltipTextChanged(View* view);
// Invoked when toolbar icon gets focus.
- void ShowKeyboardTooltip(View* view);
+ virtual void ShowKeyboardTooltip(View* view);
// Invoked when toolbar loses focus.
- void HideKeyboardTooltip();
+ virtual void HideKeyboardTooltip();
// Message handlers. These forward to the tooltip control.
virtual void OnMouse(UINT u_msg, WPARAM w_param, LPARAM l_param);
@@ -87,12 +80,12 @@
protected:
virtual void Init();
+ // Returns the Widget we're showing tooltips for.
+ gfx::NativeView GetParent();
+
// Updates the tooltip for the specified location.
void UpdateTooltip(int x, int y);
- // Parent window the tooltip is added to.
- HWND parent_;
-
// Tooltip control window.
HWND tooltip_hwnd_;
@@ -152,19 +145,16 @@
// Width of the last tooltip.
int tooltip_width_;
- // Height for a tooltip; lazily calculated.
- static int tooltip_height_;
-
// control window for tooltip displayed using keyboard.
HWND keyboard_tooltip_hwnd_;
// Used to register DestroyTooltipWindow function with PostDelayedTask
// function.
- ScopedRunnableMethodFactory<TooltipManager> keyboard_tooltip_factory_;
+ ScopedRunnableMethodFactory<TooltipManagerWin> keyboard_tooltip_factory_;
- DISALLOW_EVIL_CONSTRUCTORS(TooltipManager);
+ DISALLOW_COPY_AND_ASSIGN(TooltipManagerWin);
};
} // namespace views
-#endif // VIEWS_WIDGET_TOOLTIP_MANAGER_H_
+#endif // VIEWS_WIDGET_TOOLTIP_MANAGER_WIN_H_
« no previous file with comments | « views/widget/tooltip_manager_gtk.cc ('k') | views/widget/tooltip_manager_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698