summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsail@chromium.org <sail@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-12-08 18:56:42 +0000
committersail@chromium.org <sail@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-12-08 18:56:42 +0000
commit717da72a338c8cef0ca51132dcd492baba5d08a4 (patch)
treec2b120b9176340a35c079aed8fa379df7afb96db
parent7035fadbfed5d340b54d3f92d8b9781ee95f9bab (diff)
downloadchromium_src-717da72a338c8cef0ca51132dcd492baba5d08a4.zip
chromium_src-717da72a338c8cef0ca51132dcd492baba5d08a4.tar.gz
chromium_src-717da72a338c8cef0ca51132dcd492baba5d08a4.tar.bz2
Add support for high contrast mode to bubbles
BUG=105023 TEST= Review URL: http://codereview.chromium.org/8887003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@113634 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/ui/views/avatar_menu_bubble_view.cc6
-rw-r--r--ui/views/bubble/bubble_delegate.cc10
2 files changed, 14 insertions, 2 deletions
diff --git a/chrome/browser/ui/views/avatar_menu_bubble_view.cc b/chrome/browser/ui/views/avatar_menu_bubble_view.cc
index 793cfce..9dda891 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 72f20b8..1abae30 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).
-const SkColor BubbleDelegateView::kBackgroundColor = SK_ColorWHITE;
+#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 Bubble::kBackgroundColor = SK_ColorWHITE;
+#endif
BubbleDelegateView::BubbleDelegateView()
: close_on_esc_(true),