Commit bbcd67b8 authored by minch's avatar minch Committed by Commit Bot

dark_mode: Follow up to keep old colors.

Bug: 1133952
Change-Id: I843e304131eea6f120be6f32f00b427d1f6477df
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2444453Reviewed-by: default avatarAhmed Fakhry <afakhry@chromium.org>
Commit-Queue: Min Chen <minch@chromium.org>
Cr-Commit-Position: refs/heads/master@{#813046}
parent e9c1bf2e
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
#include <math.h> #include <math.h>
#include "ash/public/cpp/ash_constants.h" #include "ash/public/cpp/ash_constants.h"
#include "ash/public/cpp/ash_features.h"
#include "ash/public/cpp/ash_pref_names.h" #include "ash/public/cpp/ash_pref_names.h"
#include "ash/public/cpp/login_constants.h" #include "ash/public/cpp/login_constants.h"
#include "ash/session/session_controller_impl.h" #include "ash/session/session_controller_impl.h"
...@@ -331,7 +332,7 @@ void AshColorProvider::RemoveObserver(ColorModeObserver* observer) { ...@@ -331,7 +332,7 @@ void AshColorProvider::RemoveObserver(ColorModeObserver* observer) {
} }
bool AshColorProvider::IsDarkModeEnabled() const { bool AshColorProvider::IsDarkModeEnabled() const {
if (override_light_mode_as_default_) if (!features::IsDarkLightModeEnabled() && override_light_mode_as_default_)
return false; return false;
if (!active_user_pref_service_) if (!active_user_pref_service_)
......
...@@ -233,8 +233,9 @@ class ASH_EXPORT AshColorProvider : public SessionObserver { ...@@ -233,8 +233,9 @@ class ASH_EXPORT AshColorProvider : public SessionObserver {
// Default color mode is dark, which is controlled by pref |kDarkModeEnabled| // Default color mode is dark, which is controlled by pref |kDarkModeEnabled|
// currently. But we can also override it to light through // currently. But we can also override it to light through
// ScopedLightModeAsDefault. This is done to help keeping some of the UI // ScopedLightModeAsDefault. This is done to help keeping some of the UI
// elements as light by default before launching dark/light mode. This will be // elements as light by default before launching dark/light mode. Overriding
// removed once enabling dark/light mode. // only if the kDarkLightMode feature is disabled. This variable will be
// removed once enabled dark/light mode.
bool override_light_mode_as_default_ = false; bool override_light_mode_as_default_ = false;
base::ObserverList<ColorModeObserver> observers_; base::ObserverList<ColorModeObserver> observers_;
......
...@@ -10,7 +10,8 @@ namespace ash { ...@@ -10,7 +10,8 @@ namespace ash {
// A helper class to set default color mode to light. Color mode is dark by // A helper class to set default color mode to light. Color mode is dark by
// default, which is controlled by pref |kDarkModeEnabled| currently. Some of // default, which is controlled by pref |kDarkModeEnabled| currently. Some of
// the components need to be kept as LIGHT by default before launching // the components need to be kept as LIGHT by default before launching
// dark/light mode. E.g. power button menu and system toast. // dark/light mode. E.g. power button menu and system toast. Overriding only if
// the kDarkLightMode feature is disabled.
class ScopedLightModeAsDefault { class ScopedLightModeAsDefault {
public: public:
ScopedLightModeAsDefault(); ScopedLightModeAsDefault();
......
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