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

Side by Side Diff: ui/views/widget/tooltip_manager.h

Issue 24883002: Uses and returns the fractional width in text eliding (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix round-down problems Created 7 years, 2 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef UI_VIEWS_WIDGET_TOOLTIP_MANAGER_H_ 5 #ifndef UI_VIEWS_WIDGET_TOOLTIP_MANAGER_H_
6 #define UI_VIEWS_WIDGET_TOOLTIP_MANAGER_H_ 6 #define UI_VIEWS_WIDGET_TOOLTIP_MANAGER_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 // Invoked when the tooltip text changes for the specified views. 46 // Invoked when the tooltip text changes for the specified views.
47 virtual void TooltipTextChanged(View* view) = 0; 47 virtual void TooltipTextChanged(View* view) = 0;
48 48
49 protected: 49 protected:
50 // Trims the tooltip to fit, setting |text| to the clipped result, 50 // Trims the tooltip to fit, setting |text| to the clipped result,
51 // |max_width| to the width (in pixels) of the clipped text and |line_count| 51 // |max_width| to the width (in pixels) of the clipped text and |line_count|
52 // to the number of lines of text in the tooltip. |x| and |y| give the 52 // to the number of lines of text in the tooltip. |x| and |y| give the
53 // location of the tooltip in screen coordinates. |context| is used to 53 // location of the tooltip in screen coordinates. |context| is used to
54 // determine which gfx::Screen should be used. 54 // determine which gfx::Screen should be used.
55 static void TrimTooltipToFit(string16* text, 55 static void TrimTooltipToFit(string16* text,
56 int* max_width, 56 float* max_width,
57 int* line_count, 57 int* line_count,
58 int x, 58 int x,
59 int y, 59 int y,
60 gfx::NativeView context); 60 gfx::NativeView context);
61 }; 61 };
62 62
63 } // namespace views 63 } // namespace views
64 64
65 #endif // UI_VIEWS_WIDGET_TOOLTIP_MANAGER_H_ 65 #endif // UI_VIEWS_WIDGET_TOOLTIP_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698