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

Unified Diff: chrome/browser/ui/views/download/download_shelf_view.cc

Issue 2400563004: Adjust shadow and stroke of MdTextButton. (Closed)
Patch Set: fix sdl shelf Created 4 years, 2 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: chrome/browser/ui/views/download/download_shelf_view.cc
diff --git a/chrome/browser/ui/views/download/download_shelf_view.cc b/chrome/browser/ui/views/download/download_shelf_view.cc
index 6bce8b37cb8926dc311a919dd0d5890f6c135d9b..65c1164a867bf998ff49e245123da687e8c6a7b8 100644
--- a/chrome/browser/ui/views/download/download_shelf_view.cc
+++ b/chrome/browser/ui/views/download/download_shelf_view.cc
@@ -12,6 +12,8 @@
#include "chrome/browser/download/download_item_model.h"
#include "chrome/browser/download/download_stats.h"
#include "chrome/browser/themes/theme_properties.h"
+#include "chrome/browser/themes/theme_service.h"
+#include "chrome/browser/themes/theme_service_factory.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/chrome_pages.h"
#include "chrome/browser/ui/view_ids.h"
@@ -309,10 +311,22 @@ bool DownloadShelfView::CanFitFirstDownloadItem() {
void DownloadShelfView::UpdateColorsFromTheme() {
if (show_all_view_ && close_button_ && GetThemeProvider()) {
- set_background(views::Background::CreateSolidBackground(
- GetThemeProvider()->GetColor(ThemeProperties::COLOR_TOOLBAR)));
+ const SkColor bg_color =
+ GetThemeProvider()->GetColor(ThemeProperties::COLOR_TOOLBAR);
+ set_background(views::Background::CreateSolidBackground(bg_color));
show_all_view_->SetEnabledTextColors(
GetThemeProvider()->GetColor(ThemeProperties::COLOR_BOOKMARK_TEXT));
+ if (ThemeServiceFactory::GetForProfile(browser_->profile())
+ ->UsingDefaultTheme()) {
+ // For the normal theme, just use the default button bg color.
+ show_all_view_->SetBgColorOverride(base::Optional<SkColor>());
+ } else {
+ // For custom themes, we have to make up a background color for the
+ // button. Use a slight tint of the shelf background.
+ show_all_view_->SetBgColorOverride(
+ color_utils::BlendTowardOppositeLuma(bg_color, 0x10));
+ }
+ show_all_view_->SchedulePaint();
sky 2016/10/06 17:09:45 In general I would expect changing properties on v
Evan Stade 2016/10/06 17:43:37 this was leftover from a previous iteration of the
}
}

Powered by Google App Engine
This is Rietveld 408576698