Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(50)

Unified Diff: ui/views/controls/button/md_text_button.cc

Issue 2319313003: views: refactor away PlatformStyle::BackgroundColorForMdButton (Closed)
Patch Set: Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ui/views/controls/button/md_text_button.cc
diff --git a/ui/views/controls/button/md_text_button.cc b/ui/views/controls/button/md_text_button.cc
index 9e8e5104fe57436d337997a8d6e2d5b758745fe3..fc561bc710c668b95dace2ccec93cff386b6e9ac 100644
--- a/ui/views/controls/button/md_text_button.cc
+++ b/ui/views/controls/button/md_text_button.cc
@@ -312,9 +312,11 @@ void MdTextButton::UpdateColors() {
bg_color = color_utils::BlendTowardOppositeLuma(text_color, 0xD8);
}
- // TODO(ellyjones): Excise this, in favor of a helper function wrapping
- // |color_utils::AlphaBlend| and a new NativeTheme color constant.
- bg_color = PlatformStyle::BackgroundColorForMdButton(bg_color, state());
+ if (state() == STATE_PRESSED) {
+ SkColor shade =
+ theme->GetSystemColor(ui::NativeTheme::kColorId_ButtonPressedShade);
+ bg_color = color_utils::ImplicitAlphaBlend(shade, bg_color);
+ }
const SkAlpha kStrokeOpacity = 0x1A;
SkColor stroke_color = (is_cta_ || color_utils::IsDark(text_color))

Powered by Google App Engine
This is Rietveld 408576698