diff options
author | robliao@chromium.org <robliao@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-04-29 23:17:06 +0000 |
---|---|---|
committer | robliao@chromium.org <robliao@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-04-29 23:17:06 +0000 |
commit | 6daa739b3beaed1686d73da9d55ec8e8d54b9d49 (patch) | |
tree | d0f9580b4599f8f769bb6d3ba2ea587071b5244b | |
parent | 46231cd57654ee6ce1eac7e3b738441e0b58fc74 (diff) | |
download | chromium_src-6daa739b3beaed1686d73da9d55ec8e8d54b9d49.zip chromium_src-6daa739b3beaed1686d73da9d55ec8e8d54b9d49.tar.gz chromium_src-6daa739b3beaed1686d73da9d55ec8e8d54b9d49.tar.bz2 |
Revert of Linux Aura: get tooltip background color from theme (https://codereview.chromium.org/258713002/)
Reason for revert:
views_unittest TooltipController test failures
views_unittests views_unittests 4 disabled 10 flaky failed 10 ( 9 secs )
stdio
Capture
CloseOnCaptureLost
DontShowEmptyTooltips
EnableOrDisableTooltips
HideOnExit
ReshowOnClickAfterEnterExit
TooltipHidesOnKeyPressAndStaysHiddenUntilChange
TooltipHidesOnTimeoutAndStaysHiddenUntilChange
TooltipsInMultipleViews
ViewTooltip
TooltipControllerTest.ViewTooltip (run #2):
[ RUN ] TooltipControllerTest.ViewTooltip
Xlib: extension "RANDR" missing on display ":9".
Received signal 11 SEGV_MAPERR 000000000000
#0 0x000000a88e4e base::debug::StackTrace::StackTrace()
#1 0x000000a89068 base::debug::(anonymous namespace)::StackDumpSignalHandler()
#2 0x7f9474270cb0 \u003Cunknown>
#3 0x000000736b83 views::NativeWidgetAura::Activate()
#4 0x000000737508 views::NativeWidgetAura::ShowWithWindowState()
#5 0x000000738acb views::Widget::Show()
#6 0x00000052cb09 views::corewm::test::(anonymous namespace)::CreateWidget()
#7 0x00000052d397 views::corewm::test::TooltipControllerTest::SetUp()
#8 0x00000065a16a testing::Test::Run()
Original issue's description:
> Linux Aura: get tooltip background color from theme
>
> the border color can still conflict with the theme (e.g., no visible border if the tooltip bg is dark), but fixing that is a lot harder because the border, window roundedness, and shadow are all one tiled set of images (see shadow.cc).
>
> BUG=348194
>
> Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=266974
TBR=ben@chromium.org,estade@chromium.org
NOTREECHECKS=true
NOTRY=true
BUG=348194
Review URL: https://codereview.chromium.org/263533003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@266992 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/ui/libgtk2ui/native_theme_gtk2.cc | 9 | ||||
-rw-r--r-- | ui/native_theme/fallback_theme.cc | 6 | ||||
-rw-r--r-- | ui/native_theme/native_theme.h | 2 | ||||
-rw-r--r-- | ui/views/corewm/tooltip_aura.cc | 9 |
4 files changed, 7 insertions, 19 deletions
diff --git a/chrome/browser/ui/libgtk2ui/native_theme_gtk2.cc b/chrome/browser/ui/libgtk2ui/native_theme_gtk2.cc index 2088824..bb91dc7 100644 --- a/chrome/browser/ui/libgtk2ui/native_theme_gtk2.cc +++ b/chrome/browser/ui/libgtk2ui/native_theme_gtk2.cc @@ -251,11 +251,7 @@ GdkColor NativeThemeGtk2::GetSystemGdkColor(ColorId color_id) const { case kColorId_TextfieldSelectionBackgroundFocused: return GetEntryStyle()->base[GTK_STATE_SELECTED]; - // Tooltips - case kColorId_TooltipBackground: - return GetWindowStyle()->bg[GTK_STATE_NORMAL]; - - // Trees and Tables (implemented on GTK using the same class) + // Trees and Tables (implemented on GTK using the same class) case kColorId_TableBackground: case kColorId_TreeBackground: return GetTreeStyle()->bg[GTK_STATE_NORMAL]; @@ -330,6 +326,9 @@ 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 3e7b350..ab6fc27 100644 --- a/ui/native_theme/fallback_theme.cc +++ b/ui/native_theme/fallback_theme.cc @@ -66,8 +66,6 @@ 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; @@ -186,10 +184,6 @@ 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 f4ea130..c340504 100644 --- a/ui/native_theme/native_theme.h +++ b/ui/native_theme/native_theme.h @@ -269,8 +269,6 @@ 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 777603c..50ced84 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,6 +60,8 @@ 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); } @@ -232,11 +234,6 @@ 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() { |