summaryrefslogtreecommitdiffstats
path: root/views/widget/tooltip_manager.h
diff options
context:
space:
mode:
authorsky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-08 17:51:04 +0000
committersky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-08 17:51:04 +0000
commit4fea07faa60c88589599bf60b33a36961be68491 (patch)
treee82d02260a590898641ffd7520cfd9e62c0c8764 /views/widget/tooltip_manager.h
parent97afa066c572a1f56e0e8cbf1e93e8437a201eb7 (diff)
downloadchromium_src-4fea07faa60c88589599bf60b33a36961be68491.zip
chromium_src-4fea07faa60c88589599bf60b33a36961be68491.tar.gz
chromium_src-4fea07faa60c88589599bf60b33a36961be68491.tar.bz2
Fleshes out the tooltip implementation for views on Gtk. It doesn't
support explicit positioning of the tooltip as windows does. That'll have to be added later. BUG=none TEST=make sure tooltips still work correctly on windows Review URL: http://codereview.chromium.org/197031 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@25635 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views/widget/tooltip_manager.h')
-rw-r--r--views/widget/tooltip_manager.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/views/widget/tooltip_manager.h b/views/widget/tooltip_manager.h
index cb48973..48708eb 100644
--- a/views/widget/tooltip_manager.h
+++ b/views/widget/tooltip_manager.h
@@ -32,6 +32,10 @@ class TooltipManager {
// Returns the separator for lines of text in a tooltip.
static const std::wstring& GetLineSeparator();
+ // Returns the maximum width of the tooltip. |x| and |y| give the location
+ // the tooltip is to be displayed on in screen coordinates.
+ static int GetMaxWidth(int x, int y);
+
TooltipManager() {}
virtual ~TooltipManager() {}
@@ -46,6 +50,17 @@ class TooltipManager {
// Invoked when toolbar loses focus.
virtual void HideKeyboardTooltip() = 0;
+
+ protected:
+ // Trims the tooltip to fit, setting |text| to the clipped result,
+ // |max_width| to the width (in pixels) of the clipped text and |line_count|
+ // to the number of lines of text in the tooltip. |x| and |y| give the
+ // location of the tooltip in screen coordinates.
+ static void TrimTooltipToFit(std::wstring* text,
+ int* max_width,
+ int* line_count,
+ int x,
+ int y);
};
} // namespace views