Commit 99e4b2d5 authored by Yulun Wu's avatar Yulun Wu Committed by Commit Bot

Restore classic shelf inkdrop colors and opacity.

This addresses the changes in this CL

https://chromium-review.googlesource.com/c/chromium/src/+/2382222

Bug: 1134854
Change-Id: I193d0d73a44d858a8674f16703696da8bbcf5c24
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2447431Reviewed-by: default avatarYulun Wu <yulunwu@chromium.org>
Reviewed-by: default avatarXiyuan Xia <xiyuan@chromium.org>
Commit-Queue: Yulun Wu <yulunwu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#814003}
parent c814c493
......@@ -8,7 +8,8 @@
#include "ash/public/cpp/shelf_config.h"
#include "ash/shelf/shelf.h"
#include "ash/shelf/shelf_button_delegate.h"
#include "ash/style/ash_color_provider.h"
#include "ash/style/default_color_constants.h"
#include "ash/style/default_colors.h"
#include "ui/accessibility/ax_enums.mojom.h"
#include "ui/accessibility/ax_node_data.h"
#include "ui/views/animation/ink_drop_impl.h"
......@@ -22,10 +23,10 @@ ShelfButton::ShelfButton(Shelf* shelf,
shelf_button_delegate_(shelf_button_delegate) {
DCHECK(shelf_button_delegate_);
SetHideInkDropWhenShowingContextMenu(false);
AshColorProvider::RippleAttributes ripple_attributes =
AshColorProvider::Get()->GetRippleAttributes();
SetInkDropBaseColor(ripple_attributes.base_color);
SetInkDropVisibleOpacity(ripple_attributes.inkdrop_opacity);
SetInkDropBaseColor(
DeprecatedGetShelfInkDropBaseColor(kDefaultShelfInkDropColor));
SetInkDropVisibleOpacity(
DeprecatedGetShelfInkDropOpacity(kDefaultShelfInkDropOpacity));
SetFocusBehavior(FocusBehavior::ALWAYS);
SetInkDropMode(InkDropMode::ON_NO_GESTURE_HANDLER);
SetFocusPainter(views::Painter::CreateSolidFocusPainter(
......
......@@ -19,5 +19,7 @@ constexpr SkColor kPowerButtonMenuFullscreenShieldColor = SK_ColorBLACK;
constexpr SkColor kLoginShelfButtonLabelColor = gfx::kGoogleGrey100;
constexpr SkColor kLoginShelfButtonIconColor = SkColorSetRGB(0xEB, 0xEA, 0xED);
constexpr SkColor kLoginBackgroundBaseColor = SK_ColorBLACK;
constexpr SkColor kDefaultShelfInkDropColor = SK_ColorBLACK;
constexpr float kDefaultShelfInkDropOpacity = 0.2f;
#endif // ASH_STYLE_DEFAULT_COLOR_CONSTANTS_H_
......@@ -47,4 +47,18 @@ SkColor DeprecatedGetLoginBackgroundBaseColor(SkColor default_color) {
return AshColorProvider::Get()->GetLoginBackgroundBaseColor();
}
SkColor DeprecatedGetShelfInkDropBaseColor(SkColor default_color) {
if (!features::IsDarkLightModeEnabled())
return default_color;
return AshColorProvider::Get()->GetRippleAttributes().base_color;
}
float DeprecatedGetShelfInkDropOpacity(float default_opacity) {
if (!features::IsDarkLightModeEnabled())
return default_opacity;
return AshColorProvider::Get()->GetRippleAttributes().inkdrop_opacity;
}
} // namespace ash
......@@ -25,7 +25,8 @@ SkColor DeprecatedGetControlsLayerColor(
SkColor DeprecatedGetContentLayerColor(AshColorProvider::ContentLayerType type,
SkColor default_color);
SkColor DeprecatedGetLoginBackgroundBaseColor(SkColor default_color);
SkColor DeprecatedGetShelfInkDropBaseColor(SkColor default_color);
float DeprecatedGetShelfInkDropOpacity(float default_opacity);
} // namespace ash
#endif // ASH_STYLE_DEFAULT_COLORS_H_
......@@ -18,7 +18,8 @@
#include "ash/shelf/shelf_navigation_widget.h"
#include "ash/shelf/shelf_widget.h"
#include "ash/shell.h"
#include "ash/style/ash_color_provider.h"
#include "ash/style/default_color_constants.h"
#include "ash/style/default_colors.h"
#include "ash/system/model/system_tray_model.h"
#include "ash/system/status_area_widget.h"
#include "ash/system/status_area_widget_delegate.h"
......@@ -160,11 +161,11 @@ TrayBackgroundView::TrayBackgroundView(Shelf* shelf)
widget_observer_(new TrayWidgetObserver(this)) {
DCHECK(shelf_);
SetNotifyEnterExitOnChild(true);
AshColorProvider::RippleAttributes ripple_attributes =
AshColorProvider::Get()->GetRippleAttributes();
SetInkDropBaseColor(ripple_attributes.base_color);
SetInkDropVisibleOpacity(ripple_attributes.inkdrop_opacity);
SetInkDropBaseColor(
DeprecatedGetShelfInkDropBaseColor(kDefaultShelfInkDropColor));
SetInkDropVisibleOpacity(
DeprecatedGetShelfInkDropOpacity(kDefaultShelfInkDropOpacity));
SetInkDropMode(InkDropMode::ON_NO_GESTURE_HANDLER);
SetLayoutManager(std::make_unique<views::FillLayout>());
......
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