| 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.
|
|
|