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

dark_mode: Remove switch kAshColorMode.

Switch kAshColorMode was added to show prototype to UX before. Remove it
now since we are going to add a dark/light mode switching UI at the
system tray.

Bug: 1106012
Change-Id: Id5cb946217530f2a21fdc1c139d3943b24959b5c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2373950
Commit-Queue: Min Chen <minch@chromium.org>
Reviewed-by: default avatarAhmed Fakhry <afakhry@chromium.org>
Cr-Commit-Position: refs/heads/master@{#801916}
parent 96fb15ea
...@@ -20,11 +20,6 @@ constexpr base::TimeDelta kAshContextualNudgesMaxInterval = ...@@ -20,11 +20,6 @@ constexpr base::TimeDelta kAshContextualNudgesMaxInterval =
namespace ash { namespace ash {
namespace switches { namespace switches {
// Indicates the current color mode of ash.
const char kAshColorMode[] = "ash-color-mode";
const char kAshColorModeDark[] = "dark";
const char kAshColorModeLight[] = "light";
// Force the pointer (cursor) position to be kept inside root windows. // Force the pointer (cursor) position to be kept inside root windows.
const char kAshConstrainPointerToRoot[] = "ash-constrain-pointer-to-root"; const char kAshConstrainPointerToRoot[] = "ash-constrain-pointer-to-root";
......
...@@ -18,9 +18,6 @@ namespace switches { ...@@ -18,9 +18,6 @@ namespace switches {
// Please keep alphabetized. // Please keep alphabetized.
// TODO(sky): fix order! // TODO(sky): fix order!
ASH_PUBLIC_EXPORT extern const char kAshColorMode[];
ASH_PUBLIC_EXPORT extern const char kAshColorModeDark[];
ASH_PUBLIC_EXPORT extern const char kAshColorModeLight[];
ASH_PUBLIC_EXPORT extern const char kAshConstrainPointerToRoot[]; ASH_PUBLIC_EXPORT extern const char kAshConstrainPointerToRoot[];
ASH_PUBLIC_EXPORT extern const char kAshContextualNudgesInterval[]; ASH_PUBLIC_EXPORT extern const char kAshContextualNudgesInterval[];
ASH_PUBLIC_EXPORT extern const char kAshContextualNudgesResetShownCount[]; ASH_PUBLIC_EXPORT extern const char kAshContextualNudgesResetShownCount[];
......
...@@ -6,11 +6,9 @@ ...@@ -6,11 +6,9 @@
#include <math.h> #include <math.h>
#include "ash/public/cpp/ash_switches.h"
#include "ash/shell.h" #include "ash/shell.h"
#include "ash/wallpaper/wallpaper_controller_impl.h" #include "ash/wallpaper/wallpaper_controller_impl.h"
#include "base/check_op.h" #include "base/check_op.h"
#include "base/command_line.h"
#include "base/stl_util.h" #include "base/stl_util.h"
#include "base/strings/string_number_conversions.h" #include "base/strings/string_number_conversions.h"
#include "ui/chromeos/colors/cros_colors.h" #include "ui/chromeos/colors/cros_colors.h"
...@@ -57,35 +55,12 @@ constexpr SkColor kBackgroundColorDefaultDark = gfx::kGoogleGrey900; ...@@ -57,35 +55,12 @@ constexpr SkColor kBackgroundColorDefaultDark = gfx::kGoogleGrey900;
// The spacing between a pill button's icon and label, if it has both. // The spacing between a pill button's icon and label, if it has both.
constexpr int kPillButtonImageLabelSpacingDp = 8; constexpr int kPillButtonImageLabelSpacingDp = 8;
// Gets the color mode value from feature flag "--ash-color-mode".
AshColorProvider::AshColorMode GetColorModeFromCommandLine() {
const base::CommandLine* cl = base::CommandLine::ForCurrentProcess();
if (!cl->HasSwitch(switches::kAshColorMode))
return AshColorProvider::AshColorMode::kDefault;
const std::string switch_value =
cl->GetSwitchValueASCII(switches::kAshColorMode);
if (switch_value == switches::kAshColorModeDark)
return AshColorProvider::AshColorMode::kDark;
if (switch_value == switches::kAshColorModeLight)
return AshColorProvider::AshColorMode::kLight;
return AshColorProvider::AshColorMode::kDefault;
}
bool IsLightMode(AshColorProvider::AshColorMode color_mode) { bool IsLightMode(AshColorProvider::AshColorMode color_mode) {
return color_mode == AshColorProvider::AshColorMode::kLight; return color_mode == AshColorProvider::AshColorMode::kLight;
} }
} // namespace } // namespace
AshColorProvider::AshColorProvider()
: color_mode_(GetColorModeFromCommandLine()) {}
AshColorProvider::~AshColorProvider() = default;
// static // static
AshColorProvider* AshColorProvider::Get() { AshColorProvider* AshColorProvider::Get() {
return Shell::Get()->ash_color_provider(); return Shell::Get()->ash_color_provider();
......
...@@ -6,7 +6,6 @@ ...@@ -6,7 +6,6 @@
#define ASH_STYLE_ASH_COLOR_PROVIDER_H_ #define ASH_STYLE_ASH_COLOR_PROVIDER_H_
#include "ash/ash_export.h" #include "ash/ash_export.h"
#include "base/macros.h"
#include "third_party/skia/include/core/SkColor.h" #include "third_party/skia/include/core/SkColor.h"
#include "ui/gfx/vector_icon_types.h" #include "ui/gfx/vector_icon_types.h"
...@@ -143,8 +142,10 @@ class ASH_EXPORT AshColorProvider { ...@@ -143,8 +142,10 @@ class ASH_EXPORT AshColorProvider {
const float highlight_opacity; const float highlight_opacity;
}; };
AshColorProvider(); AshColorProvider() = default;
~AshColorProvider(); AshColorProvider(const AshColorProvider& other) = delete;
AshColorProvider operator=(const AshColorProvider& other) = delete;
~AshColorProvider() = default;
static AshColorProvider* Get(); static AshColorProvider* Get();
...@@ -255,8 +256,6 @@ class ASH_EXPORT AshColorProvider { ...@@ -255,8 +256,6 @@ class ASH_EXPORT AshColorProvider {
// Whether the system color mode is themed, by default is true. If true, the // Whether the system color mode is themed, by default is true. If true, the
// background color will be calculated based on extracted wallpaper color. // background color will be calculated based on extracted wallpaper color.
bool is_themed_ = true; bool is_themed_ = true;
DISALLOW_COPY_AND_ASSIGN(AshColorProvider);
}; };
} // namespace ash } // namespace ash
......
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