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

dark_mode: No deprecated separator colors.

kSeparatorOnLightBackgroundColor and kSeparatorOnDarkBackgroundColor
inside default_color_constants.h are actually not needed. Their colors
are the same as AshColorProvider::ContentLayerType::kSeperator.

Bug: 982950
Change-Id: Iba8c638db130d3cebb22008696d115c31697c86b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1761105Reviewed-by: default avatarXiyuan Xia <xiyuan@chromium.org>
Commit-Queue: Min Chen <minch@chromium.org>
Cr-Commit-Position: refs/heads/master@{#688704}
parent 4530f7b7
...@@ -20,12 +20,6 @@ constexpr SkColor kUnifiedMenuBackgroundColor = ...@@ -20,12 +20,6 @@ constexpr SkColor kUnifiedMenuBackgroundColor =
constexpr SkColor kUnifiedMenuBackgroundColorWithBlur = constexpr SkColor kUnifiedMenuBackgroundColorWithBlur =
SkColorSetA(kUnifiedMenuBackgroundColor, 0x99); // 60% SkColorSetA(kUnifiedMenuBackgroundColor, 0x99); // 60%
// Colors of separator on light/dark background.
constexpr SkColor kSeparatorOnLightBackgroundColor =
SkColorSetA(SK_ColorBLACK, 0x23); // 14%
constexpr SkColor kSeparatorOnDarkBackgroundColor =
SkColorSetA(SK_ColorWHITE, 0x23); // 14%
constexpr SkColor kNotificationBackgroundColor = SK_ColorWHITE; constexpr SkColor kNotificationBackgroundColor = SK_ColorWHITE;
constexpr SkColor kUnifiedMenuTextColor = gfx::kGoogleGrey100; constexpr SkColor kUnifiedMenuTextColor = gfx::kGoogleGrey100;
......
...@@ -9,7 +9,6 @@ ...@@ -9,7 +9,6 @@
#include "ash/shell.h" #include "ash/shell.h"
#include "ash/strings/grit/ash_strings.h" #include "ash/strings/grit/ash_strings.h"
#include "ash/style/ash_color_provider.h" #include "ash/style/ash_color_provider.h"
#include "ash/style/default_color_constants.h"
#include "ash/system/tray/tray_constants.h" #include "ash/system/tray/tray_constants.h"
#include "ash/system/unified/top_shortcut_button.h" #include "ash/system/unified/top_shortcut_button.h"
#include "base/metrics/histogram_macros.h" #include "base/metrics/histogram_macros.h"
...@@ -220,9 +219,9 @@ AutoclickMenuView::AutoclickMenuView(AutoclickEventType type, ...@@ -220,9 +219,9 @@ AutoclickMenuView::AutoclickMenuView(AutoclickEventType type,
AddChildView(action_button_container); AddChildView(action_button_container);
views::Separator* separator = new views::Separator(); views::Separator* separator = new views::Separator();
separator->SetColor(AshColorProvider::Get()->DeprecatedGetContentLayerColor( separator->SetColor(AshColorProvider::Get()->GetContentLayerColor(
AshColorProvider::ContentLayerType::kSeparator, AshColorProvider::ContentLayerType::kSeparator,
kSeparatorOnDarkBackgroundColor)); AshColorProvider::AshColorMode::kDark));
separator->SetPreferredHeight(kSeparatorHeight); separator->SetPreferredHeight(kSeparatorHeight);
int total_height = kUnifiedTopShortcutSpacing * 2 + kTrayItemSize; int total_height = kUnifiedTopShortcutSpacing * 2 + kTrayItemSize;
int separator_spacing = (total_height - kSeparatorHeight) / 2; int separator_spacing = (total_height - kSeparatorHeight) / 2;
......
...@@ -18,7 +18,6 @@ ...@@ -18,7 +18,6 @@
#include "ash/shell.h" #include "ash/shell.h"
#include "ash/strings/grit/ash_strings.h" #include "ash/strings/grit/ash_strings.h"
#include "ash/style/ash_color_provider.h" #include "ash/style/ash_color_provider.h"
#include "ash/style/default_color_constants.h"
#include "ash/system/ime_menu/ime_list_view.h" #include "ash/system/ime_menu/ime_list_view.h"
#include "ash/system/model/system_tray_model.h" #include "ash/system/model/system_tray_model.h"
#include "ash/system/tray/detailed_view_delegate.h" #include "ash/system/tray/detailed_view_delegate.h"
...@@ -130,9 +129,9 @@ class ImeTitleView : public views::View, public views::ButtonListener { ...@@ -130,9 +129,9 @@ class ImeTitleView : public views::View, public views::ButtonListener {
SetBorder(views::CreatePaddedBorder( SetBorder(views::CreatePaddedBorder(
views::CreateSolidSidedBorder( views::CreateSolidSidedBorder(
0, 0, kMenuSeparatorWidth, 0, 0, 0, kMenuSeparatorWidth, 0,
AshColorProvider::Get()->DeprecatedGetContentLayerColor( AshColorProvider::Get()->GetContentLayerColor(
AshColorProvider::ContentLayerType::kSeparator, AshColorProvider::ContentLayerType::kSeparator,
kSeparatorOnLightBackgroundColor)), AshColorProvider::AshColorMode::kLight)),
gfx::Insets(kMenuSeparatorVerticalPadding - kMenuSeparatorWidth, 0))); gfx::Insets(kMenuSeparatorVerticalPadding - kMenuSeparatorWidth, 0)));
auto box_layout = std::make_unique<views::BoxLayout>( auto box_layout = std::make_unique<views::BoxLayout>(
views::BoxLayout::Orientation::kHorizontal); views::BoxLayout::Orientation::kHorizontal);
...@@ -236,9 +235,9 @@ class ImeButtonsView : public views::View, public views::ButtonListener { ...@@ -236,9 +235,9 @@ class ImeButtonsView : public views::View, public views::ButtonListener {
SetBorder(views::CreatePaddedBorder( SetBorder(views::CreatePaddedBorder(
views::CreateSolidSidedBorder( views::CreateSolidSidedBorder(
kMenuSeparatorWidth, 0, 0, 0, kMenuSeparatorWidth, 0, 0, 0,
AshColorProvider::Get()->DeprecatedGetContentLayerColor( AshColorProvider::Get()->GetContentLayerColor(
AshColorProvider::ContentLayerType::kSeparator, AshColorProvider::ContentLayerType::kSeparator,
kSeparatorOnLightBackgroundColor)), AshColorProvider::AshColorMode::kLight)),
gfx::Insets(kMenuSeparatorVerticalPadding - kMenuSeparatorWidth, gfx::Insets(kMenuSeparatorVerticalPadding - kMenuSeparatorWidth,
kMenuExtraMarginFromLeftEdge))); kMenuExtraMarginFromLeftEdge)));
......
...@@ -254,9 +254,9 @@ void StackingNotificationCounterView::OnPaint(gfx::Canvas* canvas) { ...@@ -254,9 +254,9 @@ void StackingNotificationCounterView::OnPaint(gfx::Canvas* canvas) {
canvas->DrawSharpLine( canvas->DrawSharpLine(
gfx::PointF(bounds.bottom_left() - gfx::Vector2d(0, 1)), gfx::PointF(bounds.bottom_left() - gfx::Vector2d(0, 1)),
gfx::PointF(bounds.bottom_right() - gfx::Vector2d(0, 1)), gfx::PointF(bounds.bottom_right() - gfx::Vector2d(0, 1)),
AshColorProvider::Get()->DeprecatedGetContentLayerColor( AshColorProvider::Get()->GetContentLayerColor(
AshColorProvider::ContentLayerType::kSeparator, AshColorProvider::ContentLayerType::kSeparator,
kSeparatorOnLightBackgroundColor)); AshColorProvider::AshColorMode::kLight));
} }
const char* StackingNotificationCounterView::GetClassName() const { const char* StackingNotificationCounterView::GetClassName() const {
......
...@@ -6,7 +6,6 @@ ...@@ -6,7 +6,6 @@
#include "ash/public/cpp/ash_features.h" #include "ash/public/cpp/ash_features.h"
#include "ash/style/ash_color_provider.h" #include "ash/style/ash_color_provider.h"
#include "ash/style/default_color_constants.h"
#include "ash/system/message_center/message_center_style.h" #include "ash/system/message_center/message_center_style.h"
#include "ash/system/message_center/notification_swipe_control_view.h" #include "ash/system/message_center/notification_swipe_control_view.h"
#include "ash/system/message_center/unified_message_center_view.h" #include "ash/system/message_center/unified_message_center_view.h"
...@@ -106,9 +105,9 @@ class UnifiedMessageListView::MessageViewContainer ...@@ -106,9 +105,9 @@ class UnifiedMessageListView::MessageViewContainer
is_bottom ? views::NullBorder() is_bottom ? views::NullBorder()
: views::CreateSolidSidedBorder( : views::CreateSolidSidedBorder(
0, 0, kUnifiedNotificationSeparatorThickness, 0, 0, 0, kUnifiedNotificationSeparatorThickness, 0,
AshColorProvider::Get()->DeprecatedGetContentLayerColor( AshColorProvider::Get()->GetContentLayerColor(
AshColorProvider::ContentLayerType::kSeparator, AshColorProvider::ContentLayerType::kSeparator,
kSeparatorOnLightBackgroundColor))); AshColorProvider::AshColorMode::kLight)));
const int top_radius = is_top ? kUnifiedTrayCornerRadius : 0; const int top_radius = is_top ? kUnifiedTrayCornerRadius : 0;
const int bottom_radius = is_bottom ? kUnifiedTrayCornerRadius : 0; const int bottom_radius = is_bottom ? kUnifiedTrayCornerRadius : 0;
message_view_->UpdateCornerRadius(top_radius, bottom_radius); message_view_->UpdateCornerRadius(top_radius, bottom_radius);
......
...@@ -17,7 +17,6 @@ ...@@ -17,7 +17,6 @@
#include "ash/shell.h" #include "ash/shell.h"
#include "ash/strings/grit/ash_strings.h" #include "ash/strings/grit/ash_strings.h"
#include "ash/style/ash_color_provider.h" #include "ash/style/ash_color_provider.h"
#include "ash/style/default_color_constants.h"
#include "ash/system/model/system_tray_model.h" #include "ash/system/model/system_tray_model.h"
#include "ash/system/palette/palette_tool_manager.h" #include "ash/system/palette/palette_tool_manager.h"
#include "ash/system/palette/palette_utils.h" #include "ash/system/palette/palette_utils.h"
...@@ -497,9 +496,9 @@ void PaletteTray::ShowBubble(bool show_by_click) { ...@@ -497,9 +496,9 @@ void PaletteTray::ShowBubble(bool show_by_click) {
// Add horizontal separator between the title and tools. // Add horizontal separator between the title and tools.
auto* separator = new views::Separator(); auto* separator = new views::Separator();
separator->SetColor(AshColorProvider::Get()->DeprecatedGetContentLayerColor( separator->SetColor(AshColorProvider::Get()->GetContentLayerColor(
AshColorProvider::ContentLayerType::kSeparator, AshColorProvider::ContentLayerType::kSeparator,
kSeparatorOnLightBackgroundColor)); AshColorProvider::AshColorMode::kLight));
separator->SetBorder(views::CreateEmptyBorder(gfx::Insets( separator->SetBorder(views::CreateEmptyBorder(gfx::Insets(
kPaddingBetweenTitleAndSeparator, 0, kMenuSeparatorVerticalPadding, 0))); kPaddingBetweenTitleAndSeparator, 0, kMenuSeparatorVerticalPadding, 0)));
bubble_view->AddChildView(separator); bubble_view->AddChildView(separator);
......
...@@ -7,7 +7,6 @@ ...@@ -7,7 +7,6 @@
#include "ash/resources/vector_icons/vector_icons.h" #include "ash/resources/vector_icons/vector_icons.h"
#include "ash/strings/grit/ash_strings.h" #include "ash/strings/grit/ash_strings.h"
#include "ash/style/ash_color_provider.h" #include "ash/style/ash_color_provider.h"
#include "ash/style/default_color_constants.h"
#include "ash/system/tray/hover_highlight_view.h" #include "ash/system/tray/hover_highlight_view.h"
#include "ash/system/tray/tray_constants.h" #include "ash/system/tray/tray_constants.h"
#include "ash/system/tray/tray_popup_item_style.h" #include "ash/system/tray/tray_popup_item_style.h"
...@@ -152,8 +151,8 @@ TriView* DetailedViewDelegate::CreateTitleRow(int string_id) { ...@@ -152,8 +151,8 @@ TriView* DetailedViewDelegate::CreateTitleRow(int string_id) {
views::View* DetailedViewDelegate::CreateTitleSeparator() { views::View* DetailedViewDelegate::CreateTitleSeparator() {
views::Separator* separator = new views::Separator(); views::Separator* separator = new views::Separator();
separator->SetColor(AshColorProvider::Get()->DeprecatedGetContentLayerColor( separator->SetColor(AshColorProvider::Get()->GetContentLayerColor(
ContentLayerType::kSeparator, kSeparatorOnDarkBackgroundColor)); ContentLayerType::kSeparator, AshColorMode::kDark));
separator->SetBorder(views::CreateEmptyBorder( separator->SetBorder(views::CreateEmptyBorder(
kTitleRowProgressBarHeight - views::Separator::kThickness, 0, 0, 0)); kTitleRowProgressBarHeight - views::Separator::kThickness, 0, 0, 0));
return separator; return separator;
...@@ -165,8 +164,8 @@ void DetailedViewDelegate::ShowStickyHeaderSeparator(views::View* view, ...@@ -165,8 +164,8 @@ void DetailedViewDelegate::ShowStickyHeaderSeparator(views::View* view,
view->SetBorder(views::CreatePaddedBorder( view->SetBorder(views::CreatePaddedBorder(
views::CreateSolidSidedBorder( views::CreateSolidSidedBorder(
0, 0, kTraySeparatorWidth, 0, 0, 0, kTraySeparatorWidth, 0,
AshColorProvider::Get()->DeprecatedGetContentLayerColor( AshColorProvider::Get()->GetContentLayerColor(
ContentLayerType::kSeparator, kSeparatorOnDarkBackgroundColor)), ContentLayerType::kSeparator, AshColorMode::kDark)),
gfx::Insets(kMenuSeparatorVerticalPadding, 0, gfx::Insets(kMenuSeparatorVerticalPadding, 0,
kMenuSeparatorVerticalPadding - kTraySeparatorWidth, 0))); kMenuSeparatorVerticalPadding - kTraySeparatorWidth, 0)));
} else { } else {
...@@ -178,8 +177,8 @@ void DetailedViewDelegate::ShowStickyHeaderSeparator(views::View* view, ...@@ -178,8 +177,8 @@ void DetailedViewDelegate::ShowStickyHeaderSeparator(views::View* view,
views::Separator* DetailedViewDelegate::CreateListSubHeaderSeparator() { views::Separator* DetailedViewDelegate::CreateListSubHeaderSeparator() {
views::Separator* separator = new views::Separator(); views::Separator* separator = new views::Separator();
separator->SetColor(AshColorProvider::Get()->DeprecatedGetContentLayerColor( separator->SetColor(AshColorProvider::Get()->GetContentLayerColor(
ContentLayerType::kSeparator, kSeparatorOnDarkBackgroundColor)); ContentLayerType::kSeparator, AshColorMode::kDark));
separator->SetBorder(views::CreateEmptyBorder( separator->SetBorder(views::CreateEmptyBorder(
kMenuSeparatorVerticalPadding - views::Separator::kThickness, 0, 0, 0)); kMenuSeparatorVerticalPadding - views::Separator::kThickness, 0, 0, 0));
return separator; return separator;
......
...@@ -9,7 +9,6 @@ ...@@ -9,7 +9,6 @@
#include "ash/public/cpp/ash_view_ids.h" #include "ash/public/cpp/ash_view_ids.h"
#include "ash/strings/grit/ash_strings.h" #include "ash/strings/grit/ash_strings.h"
#include "ash/style/ash_color_provider.h" #include "ash/style/ash_color_provider.h"
#include "ash/style/default_color_constants.h"
#include "ash/system/tray/detailed_view_delegate.h" #include "ash/system/tray/detailed_view_delegate.h"
#include "ash/system/tray/hover_highlight_view.h" #include "ash/system/tray/hover_highlight_view.h"
#include "ash/system/tray/system_menu_button.h" #include "ash/system/tray/system_menu_button.h"
...@@ -244,9 +243,9 @@ class ScrollContentsView : public views::View { ...@@ -244,9 +243,9 @@ class ScrollContentsView : public views::View {
cc::PaintFlags flags; cc::PaintFlags flags;
gfx::ShadowValues shadow; gfx::ShadowValues shadow;
shadow.emplace_back(gfx::Vector2d(0, kShadowOffsetY), kShadowBlur, shadow.emplace_back(gfx::Vector2d(0, kShadowOffsetY), kShadowBlur,
AshColorProvider::Get()->DeprecatedGetContentLayerColor( AshColorProvider::Get()->GetContentLayerColor(
AshColorProvider::ContentLayerType::kSeparator, AshColorProvider::ContentLayerType::kSeparator,
kSeparatorOnDarkBackgroundColor)); AshColorProvider::AshColorMode::kDark));
flags.setLooper(gfx::CreateShadowDrawLooper(shadow)); flags.setLooper(gfx::CreateShadowDrawLooper(shadow));
flags.setAntiAlias(true); flags.setAntiAlias(true);
canvas->ClipRect(shadowed_area, SkClipOp::kDifference); canvas->ClipRect(shadowed_area, SkClipOp::kDifference);
......
...@@ -226,9 +226,9 @@ views::LabelButton* TrayPopupUtils::CreateTrayPopupButton( ...@@ -226,9 +226,9 @@ views::LabelButton* TrayPopupUtils::CreateTrayPopupButton(
views::Separator* TrayPopupUtils::CreateVerticalSeparator() { views::Separator* TrayPopupUtils::CreateVerticalSeparator() {
views::Separator* separator = new views::Separator(); views::Separator* separator = new views::Separator();
separator->SetPreferredHeight(24); separator->SetPreferredHeight(24);
separator->SetColor(AshColorProvider::Get()->DeprecatedGetContentLayerColor( separator->SetColor(AshColorProvider::Get()->GetContentLayerColor(
AshColorProvider::ContentLayerType::kSeparator, AshColorProvider::ContentLayerType::kSeparator,
kSeparatorOnLightBackgroundColor)); AshColorProvider::AshColorMode::kLight));
return separator; return separator;
} }
...@@ -319,9 +319,9 @@ gfx::Rect TrayPopupUtils::GetInkDropBounds(TrayPopupInkDropStyle ink_drop_style, ...@@ -319,9 +319,9 @@ gfx::Rect TrayPopupUtils::GetInkDropBounds(TrayPopupInkDropStyle ink_drop_style,
views::Separator* TrayPopupUtils::CreateListItemSeparator(bool left_inset) { views::Separator* TrayPopupUtils::CreateListItemSeparator(bool left_inset) {
views::Separator* separator = new views::Separator(); views::Separator* separator = new views::Separator();
separator->SetColor(AshColorProvider::Get()->DeprecatedGetContentLayerColor( separator->SetColor(AshColorProvider::Get()->GetContentLayerColor(
AshColorProvider::ContentLayerType::kSeparator, AshColorProvider::ContentLayerType::kSeparator,
kSeparatorOnLightBackgroundColor)); AshColorProvider::AshColorMode::kLight));
separator->SetBorder(views::CreateEmptyBorder( separator->SetBorder(views::CreateEmptyBorder(
kMenuSeparatorVerticalPadding - views::Separator::kThickness, kMenuSeparatorVerticalPadding - views::Separator::kThickness,
left_inset left_inset
......
...@@ -398,8 +398,8 @@ UnifiedSystemInfoView::UnifiedSystemInfoView( ...@@ -398,8 +398,8 @@ UnifiedSystemInfoView::UnifiedSystemInfoView(
if (PowerStatus::Get()->IsBatteryPresent()) { if (PowerStatus::Get()->IsBatteryPresent()) {
auto* separator = new views::Separator(); auto* separator = new views::Separator();
separator->SetColor(AshColorProvider::Get()->DeprecatedGetContentLayerColor( separator->SetColor(AshColorProvider::Get()->GetContentLayerColor(
ContentLayerType::kSeparator, kSeparatorOnDarkBackgroundColor)); ContentLayerType::kSeparator, AshColorMode::kDark));
separator->SetPreferredHeight(kUnifiedSystemInfoHeight); separator->SetPreferredHeight(kUnifiedSystemInfoHeight);
AddChildView(separator); AddChildView(separator);
......
...@@ -128,8 +128,8 @@ class Separator : public views::View { ...@@ -128,8 +128,8 @@ class Separator : public views::View {
AddChildView(child); AddChildView(child);
child->SetBorder(views::CreateSolidSidedBorder( child->SetBorder(views::CreateSolidSidedBorder(
0, 0, kUnifiedNotificationSeparatorThickness, 0, 0, 0, kUnifiedNotificationSeparatorThickness, 0,
AshColorProvider::Get()->DeprecatedGetContentLayerColor( AshColorProvider::Get()->GetContentLayerColor(
ContentLayerType::kSeparator, kSeparatorOnDarkBackgroundColor))); ContentLayerType::kSeparator, AshColorMode::kDark)));
} }
DISALLOW_COPY_AND_ASSIGN(Separator); DISALLOW_COPY_AND_ASSIGN(Separator);
......
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