Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(352)

Unified Diff: ash/system/night_light/night_light_controller.cc

Issue 2921973002: Hide Night Light behind a flag (Closed)
Patch Set: Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ash/system/night_light/night_light_controller.cc
diff --git a/ash/system/night_light/night_light_controller.cc b/ash/system/night_light/night_light_controller.cc
index 90e3179f6d5a571c3caa709199c3be3db226fd29..ea678c63bc9841cfd43334d6b6951adb5598dda6 100644
--- a/ash/system/night_light/night_light_controller.cc
+++ b/ash/system/night_light/night_light_controller.cc
@@ -4,9 +4,11 @@
#include "ash/system/night_light/night_light_controller.h"
+#include "ash/ash_switches.h"
#include "ash/public/cpp/ash_pref_names.h"
#include "ash/session/session_controller.h"
#include "ash/shell.h"
+#include "base/command_line.h"
#include "base/time/time.h"
#include "components/prefs/pref_registry_simple.h"
#include "components/prefs/pref_service.h"
@@ -56,6 +58,18 @@ NightLightController::~NightLightController() {
session_controller_->RemoveObserver(this);
}
+// static
+bool NightLightController::IsFeatureEnabled() {
+ return base::CommandLine::ForCurrentProcess()->HasSwitch(
+ ash::switches::kAshEnableNightLight);
+}
+
+// static
+void NightLightController::EnableFeatureForTesting() {
+ base::CommandLine::ForCurrentProcess()->AppendSwitch(
James Cook 2017/06/02 23:40:05 nit: I think it would be better to do this in the
afakhry 2017/06/03 00:09:03 Done.
+ ash::switches::kAshEnableNightLight);
+}
+
// static
void NightLightController::RegisterPrefs(PrefRegistrySimple* registry) {
registry->RegisterBooleanPref(prefs::kNightLightEnabled, false);

Powered by Google App Engine
This is Rietveld 408576698