Commit 891937d8 authored by minch's avatar minch Committed by Commit Bot

dark_mode: Back gesture nudge gets colors from AshColorProvider.

Please check the specs in the crbug.

Bug: 1128755
Change-Id: Ic5170b1e632bb54819a2336186dd1c9cc830203d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2461177Reviewed-by: default avatarAhmed Fakhry <afakhry@chromium.org>
Commit-Queue: Min Chen <minch@chromium.org>
Cr-Commit-Position: refs/heads/master@{#815789}
parent f6984134
......@@ -33,4 +33,8 @@ constexpr SkColor kArrowColorAfterActivated = gfx::kGoogleGrey100;
const SkColor kBackgroundColorBeforeActivated = SK_ColorWHITE;
const SkColor kBackgroundColorAfterActivated = gfx::kGoogleBlue600;
// Colors for back gesture nudge.
constexpr SkColor kCircleColor = SK_ColorWHITE;
constexpr SkColor kLabelBackgroundColor = SkColorSetA(SK_ColorBLACK, 0xDE);
#endif // ASH_STYLE_DEFAULT_COLOR_CONSTANTS_H_
......@@ -167,7 +167,7 @@ class AffordanceView : public views::View {
kControlBackgroundColorActive,
kBackgroundColorAfterActivated)
: DeprecatedGetBaseLayerColor(
AshColorProvider::BaseLayerType::kTransparent80,
AshColorProvider::BaseLayerType::kOpaque,
kBackgroundColorBeforeActivated));
canvas->DrawCircle(center_point, kBackgroundRadius, bg_flags);
......
......@@ -9,6 +9,9 @@
#include "ash/shelf/contextual_tooltip.h"
#include "ash/shell.h"
#include "ash/strings/grit/ash_strings.h"
#include "ash/style/ash_color_provider.h"
#include "ash/style/default_color_constants.h"
#include "ash/style/default_colors.h"
#include "base/callback.h"
#include "base/i18n/rtl.h"
#include "base/timer/timer.h"
......@@ -32,21 +35,12 @@ constexpr int kBackgroundWidth = 320;
// Radius of the circle in the middle of the contextual nudge.
constexpr int kCircleRadius = 20;
// Color of the circle in the middle of the contextual nudge.
constexpr SkColor kCircleColor = SK_ColorWHITE;
// Width of the circle that inside the screen at the beginning.
constexpr int kCircleInsideScreenWidth = 12;
// Padding between the circle and the label.
constexpr int kPaddingBetweenCircleAndLabel = 8;
// Color of the label.
constexpr SkColor kLabelColor = gfx::kGoogleGrey200;
// Color of the label background.
constexpr SkColor kLabelBackgroundColor = SkColorSetA(SK_ColorBLACK, 0xDE);
// Line height of the label.
constexpr int kLabelLineHeight = 18;
......@@ -193,7 +187,8 @@ class BackGestureContextualNudge::ContextualNudgeView
label_ = AddChildView(std::make_unique<views::Label>());
label_->SetBackgroundColor(SK_ColorTRANSPARENT);
label_->SetEnabledColor(kLabelColor);
label_->SetEnabledColor(AshColorProvider::Get()->GetContentLayerColor(
AshColorProvider::ContentLayerType::kTextColorPrimary));
label_->SetText(l10n_util::GetStringUTF16(
base::i18n::IsRTL() ? IDS_ASH_BACK_GESTURE_CONTEXTUAL_NUDGE_RTL
: IDS_ASH_BACK_GESTURE_CONTEXTUAL_NUDGE));
......@@ -255,7 +250,8 @@ class BackGestureContextualNudge::ContextualNudgeView
cc::PaintFlags circle_flags;
circle_flags.setAntiAlias(true);
circle_flags.setStyle(cc::PaintFlags::kFill_Style);
circle_flags.setColor(kCircleColor);
circle_flags.setColor(DeprecatedGetBaseLayerColor(
AshColorProvider::BaseLayerType::kOpaque, kCircleColor));
gfx::ShadowValues shadows;
shadows.push_back(gfx::ShadowValue(
gfx::Vector2d(0, kBackNudgeShadowOffsetY1),
......@@ -280,7 +276,9 @@ class BackGestureContextualNudge::ContextualNudgeView
cc::PaintFlags round_rect_flags;
round_rect_flags.setStyle(cc::PaintFlags::kFill_Style);
round_rect_flags.setAntiAlias(true);
round_rect_flags.setColor(kLabelBackgroundColor);
round_rect_flags.setColor(DeprecatedGetBaseLayerColor(
AshColorProvider::BaseLayerType::kTransparent80,
kLabelBackgroundColor));
gfx::Rect label_bounds(label_->GetMirroredBounds());
label_bounds.Inset(/*horizontal=*/-kLabelCornerRadius,
/*vertical=*/-kLabelTopBottomInset);
......
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