Index: ui/views/corewm/tooltip_aura.h |
diff --git a/ui/views/corewm/tooltip_aura.h b/ui/views/corewm/tooltip_aura.h |
index ead119f5d95889c4a1e2e5fc1a5f72f4d807ef4c..5ac7c5091a10ec974e70783c5c28f5f38efa5472 100644 |
--- a/ui/views/corewm/tooltip_aura.h |
+++ b/ui/views/corewm/tooltip_aura.h |
@@ -23,28 +23,32 @@ namespace corewm { |
// Implementation of Tooltip that shows the tooltip using a Widget and Label. |
class VIEWS_EXPORT TooltipAura : public Tooltip, public WidgetObserver { |
public: |
+ // Preferred maximum tooltip width, in pixels. If a tooltip's text is wider |
+ // than this width, it will be wrapped (unless doing so would truncate words |
+ // in the text). |
+ static const int kPreferredWidthPixels; |
+ |
explicit TooltipAura(gfx::ScreenType screen_type); |
virtual ~TooltipAura(); |
- // Trims the tooltip to fit in the width |max_width|, setting |text| to the |
- // clipped result, |width| to the width (in pixels) of the clipped text |
- // and |line_count| to the number of lines of text in the tooltip. |font_list| |
- // is used to layout |text|. |max_width| comes from GetMaxWidth(). |
+ // Trims |text| to fit in |max_size|, setting |text| to the clipped result, |
+ // |width| to the width (in pixels) of the clipped text and |line_count| to |
+ // the number of lines of text in the tooltip. |font_list| is used to layout |
+ // |text|. |max_size| comes from GetMaxSize(). |
static void TrimTooltipToFit(const gfx::FontList& font_list, |
- int max_width, |
+ const gfx::Size& max_size, |
base::string16* text, |
int* width, |
int* line_count); |
private: |
- // Returns the max width of the tooltip when shown at the specified location. |
- int GetMaxWidth(const gfx::Point& location) const; |
+ // Returns the max size of the tooltip when shown at the specified location. |
+ gfx::Size GetMaxSize(const gfx::Point& location) const; |
// Adjusts the bounds given by the arguments to fit inside the desktop |
- // and applies the adjusted bounds to the label_. |
+ // and applies the adjusted bounds to |label_|. |
void SetTooltipBounds(const gfx::Point& mouse_pos, |
- int tooltip_width, |
- int tooltip_height); |
+ const gfx::Size& tooltip_size); |
// Destroys |widget_|. |
void DestroyWidget(); |