Commit 7afb4f39 authored by Peter Kasting's avatar Peter Kasting Committed by Commit Bot

Tint background tabs like the frame by default in refresh.

This means themes which do not set a background tab tint or image will get
background tabs that blend into the frame, just like the default theme.

Bug: 866672
Change-Id: I9ad1544f6fbc3b6bcc134312fab329d7f4554694
Reviewed-on: https://chromium-review.googlesource.com/1152522
Commit-Queue: Peter Kasting <pkasting@chromium.org>
Reviewed-by: default avatarEvan Stade <estade@chromium.org>
Reviewed-by: default avatarBret Sepulveda <bsep@chromium.org>
Cr-Commit-Position: refs/heads/master@{#578935}
parent 7a680366
......@@ -21,6 +21,8 @@
namespace {
using MD = ui::MaterialDesignController;
// ----------------------------------------------------------------------------
// Defaults for properties which are stored in the browser theme pack. If you
// change these defaults, you must increment the version number in
......@@ -90,7 +92,8 @@ constexpr color_utils::HSL kDefaultTintFrame = {-1, -1, -1};
constexpr color_utils::HSL kDefaultTintFrameInactive = {-1, -1, 0.75};
constexpr color_utils::HSL kDefaultTintFrameIncognito = {-1, 0.2, 0.35};
constexpr color_utils::HSL kDefaultTintFrameIncognitoInactive = {-1, 0.3, 0.6};
constexpr color_utils::HSL kDefaultTintBackgroundTab = {-1, -1, 0.75};
constexpr color_utils::HSL kDefaultTintBackgroundTab = {-1, -1, -1};
constexpr color_utils::HSL kPreRefreshDefaultTintBackgroundTab = {-1, -1, 0.75};
constexpr SkColor kDefaultColorTabAlertRecordingIcon =
SkColorSetRGB(0xC5, 0x39, 0x29);
......@@ -147,7 +150,7 @@ constexpr char kTilingRepeat[] = "repeat";
// touch-optimized UI).
base::Optional<SkColor> MaybeGetDefaultColorForNewerMaterialUi(int id,
bool incognito) {
if (!ui::MaterialDesignController::IsNewerMaterialUi())
if (!MD::IsNewerMaterialUi())
return base::nullopt;
switch (id) {
......@@ -264,11 +267,13 @@ color_utils::HSL ThemeProperties::GetDefaultTint(int id, bool incognito) {
return incognito ? kDefaultTintFrameIncognitoInactive
: kDefaultTintFrameInactive;
case TINT_BUTTONS:
if (incognito && !ui::MaterialDesignController::IsRefreshUi())
return kPreRefreshDefaultTintButtonsIncognito;
return incognito ? kDefaultTintButtonsIncognito : kDefaultTintButtons;
if (!incognito)
return kDefaultTintButtons;
return MD::IsRefreshUi() ? kDefaultTintButtonsIncognito
: kPreRefreshDefaultTintButtonsIncognito;
case TINT_BACKGROUND_TAB:
return kDefaultTintBackgroundTab;
return MD::IsRefreshUi() ? kDefaultTintBackgroundTab
: kPreRefreshDefaultTintBackgroundTab;
case TINT_FRAME_INCOGNITO:
case TINT_FRAME_INCOGNITO_INACTIVE:
NOTREACHED() << "These values should be queried via their respective "
......
......@@ -109,7 +109,7 @@ gfx::ImageSkia BrowserNonClientFrameView::GetIncognitoAvatarIcon() const {
}
SkColor BrowserNonClientFrameView::GetToolbarTopSeparatorColor() const {
const auto color_id =
const int color_id =
ShouldPaintAsActive()
? ThemeProperties::COLOR_TOOLBAR_TOP_SEPARATOR
: ThemeProperties::COLOR_TOOLBAR_TOP_SEPARATOR_INACTIVE;
......@@ -137,7 +137,9 @@ SkColor BrowserNonClientFrameView::GetTabBackgroundColor(TabState state) const {
// color instead of COLOR_BACKGROUND_TAB; these will differ for single-tab
// mode and custom window frame colors.
return (MD::IsRefreshUi() && !tp->HasCustomColor(color_id))
? GetFrameColor()
? color_utils::HSLShift(
GetFrameColor(),
tp->GetTint(ThemeProperties::TINT_BACKGROUND_TAB))
: GetThemeOrDefaultColor(color_id);
}
......
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