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

Unified Diff: views/widget/tooltip_manager.h

Issue 8562003: Revert "views: Move widget/ directory to ui/views." properly. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 1 month 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/widget/root_view.cc ('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
diff --git a/views/widget/tooltip_manager.h b/views/widget/tooltip_manager.h
new file mode 100644
index 0000000000000000000000000000000000000000..6b4c8d9f30e0cad1de80073b9cf1cbed9edb04ab
--- /dev/null
+++ b/views/widget/tooltip_manager.h
@@ -0,0 +1,68 @@
+// Copyright (c) 2011 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 VIEWS_WIDGET_TOOLTIP_MANAGER_H_
+#define VIEWS_WIDGET_TOOLTIP_MANAGER_H_
+#pragma once
+
+#include <string>
+
+#include "base/basictypes.h"
+#include "base/string16.h"
+#include "views/views_export.h"
+
+namespace gfx {
+class Font;
+} // namespace gfx
+
+namespace views {
+
+class View;
+
+// TooltipManager takes care of the wiring to support tooltips for Views. You
+// almost never need to interact directly with TooltipManager, rather look to
+// the various tooltip methods on View.
+class VIEWS_EXPORT TooltipManager {
+ public:
+ // Returns the height of tooltips. This should only be invoked from within
+ // GetTooltipTextOrigin.
+ static int GetTooltipHeight();
+
+ // Returns the default font used by tooltips.
+ static gfx::Font GetDefaultFont();
+
+ // 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() {}
+
+ // Notification that the view hierarchy has changed in some way.
+ virtual void UpdateTooltip() = 0;
+
+ // Invoked when the tooltip text changes for the specified views.
+ virtual void TooltipTextChanged(View* view) = 0;
+
+ // Invoked when toolbar icon gets focus.
+ virtual void ShowKeyboardTooltip(View* view) = 0;
+
+ // 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(string16* text,
+ int* max_width,
+ int* line_count,
+ int x,
+ int y);
+};
+
+} // namespace views
+
+#endif // VIEWS_WIDGET_TOOLTIP_MANAGER_H_
« no previous file with comments | « views/widget/root_view.cc ('k') | views/widget/tooltip_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698