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

Unified Diff: ui/views/corewm/tooltip_aura.h

Issue 924433002: Use RenderText directly to draw tooltip (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: set_owned_by_client Created 5 years, 10 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 | « ui/views/corewm/DEPS ('k') | ui/views/corewm/tooltip_aura.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/corewm/tooltip_aura.h
diff --git a/ui/views/corewm/tooltip_aura.h b/ui/views/corewm/tooltip_aura.h
index ce92fa25d151a77ab14ead3eb4576419ac133cb1..d1ef44811280cf8913f10686dd8a904a4b3b65f7 100644
--- a/ui/views/corewm/tooltip_aura.h
+++ b/ui/views/corewm/tooltip_aura.h
@@ -5,13 +5,14 @@
#ifndef UI_VIEWS_COREWM_TOOLTIP_AURA_H_
#define UI_VIEWS_COREWM_TOOLTIP_AURA_H_
+#include "base/memory/scoped_ptr.h"
#include "ui/gfx/screen_type_delegate.h"
-#include "ui/views/controls/label.h"
#include "ui/views/corewm/tooltip.h"
#include "ui/views/widget/widget_observer.h"
namespace gfx {
class FontList;
+class Size;
} // namespace gfx
namespace views {
@@ -26,17 +27,9 @@ class VIEWS_EXPORT TooltipAura : public Tooltip, public WidgetObserver {
TooltipAura();
~TooltipAura() override;
- // 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().
- static void TrimTooltipToFit(const gfx::FontList& font_list,
- int max_width,
- base::string16* text,
- int* width,
- int* line_count);
-
private:
+ class TooltipView;
+
// Adjusts the bounds given by the arguments to fit inside the desktop
// and applies the adjusted bounds to the label_.
void SetTooltipBounds(const gfx::Point& mouse_pos,
@@ -58,8 +51,8 @@ class VIEWS_EXPORT TooltipAura : public Tooltip, public WidgetObserver {
// WidgetObserver:
void OnWidgetDestroying(Widget* widget) override;
- // The label showing the tooltip.
- Label label_;
+ // The view showing the tooltip.
+ scoped_ptr<TooltipView> tooltip_view_;
// The widget containing the tooltip. May be NULL.
Widget* widget_;
« no previous file with comments | « ui/views/corewm/DEPS ('k') | ui/views/corewm/tooltip_aura.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698