| Index: ash/common/system/tray/tray_popup_item_style.cc
|
| diff --git a/ash/common/system/tray/tray_popup_item_style.cc b/ash/common/system/tray/tray_popup_item_style.cc
|
| index aaac333cb55923aac855e3b8f15e084e138f0c34..50d822c037523991a8dfe17c8d113bdc0a1c9029 100644
|
| --- a/ash/common/system/tray/tray_popup_item_style.cc
|
| +++ b/ash/common/system/tray/tray_popup_item_style.cc
|
| @@ -8,97 +8,59 @@
|
| #include "ui/gfx/color_palette.h"
|
| #include "ui/gfx/font.h"
|
| #include "ui/gfx/font_list.h"
|
| -#include "ui/native_theme/native_theme.h"
|
| #include "ui/views/controls/label.h"
|
|
|
| namespace ash {
|
| namespace {
|
|
|
| -// The base color used to compute the effective text colors.
|
| -const SkColor kBaseTextColor = SK_ColorBLACK;
|
| -
|
| -// The color used for sub-section header row text and icons.
|
| -const SkColor kProminentButtonColor = gfx::kGoogleBlue500;
|
| -
|
| -// The color for "Connected" status text.
|
| -const SkColor kConnectedTextColor = gfx::kGoogleGreen700;
|
| -
|
| -const int kActiveTextAlpha = 0xDE;
|
| -const int kInactiveTextAlpha = 0x8A;
|
| -const int kDisabledTextAlpha = 0x61;
|
| -
|
| -// The base color used to compute the effective icon colors.
|
| -const SkColor kBaseIconColor = SkColorSetRGB(0x5a, 0x5a, 0x5a);
|
| -
|
| -const int kActiveIconAlpha = 0xFF;
|
| -const int kInactiveIconAlpha = 0x8A;
|
| -const int kDisabledIconAlpha = 0x61;
|
| +const int kInactiveAlpha = 0x8A;
|
| +const int kDisabledAlpha = 0x61;
|
|
|
| } // namespace
|
|
|
| // static
|
| -SkColor TrayPopupItemStyle::GetIconColor(const ui::NativeTheme* theme,
|
| - ColorStyle color_style) {
|
| - // TODO(bruthig|tdanderson): Determine if TrayPopupItemStyle should depend on
|
| - // a NativeTheme and if so use it here. See http://crbug.com/665891.
|
| +SkColor TrayPopupItemStyle::GetIconColor(ColorStyle color_style) {
|
| switch (color_style) {
|
| case ColorStyle::ACTIVE:
|
| - return SkColorSetA(kBaseIconColor, kActiveIconAlpha);
|
| + return gfx::kChromeIconGrey;
|
| case ColorStyle::INACTIVE:
|
| - return SkColorSetA(kBaseIconColor, kInactiveIconAlpha);
|
| + return SkColorSetA(gfx::kChromeIconGrey, kInactiveAlpha);
|
| case ColorStyle::DISABLED:
|
| - return SkColorSetA(kBaseIconColor, kDisabledIconAlpha);
|
| + return SkColorSetA(gfx::kChromeIconGrey, kDisabledAlpha);
|
| case ColorStyle::CONNECTED:
|
| - // Use a noticeable color to help notice undefined color styles for icons.
|
| - return SK_ColorMAGENTA;
|
| - case ColorStyle::SUB_HEADER:
|
| - return kProminentButtonColor;
|
| + return gfx::kPlaceholderColor;
|
| }
|
| NOTREACHED();
|
| - // Use a noticeable color to help notice unhandled cases.
|
| - return SK_ColorMAGENTA;
|
| -}
|
| -
|
| -// static
|
| -SkColor TrayPopupItemStyle::GetIconColor(ColorStyle color_style) {
|
| - return GetIconColor(nullptr, color_style);
|
| + return gfx::kPlaceholderColor;
|
| }
|
|
|
| -TrayPopupItemStyle::TrayPopupItemStyle(const ui::NativeTheme* theme,
|
| - FontStyle font_style)
|
| - : theme_(theme),
|
| - font_style_(font_style),
|
| - color_style_(font_style_ == FontStyle::SUB_HEADER ? ColorStyle::SUB_HEADER
|
| - : ColorStyle::ACTIVE) {}
|
| -
|
| TrayPopupItemStyle::TrayPopupItemStyle(FontStyle font_style)
|
| - : TrayPopupItemStyle(nullptr, font_style) {}
|
| + : font_style_(font_style), color_style_(ColorStyle::ACTIVE) {
|
| + if (font_style_ == FontStyle::SYSTEM_INFO)
|
| + color_style_ = ColorStyle::INACTIVE;
|
| +}
|
|
|
| TrayPopupItemStyle::~TrayPopupItemStyle() {}
|
|
|
| SkColor TrayPopupItemStyle::GetTextColor() const {
|
| - if (font_style_ == FontStyle::SYSTEM_INFO)
|
| - return SkColorSetA(kBaseTextColor, kInactiveTextAlpha);
|
| + const SkColor kBaseTextColor = SkColorSetA(SK_ColorBLACK, 0xDE);
|
|
|
| switch (color_style_) {
|
| case ColorStyle::ACTIVE:
|
| - return SkColorSetA(kBaseTextColor, kActiveTextAlpha);
|
| + return kBaseTextColor;
|
| case ColorStyle::INACTIVE:
|
| - return SkColorSetA(kBaseTextColor, kInactiveTextAlpha);
|
| + return SkColorSetA(kBaseTextColor, kInactiveAlpha);
|
| case ColorStyle::DISABLED:
|
| - return SkColorSetA(kBaseTextColor, kDisabledTextAlpha);
|
| + return SkColorSetA(kBaseTextColor, kDisabledAlpha);
|
| case ColorStyle::CONNECTED:
|
| - return kConnectedTextColor;
|
| - case ColorStyle::SUB_HEADER:
|
| - return kProminentButtonColor;
|
| + return gfx::kGoogleGreen700;
|
| }
|
| NOTREACHED();
|
| - // Use a noticeable color to help notice unhandled cases.
|
| - return SK_ColorMAGENTA;
|
| + return gfx::kPlaceholderColor;
|
| }
|
|
|
| SkColor TrayPopupItemStyle::GetIconColor() const {
|
| - return GetIconColor(theme_, color_style_);
|
| + return GetIconColor(color_style_);
|
| }
|
|
|
| void TrayPopupItemStyle::SetupLabel(views::Label* label) const {
|
|
|