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

Unified Diff: ui/aura_shell/shell_tooltip_manager.cc

Issue 8780001: aura: Make aura::TooltipClient completely static? (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: merged with upstream Created 9 years 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
Index: ui/aura_shell/shell_tooltip_manager.cc
diff --git a/ui/aura_shell/shell_tooltip_manager.cc b/ui/aura_shell/shell_tooltip_manager.cc
index 0544ca8c4f65105b5aa8ddc915129ccb005170f7..a8d6cf920fc7d3a68f3ef6b8e87893e46f2c9fcc 100644
--- a/ui/aura_shell/shell_tooltip_manager.cc
+++ b/ui/aura_shell/shell_tooltip_manager.cc
@@ -29,6 +29,8 @@ namespace {
SkColor kTooltipBackground = 0xFFFFFFCC;
SkColor kTooltipBorder = 0xFF000000;
int kTooltipBorderWidth = 1;
+int kTooltipHorizontalPadding = 3;
+int kTooltipVerticalPadding = 1;
int kTooltipTimeoutMs = 500;
// FIXME: get cursor offset from actual cursor size.
@@ -126,8 +128,9 @@ class ShellTooltipManager::Tooltip {
location.x(), location.y());
label_.SetText(tooltip_text);
- SetTooltipBounds(location, max_width + 2 * kTooltipBorderWidth,
- label_.GetPreferredSize().height());
+ SetTooltipBounds(location,
+ max_width + 2 * kTooltipBorderWidth + 2 * kTooltipHorizontalPadding,
+ label_.GetPreferredSize().height() + 2 * kTooltipVerticalPadding);
}
// Shows the tooltip.
@@ -278,4 +281,10 @@ int TooltipClient::GetMaxWidth(int x, int y) {
return (monitor_bounds.width() + 1) / 2;
}
+// static
+void TooltipClient::UpdateTooltip(Window* target) {
+ if (aura_shell::Shell::GetInstance()->tooltip_manager())
+ aura_shell::Shell::GetInstance()->tooltip_manager()->UpdateTooltip(target);
+}
+
} // namespace aura

Powered by Google App Engine
This is Rietveld 408576698