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 @@ ...@@ -8,7 +8,8 @@
#include "ash/public/cpp/shelf_config.h" #include "ash/public/cpp/shelf_config.h"
#include "ash/shelf/shelf.h" #include "ash/shelf/shelf.h"
#include "ash/shelf/shelf_button_delegate.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_enums.mojom.h"
#include "ui/accessibility/ax_node_data.h" #include "ui/accessibility/ax_node_data.h"
#include "ui/views/animation/ink_drop_impl.h" #include "ui/views/animation/ink_drop_impl.h"
...@@ -22,10 +23,10 @@ ShelfButton::ShelfButton(Shelf* shelf, ...@@ -22,10 +23,10 @@ ShelfButton::ShelfButton(Shelf* shelf,
shelf_button_delegate_(shelf_button_delegate) { shelf_button_delegate_(shelf_button_delegate) {
DCHECK(shelf_button_delegate_); DCHECK(shelf_button_delegate_);
SetHideInkDropWhenShowingContextMenu(false); SetHideInkDropWhenShowingContextMenu(false);
AshColorProvider::RippleAttributes ripple_attributes = SetInkDropBaseColor(
AshColorProvider::Get()->GetRippleAttributes(); DeprecatedGetShelfInkDropBaseColor(kDefaultShelfInkDropColor));
SetInkDropBaseColor(ripple_attributes.base_color); SetInkDropVisibleOpacity(
SetInkDropVisibleOpacity(ripple_attributes.inkdrop_opacity); DeprecatedGetShelfInkDropOpacity(kDefaultShelfInkDropOpacity));
SetFocusBehavior(FocusBehavior::ALWAYS); SetFocusBehavior(FocusBehavior::ALWAYS);
SetInkDropMode(InkDropMode::ON_NO_GESTURE_HANDLER); SetInkDropMode(InkDropMode::ON_NO_GESTURE_HANDLER);
SetFocusPainter(views::Painter::CreateSolidFocusPainter( SetFocusPainter(views::Painter::CreateSolidFocusPainter(
......
...@@ -19,5 +19,7 @@ constexpr SkColor kPowerButtonMenuFullscreenShieldColor = SK_ColorBLACK; ...@@ -19,5 +19,7 @@ constexpr SkColor kPowerButtonMenuFullscreenShieldColor = SK_ColorBLACK;
constexpr SkColor kLoginShelfButtonLabelColor = gfx::kGoogleGrey100; constexpr SkColor kLoginShelfButtonLabelColor = gfx::kGoogleGrey100;
constexpr SkColor kLoginShelfButtonIconColor = SkColorSetRGB(0xEB, 0xEA, 0xED); constexpr SkColor kLoginShelfButtonIconColor = SkColorSetRGB(0xEB, 0xEA, 0xED);
constexpr SkColor kLoginBackgroundBaseColor = SK_ColorBLACK; constexpr SkColor kLoginBackgroundBaseColor = SK_ColorBLACK;
constexpr SkColor kDefaultShelfInkDropColor = SK_ColorBLACK;
constexpr float kDefaultShelfInkDropOpacity = 0.2f;
#endif // ASH_STYLE_DEFAULT_COLOR_CONSTANTS_H_ #endif // ASH_STYLE_DEFAULT_COLOR_CONSTANTS_H_
...@@ -47,4 +47,18 @@ SkColor DeprecatedGetLoginBackgroundBaseColor(SkColor default_color) { ...@@ -47,4 +47,18 @@ SkColor DeprecatedGetLoginBackgroundBaseColor(SkColor default_color) {
return AshColorProvider::Get()->GetLoginBackgroundBaseColor(); 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 } // namespace ash
...@@ -25,7 +25,8 @@ SkColor DeprecatedGetControlsLayerColor( ...@@ -25,7 +25,8 @@ SkColor DeprecatedGetControlsLayerColor(
SkColor DeprecatedGetContentLayerColor(AshColorProvider::ContentLayerType type, SkColor DeprecatedGetContentLayerColor(AshColorProvider::ContentLayerType type,
SkColor default_color); SkColor default_color);
SkColor DeprecatedGetLoginBackgroundBaseColor(SkColor default_color); SkColor DeprecatedGetLoginBackgroundBaseColor(SkColor default_color);
SkColor DeprecatedGetShelfInkDropBaseColor(SkColor default_color);
float DeprecatedGetShelfInkDropOpacity(float default_opacity);
} // namespace ash } // namespace ash
#endif // ASH_STYLE_DEFAULT_COLORS_H_ #endif // ASH_STYLE_DEFAULT_COLORS_H_
...@@ -18,7 +18,8 @@ ...@@ -18,7 +18,8 @@
#include "ash/shelf/shelf_navigation_widget.h" #include "ash/shelf/shelf_navigation_widget.h"
#include "ash/shelf/shelf_widget.h" #include "ash/shelf/shelf_widget.h"
#include "ash/shell.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/model/system_tray_model.h"
#include "ash/system/status_area_widget.h" #include "ash/system/status_area_widget.h"
#include "ash/system/status_area_widget_delegate.h" #include "ash/system/status_area_widget_delegate.h"
...@@ -160,11 +161,11 @@ TrayBackgroundView::TrayBackgroundView(Shelf* shelf) ...@@ -160,11 +161,11 @@ TrayBackgroundView::TrayBackgroundView(Shelf* shelf)
widget_observer_(new TrayWidgetObserver(this)) { widget_observer_(new TrayWidgetObserver(this)) {
DCHECK(shelf_); DCHECK(shelf_);
SetNotifyEnterExitOnChild(true); SetNotifyEnterExitOnChild(true);
AshColorProvider::RippleAttributes ripple_attributes =
AshColorProvider::Get()->GetRippleAttributes();
SetInkDropBaseColor(ripple_attributes.base_color); SetInkDropBaseColor(
SetInkDropVisibleOpacity(ripple_attributes.inkdrop_opacity); DeprecatedGetShelfInkDropBaseColor(kDefaultShelfInkDropColor));
SetInkDropVisibleOpacity(
DeprecatedGetShelfInkDropOpacity(kDefaultShelfInkDropOpacity));
SetInkDropMode(InkDropMode::ON_NO_GESTURE_HANDLER); SetInkDropMode(InkDropMode::ON_NO_GESTURE_HANDLER);
SetLayoutManager(std::make_unique<views::FillLayout>()); 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