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

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

Issue 2319313003: views: refactor away PlatformStyle::BackgroundColorForMdButton (Closed)
Patch Set: nits and rename 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
« no previous file with comments | « ui/native_theme/native_theme_mac.mm ('k') | ui/views/style/platform_style.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..3e582db3ca6957318412b8a37b1d2f823aad429d 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::GetResultingPaintColor(shade, bg_color);
+ }
const SkAlpha kStrokeOpacity = 0x1A;
SkColor stroke_color = (is_cta_ || color_utils::IsDark(text_color))
« no previous file with comments | « ui/native_theme/native_theme_mac.mm ('k') | ui/views/style/platform_style.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698