From 22d90237949a084974b59c5479bb44e08ef9f443 Mon Sep 17 00:00:00 2001 From: "sail@chromium.org" Date: Thu, 8 Dec 2011 21:16:56 +0000 Subject: Add support for high contrast mode to bubbles BUG=105023 TEST= Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=113634 Review URL: http://codereview.chromium.org/8887003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@113661 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/ui/views/avatar_menu_bubble_view.cc | 6 ++++++ ui/views/bubble/bubble_delegate.cc | 8 +++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/chrome/browser/ui/views/avatar_menu_bubble_view.cc b/chrome/browser/ui/views/avatar_menu_bubble_view.cc index 2dae9fc..9f1b081 100644 --- a/chrome/browser/ui/views/avatar_menu_bubble_view.cc +++ b/chrome/browser/ui/views/avatar_menu_bubble_view.cc @@ -288,6 +288,11 @@ void ProfileItemView::OnBlur() { void ProfileItemView::OnHighlightStateChanged() { set_background(IsHighlighted() ? views::Background::CreateSolidBackground( SkColorSetRGB(0xe3, 0xed, 0xf6)) : NULL); + SkColor background_color = background() ? + background()->get_color() : views::BubbleDelegateView::kBackgroundColor; + name_label_->SetBackgroundColor(background_color); + sync_state_label_->SetBackgroundColor(background_color); + edit_link_->SetBackgroundColor(background_color); bool show_edit = IsHighlighted() && item_.active; sync_state_label_->SetVisible(!show_edit); @@ -488,6 +493,7 @@ void AvatarMenuBubbleView::OnAvatarMenuModelChanged( l10n_util::GetStringUTF16(IDS_PROFILES_CREATE_NEW_PROFILE_LINK)); add_profile_link_->set_listener(this); add_profile_link_->SetHorizontalAlignment(views::Label::ALIGN_LEFT); + add_profile_link_->SetBackgroundColor(color()); add_profile_link_->SetEnabledColor(SkColorSetRGB(0xe3, 0xed, 0xf6)); AddChildView(add_profile_link_); diff --git a/ui/views/bubble/bubble_delegate.cc b/ui/views/bubble/bubble_delegate.cc index 2592270..9a790d9 100644 --- a/ui/views/bubble/bubble_delegate.cc +++ b/ui/views/bubble/bubble_delegate.cc @@ -5,6 +5,7 @@ #include "ui/views/bubble/bubble_delegate.h" #include "ui/base/animation/slide_animation.h" +#include "ui/gfx/color_utils.h" #include "ui/views/bubble/bubble_frame_view.h" #include "ui/views/widget/widget.h" @@ -71,8 +72,13 @@ Widget* CreateBorderWidget(BubbleDelegateView* bubble, Widget* parent) { } // namespace -// TODO(msw): Use NativeTheme/color_helper (crbug.com/105023). +#if defined(OS_WIN) && !defined(USE_AURA) +const SkColor BubbleDelegateView::kBackgroundColor = + color_utils::GetSysSkColor(COLOR_WINDOW); +#else +// TODO(beng): source from theme provider. const SkColor BubbleDelegateView::kBackgroundColor = SK_ColorWHITE; +#endif BubbleDelegateView::BubbleDelegateView() : close_on_esc_(true), -- cgit v1.1