Commit 82988ab0 authored by minch's avatar minch Committed by Commit Bot

dark_mode: Light power menu and system toast by default.

Bug: 1133952
Change-Id: I8c1e3e7ee4d3ea486aa0519693a7a8e066bd7dc6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2444176Reviewed-by: default avatarAhmed Fakhry <afakhry@chromium.org>
Commit-Queue: Min Chen <minch@chromium.org>
Cr-Commit-Position: refs/heads/master@{#813313}
parent 2cd231bf
......@@ -5,9 +5,14 @@
#ifndef ASH_STYLE_DEFAULT_COLOR_CONSTANTS_H_
#define ASH_STYLE_DEFAULT_COLOR_CONSTANTS_H_
#include "ui/gfx/color_palette.h"
// Colors that can't be found in AshColorProvider. This is used to keep the UI
// element's current look before launching dark/light mode. Using this together
// with the Deprecated* functions inside default_colors.h file. Note: This file
// will be removed once enabled dark/light mode.
// Colors for power button menu.
constexpr SkColor kPowerButtonMenuFullscreenShieldColor = SK_ColorBLACK;
#endif // ASH_STYLE_DEFAULT_COLOR_CONSTANTS_H_
......@@ -5,6 +5,7 @@
#include "ash/system/power/power_button_menu_item_view.h"
#include "ash/style/ash_color_provider.h"
#include "ash/style/scoped_light_mode_as_default.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/gfx/canvas.h"
#include "ui/gfx/font.h"
......@@ -46,6 +47,7 @@ PowerButtonMenuItemView::PowerButtonMenuItemView(
SetFocusBehavior(FocusBehavior::ALWAYS);
SetFocusPainter(nullptr);
ScopedLightModeAsDefault scoped_light_mode_as_default;
const AshColorProvider* color_provider = AshColorProvider::Get();
icon_view_->SetImage(gfx::CreateVectorIcon(
icon, color_provider->GetContentLayerColor(
......@@ -120,6 +122,7 @@ void PowerButtonMenuItemView::PaintButtonContents(gfx::Canvas* canvas) {
gfx::Rect bounds = GetLocalBounds();
bounds.Inset(gfx::Insets(kItemBorderThickness));
// Stroke.
ScopedLightModeAsDefault scoped_light_mode_as_default;
flags.setColor(AshColorProvider::Get()->GetControlsLayerColor(
AshColorProvider::ControlsLayerType::kFocusRingColor));
flags.setStrokeWidth(kItemBorderThickness);
......
......@@ -8,6 +8,8 @@
#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/power/power_button_menu_metrics_type.h"
#include "ash/system/power/power_button_menu_view.h"
#include "ash/wm/tablet_mode/tablet_mode_controller.h"
......@@ -63,8 +65,9 @@ class PowerButtonMenuScreenView::PowerButtonMenuBackgroundView
PowerButtonMenuBackgroundView(base::RepeatingClosure show_animation_done)
: show_animation_done_(show_animation_done) {
SetPaintToLayer(ui::LAYER_SOLID_COLOR);
layer()->SetColor(AshColorProvider::Get()->GetShieldLayerColor(
AshColorProvider::ShieldLayerType::kShield40));
layer()->SetColor(DeprecatedGetShieldLayerColor(
AshColorProvider::ShieldLayerType::kShield40,
kPowerButtonMenuFullscreenShieldColor));
layer()->SetOpacity(0.f);
}
......
......@@ -14,6 +14,7 @@
#include "ash/shell.h"
#include "ash/strings/grit/ash_strings.h"
#include "ash/style/ash_color_provider.h"
#include "ash/style/scoped_light_mode_as_default.h"
#include "ash/system/power/power_button_menu_item_view.h"
#include "ash/system/power/power_button_menu_metrics_type.h"
#include "ash/system/user/login_status.h"
......@@ -51,6 +52,7 @@ PowerButtonMenuView::PowerButtonMenuView(
: power_button_position_(power_button_position) {
SetFocusBehavior(FocusBehavior::ALWAYS);
SetPaintToLayer();
ScopedLightModeAsDefault scoped_light_mode_as_default;
SetBackground(
views::CreateSolidBackground(AshColorProvider::Get()->GetBaseLayerColor(
AshColorProvider::BaseLayerType::kTransparent80)));
......
......@@ -12,6 +12,7 @@
#include "ash/shell.h"
#include "ash/strings/grit/ash_strings.h"
#include "ash/style/ash_color_provider.h"
#include "ash/style/scoped_light_mode_as_default.h"
#include "ash/wm/work_area_insets.h"
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
......@@ -68,6 +69,7 @@ class ToastOverlayLabel : public views::Label {
SetAutoColorReadabilityEnabled(false);
SetMultiLine(true);
SetMaxLines(2);
ScopedLightModeAsDefault scoped_light_mode_as_default;
SetEnabledColor(AshColorProvider::Get()->GetContentLayerColor(
AshColorProvider::ContentLayerType::kTextColorPrimary));
SetSubpixelRenderingEnabled(false);
......@@ -117,6 +119,7 @@ class ToastOverlayButton : public views::LabelButton {
: views::LabelButton(listener, text, CONTEXT_TOAST_OVERLAY) {
SetInkDropMode(InkDropMode::ON);
SetHasInkDropActionOnClick(true);
ScopedLightModeAsDefault scoped_light_mode_as_default;
const auto* color_provider = AshColorProvider::Get();
SetInkDropBaseColor(color_provider->GetRippleAttributes().base_color);
SetEnabledTextColors(color_provider->GetContentLayerColor(
......@@ -159,6 +162,7 @@ class ToastOverlayView : public views::View, public views::ButtonListener {
const bool is_managed)
: overlay_(overlay) {
SetPaintToLayer();
ScopedLightModeAsDefault scoped_light_mode_as_default;
SetBackground(
views::CreateSolidBackground(AshColorProvider::Get()->GetBaseLayerColor(
AshColorProvider::BaseLayerType::kTransparent80)));
......
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