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

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

Issue 2174033002: [md] Fixes tooltips on Linux that should not have changed (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: [md] Fixes tooltips on Linux that should not have changed Created 4 years, 5 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/corewm/tooltip_aura.cc
diff --git a/ui/views/corewm/tooltip_aura.cc b/ui/views/corewm/tooltip_aura.cc
index f33eaca7d4084325afd9d1a70ebb42f21d475687..a0d25bfc84df1e8173d4093bb43118294f946347 100644
--- a/ui/views/corewm/tooltip_aura.cc
+++ b/ui/views/corewm/tooltip_aura.cc
@@ -29,9 +29,6 @@ namespace {
// be wrapped.
const int kTooltipMaxWidthPixels = 400;
-// Corner radius of tooltip background used with Material Design.
-const float kTooltipCornerRadius = 2.f;
-
// FIXME: get cursor offset from actual cursor size.
const int kCursorOffsetX = 10;
const int kCursorOffsetY = 15;
@@ -119,12 +116,21 @@ class TooltipAura::TooltipView : public views::View {
}
void SetBackgroundColor(SkColor background_color) {
+ // TODO(varkha): Update if native widget can be transparent on Linux.
+#if defined(OS_LINUX) && !defined(OS_CHROMEOS)
+ views::Background* background =
+ views::Background::CreateSolidBackground(background_color);
+#else
+ // Corner radius of tooltip background used with Material Design.
+ const float kTooltipCornerRadius = 2.f;
+ const bool material = ui::MaterialDesignController::IsModeMaterial();
views::Background* background =
- ui::MaterialDesignController::IsModeMaterial()
+ material
? views::Background::CreateBackgroundPainter(
true, views::Painter::CreateSolidRoundRectPainter(
background_color, kTooltipCornerRadius))
: views::Background::CreateSolidBackground(background_color);
+#endif
set_background(background);
// Force the text color to be readable when |background_color| is not
// opaque.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698