diff --git a/chrome/browser/ui/libgtk2ui/native_theme_gtk2.cc b/chrome/browser/ui/libgtk2ui/native_theme_gtk2.cc index bb91dc7e6c8afb..2088824222adb9 100644 --- a/chrome/browser/ui/libgtk2ui/native_theme_gtk2.cc +++ b/chrome/browser/ui/libgtk2ui/native_theme_gtk2.cc @@ -251,7 +251,11 @@ GdkColor NativeThemeGtk2::GetSystemGdkColor(ColorId color_id) const { case kColorId_TextfieldSelectionBackgroundFocused: return GetEntryStyle()->base[GTK_STATE_SELECTED]; - // Trees and Tables (implemented on GTK using the same class) + // Tooltips + case kColorId_TooltipBackground: + return GetWindowStyle()->bg[GTK_STATE_NORMAL]; + + // Trees and Tables (implemented on GTK using the same class) case kColorId_TableBackground: case kColorId_TreeBackground: return GetTreeStyle()->bg[GTK_STATE_NORMAL]; @@ -326,9 +330,6 @@ GdkColor NativeThemeGtk2::GetSystemGdkColor(ColorId color_id) const { return GdkAlphaBlend(win_style->text[GTK_STATE_SELECTED], win_style->bg[GTK_STATE_SELECTED], 0x34); } - default: - // Fall through - break; } return SkColorToGdkColor(kInvalidColorIdColor); diff --git a/ui/native_theme/fallback_theme.cc b/ui/native_theme/fallback_theme.cc index ab6fc27aaea545..3e7b350346fe1a 100644 --- a/ui/native_theme/fallback_theme.cc +++ b/ui/native_theme/fallback_theme.cc @@ -66,6 +66,8 @@ SkColor FallbackTheme::GetSystemColor(ColorId color_id) const { static const SkColor kTextfieldSelectionColor = color_utils::AlphaBlend(SK_ColorBLACK, kTextfieldSelectionBackgroundFocused, 0xdd); + // Tooltip + static const SkColor kTooltipBackground = 0xFFFFFFCC; // Tree static const SkColor kTreeBackground = SK_ColorWHITE; static const SkColor kTreeTextColor = SK_ColorBLACK; @@ -184,6 +186,10 @@ SkColor FallbackTheme::GetSystemColor(ColorId color_id) const { case kColorId_TextfieldSelectionBackgroundFocused: return kTextfieldSelectionBackgroundFocused; + // Tooltip + case kColorId_TooltipBackground: + return kTooltipBackground; + // Tree case kColorId_TreeBackground: return kTreeBackground; diff --git a/ui/native_theme/native_theme.h b/ui/native_theme/native_theme.h index c34050466e9960..f4ea130ec72342 100644 --- a/ui/native_theme/native_theme.h +++ b/ui/native_theme/native_theme.h @@ -269,6 +269,8 @@ class NATIVE_THEME_EXPORT NativeTheme { kColorId_TextfieldReadOnlyBackground, kColorId_TextfieldSelectionColor, kColorId_TextfieldSelectionBackgroundFocused, + // Tooltip + kColorId_TooltipBackground, // Tree kColorId_TreeBackground, kColorId_TreeText, diff --git a/ui/views/corewm/tooltip_aura.cc b/ui/views/corewm/tooltip_aura.cc index 50ced84d66dc4b..777603cbeac70d 100644 --- a/ui/views/corewm/tooltip_aura.cc +++ b/ui/views/corewm/tooltip_aura.cc @@ -12,13 +12,13 @@ #include "ui/gfx/screen.h" #include "ui/gfx/text_elider.h" #include "ui/gfx/text_utils.h" +#include "ui/native_theme/native_theme.h" #include "ui/views/background.h" #include "ui/views/border.h" #include "ui/views/widget/widget.h" namespace { -const SkColor kTooltipBackground = 0xFFFFFFCC; const int kTooltipHorizontalPadding = 3; // Max visual tooltip width. If a tooltip is greater than this width, it will @@ -60,8 +60,6 @@ TooltipAura::TooltipAura(gfx::ScreenType screen_type) : screen_type_(screen_type), widget_(NULL), tooltip_window_(NULL) { - label_.set_background( - views::Background::CreateSolidBackground(kTooltipBackground)); label_.set_owned_by_client(); label_.SetMultiLine(true); } @@ -234,6 +232,11 @@ void TooltipAura::SetText(aura::Window* window, 2 * kTooltipVerticalPadding; CreateWidget(); SetTooltipBounds(location, width, height); + + label_.set_background( + views::Background::CreateSolidBackground( + widget_->GetNativeTheme()->GetSystemColor( + ui::NativeTheme::kColorId_TooltipBackground))); } void TooltipAura::Show() {