Commit 6dd6a6ad authored by minch's avatar minch Committed by Commit Bot

dark_mode: Add kCurrentDeskColor for active desk.

Bug: 1131543
Change-Id: I5726d096eb6e18f25435c92b8ac26a01129d8564
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2493780Reviewed-by: default avatarAhmed Fakhry <afakhry@chromium.org>
Commit-Queue: Min Chen <minch@chromium.org>
Cr-Commit-Position: refs/heads/master@{#820292}
parent ed37c35d
...@@ -234,6 +234,8 @@ SkColor AshColorProvider::GetContentLayerColor(ContentLayerType type) const { ...@@ -234,6 +234,8 @@ SkColor AshColorProvider::GetContentLayerColor(ContentLayerType type) const {
case ContentLayerType::kAppStateIndicatorColorInactive: case ContentLayerType::kAppStateIndicatorColorInactive:
return GetDisabledColor( return GetDisabledColor(
GetContentLayerColor(ContentLayerType::kAppStateIndicatorColor)); GetContentLayerColor(ContentLayerType::kAppStateIndicatorColor));
case ContentLayerType::kCurrentDeskColor:
return is_dark_mode ? SK_ColorWHITE : SK_ColorBLACK;
default: default:
return ResolveColor(type, is_dark_mode); return ResolveColor(type, is_dark_mode);
} }
......
...@@ -120,6 +120,9 @@ class ASH_EXPORT AshColorProvider : public SessionObserver { ...@@ -120,6 +120,9 @@ class ASH_EXPORT AshColorProvider : public SessionObserver {
// Color for radio button. // Color for radio button.
kRadioColorActive, kRadioColorActive,
kRadioColorInactive, kRadioColorInactive,
// Color for current active desk's border.
kCurrentDeskColor,
}; };
// Attributes of ripple, includes the base color, opacity of inkdrop and // Attributes of ripple, includes the base color, opacity of inkdrop and
......
...@@ -23,7 +23,6 @@ ...@@ -23,7 +23,6 @@
#include "ui/aura/window.h" #include "ui/aura/window.h"
#include "ui/base/l10n/l10n_util.h" #include "ui/base/l10n/l10n_util.h"
#include "ui/gfx/canvas.h" #include "ui/gfx/canvas.h"
#include "ui/gfx/color_palette.h"
#include "ui/views/widget/widget.h" #include "ui/views/widget/widget.h"
#include "ui/wm/core/coordinate_conversion.h" #include "ui/wm/core/coordinate_conversion.h"
...@@ -37,11 +36,6 @@ constexpr int kCloseButtonMargin = 8; ...@@ -37,11 +36,6 @@ constexpr int kCloseButtonMargin = 8;
constexpr int kMinDeskNameViewWidth = 20; constexpr int kMinDeskNameViewWidth = 20;
// TODO(minch): Use a color id in AshColorProvider instead.
constexpr SkColor kDarkModeActiveColor = SK_ColorWHITE;
constexpr SkColor kLightModeActiveColor = SK_ColorBLACK;
constexpr SkColor kInactiveColor = SK_ColorTRANSPARENT;
// Returns the width of the desk preview based on its |preview_height| and the // Returns the width of the desk preview based on its |preview_height| and the
// aspect ratio of the root window taken from |root_window_size|. // aspect ratio of the root window taken from |root_window_size|.
int GetPreviewWidth(const gfx::Size& root_window_size, int preview_height) { int GetPreviewWidth(const gfx::Size& root_window_size, int preview_height) {
...@@ -140,12 +134,10 @@ void DeskMiniView::UpdateBorderColor() { ...@@ -140,12 +134,10 @@ void DeskMiniView::UpdateBorderColor() {
desk_preview_->SetBorderColor(color_provider->GetControlsLayerColor( desk_preview_->SetBorderColor(color_provider->GetControlsLayerColor(
AshColorProvider::ControlsLayerType::kFocusRingColor)); AshColorProvider::ControlsLayerType::kFocusRingColor));
} else if (!desk_->is_active()) { } else if (!desk_->is_active()) {
desk_preview_->SetBorderColor(kInactiveColor); desk_preview_->SetBorderColor(SK_ColorTRANSPARENT);
} else { } else {
// Default theme for desks is dark mode. desk_preview_->SetBorderColor(color_provider->GetContentLayerColor(
desk_preview_->SetBorderColor(color_provider->IsDarkModeEnabled() AshColorProvider::ContentLayerType::kCurrentDeskColor));
? kDarkModeActiveColor
: kLightModeActiveColor);
} }
} }
......
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