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

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

Issue 851853002: It is time. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Trying to reup because the last upload failed. Created 5 years, 11 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/tooltip.h ('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
deleted file mode 100644
index 24976b987603e76b133c2f62aba2308df24c36fb..0000000000000000000000000000000000000000
--- a/ui/views/corewm/tooltip_aura.h
+++ /dev/null
@@ -1,80 +0,0 @@
-// Copyright 2013 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef UI_VIEWS_COREWM_TOOLTIP_AURA_H_
-#define UI_VIEWS_COREWM_TOOLTIP_AURA_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;
-} // namespace gfx
-
-namespace views {
-
-class Widget;
-
-namespace corewm {
-
-// Implementation of Tooltip that shows the tooltip using a Widget and Label.
-class VIEWS_EXPORT TooltipAura : public Tooltip, public WidgetObserver {
- public:
- 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().
- static void TrimTooltipToFit(const gfx::FontList& font_list,
- int max_width,
- 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;
-
- // 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,
- const gfx::Size& tooltip_size);
-
- // Destroys |widget_|.
- void DestroyWidget();
-
- // Tooltip:
- virtual void SetText(aura::Window* window,
- const base::string16& tooltip_text,
- const gfx::Point& location) override;
- virtual void Show() override;
- virtual void Hide() override;
- virtual bool IsVisible() override;
-
- // WidgetObserver:
- virtual void OnWidgetDestroying(Widget* widget) override;
-
- const gfx::ScreenType screen_type_;
-
- // The label showing the tooltip.
- Label label_;
-
- // The widget containing the tooltip. May be NULL.
- Widget* widget_;
-
- // The window we're showing the tooltip for. Never NULL and valid while
- // showing.
- aura::Window* tooltip_window_;
-
- DISALLOW_COPY_AND_ASSIGN(TooltipAura);
-};
-
-} // namespace corewm
-} // namespace views
-
-#endif // UI_VIEWS_COREWM_TOOLTIP_AURA_H_
« no previous file with comments | « ui/views/corewm/tooltip.h ('k') | ui/views/corewm/tooltip_aura.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698