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

Unified Diff: views/widget/tooltip_manager.h

Issue 197031: Fleshes out the tooltip implementation for views on Gtk. It doesn't... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 3 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/views.gyp ('k') | views/widget/tooltip_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: views/widget/tooltip_manager.h
===================================================================
--- views/widget/tooltip_manager.h (revision 25502)
+++ views/widget/tooltip_manager.h (working copy)
@@ -32,6 +32,10 @@
// 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 @@
// 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
« no previous file with comments | « views/views.gyp ('k') | views/widget/tooltip_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698