Commit 6627c7be authored by Maria Villarreal's avatar Maria Villarreal Committed by Commit Bot

Eliminate hardcoded SkColorSet* use from custom_frame_view

Per guidance, all the hardcoded colors in this file have new
native color IDs.

Bug: 1056950
Change-Id: I7477466b64250d049969cf3efa635e42fb819d19
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2111774Reviewed-by: default avatarPeter Kasting <pkasting@chromium.org>
Commit-Queue: Peter Kasting <pkasting@chromium.org>
Cr-Commit-Position: refs/heads/master@{#755286}
parent 67c21044
...@@ -103,6 +103,12 @@ base::Optional<SkColor> GetDarkSchemeColor(NativeTheme::ColorId color_id) { ...@@ -103,6 +103,12 @@ base::Optional<SkColor> GetDarkSchemeColor(NativeTheme::ColorId color_id) {
case NativeTheme::kColorId_MenuItemMinorTextColor: case NativeTheme::kColorId_MenuItemMinorTextColor:
return gfx::kGoogleGrey500; return gfx::kGoogleGrey500;
// Custom frame view
case NativeTheme::kColorId_CustomFrameActiveColor:
return gfx::kGoogleGrey900;
case NativeTheme::kColorId_CustomFrameInactiveColor:
return gfx::kGoogleGrey800;
// Dropdown // Dropdown
case NativeTheme::kColorId_DropdownBackgroundColor: case NativeTheme::kColorId_DropdownBackgroundColor:
return color_utils::AlphaBlend(SK_ColorWHITE, gfx::kGoogleGrey900, 0.04f); return color_utils::AlphaBlend(SK_ColorWHITE, gfx::kGoogleGrey900, 0.04f);
...@@ -309,6 +315,12 @@ SkColor GetDefaultColor(NativeTheme::ColorId color_id, ...@@ -309,6 +315,12 @@ SkColor GetDefaultColor(NativeTheme::ColorId color_id,
case NativeTheme::kColorId_MenuItemTargetAlertBackgroundColor: case NativeTheme::kColorId_MenuItemTargetAlertBackgroundColor:
return SkColorSetA(gfx::kGoogleBlue600, 0x1A); return SkColorSetA(gfx::kGoogleBlue600, 0x1A);
// Custom frame view
case NativeTheme::kColorId_CustomFrameActiveColor:
return SkColorSetRGB(0xDE, 0xE1, 0xE6);
case NativeTheme::kColorId_CustomFrameInactiveColor:
return SkColorSetRGB(0xE7, 0xEA, 0xED);
// Dropdown // Dropdown
case NativeTheme::kColorId_DropdownBackgroundColor: case NativeTheme::kColorId_DropdownBackgroundColor:
return SK_ColorWHITE; return SK_ColorWHITE;
......
...@@ -54,6 +54,9 @@ ...@@ -54,6 +54,9 @@
OP(kColorId_HighlightedMenuItemForegroundColor), \ OP(kColorId_HighlightedMenuItemForegroundColor), \
OP(kColorId_MenuItemInitialAlertBackgroundColor), \ OP(kColorId_MenuItemInitialAlertBackgroundColor), \
OP(kColorId_MenuItemTargetAlertBackgroundColor), \ OP(kColorId_MenuItemTargetAlertBackgroundColor), \
/* Custom frame view */ \
OP(kColorId_CustomFrameActiveColor), \
OP(kColorId_CustomFrameInactiveColor), \
/* Dropdown */ \ /* Dropdown */ \
OP(kColorId_DropdownBackgroundColor), \ OP(kColorId_DropdownBackgroundColor), \
OP(kColorId_DropdownForegroundColor), \ OP(kColorId_DropdownForegroundColor), \
......
...@@ -59,16 +59,6 @@ constexpr int kTitleIconOffsetX = 4; ...@@ -59,16 +59,6 @@ constexpr int kTitleIconOffsetX = 4;
// The space between the title text and the caption buttons. // The space between the title text and the caption buttons.
constexpr int kTitleCaptionSpacing = 5; constexpr int kTitleCaptionSpacing = 5;
#if defined(OS_CHROMEOS)
// Chrome OS uses a dark gray.
constexpr SkColor kDefaultColorFrame = SkColorSetRGB(109, 109, 109);
constexpr SkColor kDefaultColorFrameInactive = SkColorSetRGB(176, 176, 176);
#else
// Windows and Linux use a blue.
constexpr SkColor kDefaultColorFrame = SkColorSetRGB(66, 116, 201);
constexpr SkColor kDefaultColorFrameInactive = SkColorSetRGB(161, 182, 228);
#endif
void LayoutButton(ImageButton* button, const gfx::Rect& bounds) { void LayoutButton(ImageButton* button, const gfx::Rect& bounds) {
button->SetVisible(true); button->SetVisible(true);
button->SetImageVerticalAlignment(ImageButton::ALIGN_BOTTOM); button->SetImageVerticalAlignment(ImageButton::ALIGN_BOTTOM);
...@@ -456,7 +446,9 @@ void CustomFrameView::PaintRestoredClientEdge(gfx::Canvas* canvas) { ...@@ -456,7 +446,9 @@ void CustomFrameView::PaintRestoredClientEdge(gfx::Canvas* canvas) {
} }
SkColor CustomFrameView::GetFrameColor() const { SkColor CustomFrameView::GetFrameColor() const {
return frame_->IsActive() ? kDefaultColorFrame : kDefaultColorFrameInactive; return GetNativeTheme()->GetSystemColor(
frame_->IsActive() ? ui::NativeTheme::kColorId_CustomFrameActiveColor
: ui::NativeTheme::kColorId_CustomFrameInactiveColor);
} }
gfx::ImageSkia CustomFrameView::GetFrameImage() const { gfx::ImageSkia CustomFrameView::GetFrameImage() const {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment