0

Revert "Remove TimeOfDayWallpaperForcedAutoSchedule flag."

This reverts commit 856a7cfb07.

Reason for revert: Breaks linux-chromeos-chrome.
https://ci.chromium.org/ui/p/chrome/builders/ci/linux-chromeos-chrome/41024/overview

Original change's description:
> Remove TimeOfDayWallpaperForcedAutoSchedule flag.
>
> The experiment already launched to stable channel.
>
> Bug: b:313666949
> Change-Id: I39c11b8eef8a33b322b56d267f37e1eb8cb6d15f
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5474172
> Reviewed-by: Jason Thai <jasontt@chromium.org>
> Commit-Queue: Eric Sum <esum@google.com>
> Cr-Commit-Position: refs/heads/main@{#1290955}

Bug: b:313666949
Change-Id: Ieead7d281bf334df62663cc6744e80c885c7df75
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5475227
Owners-Override: Joel Hockey <joelhockey@chromium.org>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Joel Hockey <joelhockey@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1291065}
This commit is contained in:
Eric Sum
2024-04-23 03:43:53 +00:00
committed by Chromium LUCI CQ
parent 13933a8ba7
commit 2e7840aebd
14 changed files with 68 additions and 8 deletions

@ -2808,6 +2808,13 @@ BASE_FEATURE(kTilingWindowResize,
"TilingWindowResize",
base::FEATURE_DISABLED_BY_DEFAULT);
// Forces the time of day wallpaper to change on an automatic sunset-to-sunrise
// schedule, regardless of what dark/light mode settings are active.
// Not used if time of day wallpaper is not enabled.
BASE_FEATURE(kTimeOfDayWallpaperForcedAutoSchedule,
"TimeOfDayWallpaperForcedAutoSchedule",
base::FEATURE_ENABLED_BY_DEFAULT);
// Enables retrieving time of day screen saver assets from DLC, rather than from
// rootfs.
BASE_FEATURE(kTimeOfDayDlc, "TimeOfDayDlc", base::FEATURE_DISABLED_BY_DEFAULT);
@ -4454,6 +4461,11 @@ bool IsTimeOfDayWallpaperEnabled() {
return base::FeatureList::IsEnabled(kFeatureManagementTimeOfDayWallpaper);
}
bool IsTimeOfDayWallpaperForcedAutoScheduleEnabled() {
return IsTimeOfDayWallpaperEnabled() &&
base::FeatureList::IsEnabled(kTimeOfDayWallpaperForcedAutoSchedule);
}
bool IsTimeOfDayDlcEnabled() {
return IsTimeOfDayScreenSaverEnabled() &&
base::FeatureList::IsEnabled(kTimeOfDayDlc);

@ -858,6 +858,8 @@ COMPONENT_EXPORT(ASH_CONSTANTS)
BASE_DECLARE_FEATURE(kTetheringExperimentalFunctionality);
COMPONENT_EXPORT(ASH_CONSTANTS) BASE_DECLARE_FEATURE(kTerminalDev);
COMPONENT_EXPORT(ASH_CONSTANTS) BASE_DECLARE_FEATURE(kTilingWindowResize);
COMPONENT_EXPORT(ASH_CONSTANTS)
BASE_DECLARE_FEATURE(kTimeOfDayWallpaperForcedAutoSchedule);
COMPONENT_EXPORT(ASH_CONSTANTS) BASE_DECLARE_FEATURE(kTimeOfDayDlc);
COMPONENT_EXPORT(ASH_CONSTANTS)
BASE_DECLARE_FEATURE(kTouchVirtualKeyboardPolicyListenPrefsAtLogin);
@ -1306,6 +1308,7 @@ COMPONENT_EXPORT(ASH_CONSTANTS) bool IsTilingWindowResizeEnabled();
COMPONENT_EXPORT(ASH_CONSTANTS) bool IsTimeOfDayScreenSaverEnabled();
COMPONENT_EXPORT(ASH_CONSTANTS) bool IsTimeOfDayWallpaperEnabled();
COMPONENT_EXPORT(ASH_CONSTANTS)
bool IsTimeOfDayWallpaperForcedAutoScheduleEnabled();
COMPONENT_EXPORT(ASH_CONSTANTS) bool IsTimeOfDayDlcEnabled();
COMPONENT_EXPORT(ASH_CONSTANTS) bool IsTabClusterUIEnabled();
COMPONENT_EXPORT(ASH_CONSTANTS) bool IsTouchpadInDiagnosticsAppEnabled();

@ -3159,7 +3159,7 @@ bool WallpaperControllerImpl::IsOobeState() const {
const ScheduledFeature& WallpaperControllerImpl::GetScheduleForOnlineWallpaper(
const std::string& collection_id) const {
if (::ash::IsTimeOfDayWallpaper(collection_id) &&
features::IsTimeOfDayWallpaperEnabled()) {
features::IsTimeOfDayWallpaperForcedAutoScheduleEnabled()) {
return *time_of_day_scheduler_;
} else {
return *Shell::Get()->dark_light_mode_controller();

@ -5070,6 +5070,9 @@ TEST_P(WallpaperControllerAutoScheduleTest,
return;
}
base::test::ScopedFeatureList feature_list;
feature_list.InitAndEnableFeature(
features::kTimeOfDayWallpaperForcedAutoSchedule);
const auto backdrop_image_data = TimeOfDayImageSet();
client_.AddCollection(wallpaper_constants::kTimeOfDayWallpaperCollectionId,
backdrop_image_data);

@ -535,6 +535,9 @@ void PersonalizationAppUI::AddBooleans(content::WebUIDataSource* source) {
source->AddBoolean("isTimeOfDayWallpaperEnabled",
features::IsTimeOfDayWallpaperEnabled());
source->AddBoolean("isTimeOfDayWallpaperForcedAutoScheduleEnabled",
features::IsTimeOfDayWallpaperForcedAutoScheduleEnabled());
source->AddBoolean("isCrosPrivacyHubLocationEnabled",
features::IsCrosPrivacyHubLocationEnabled());

@ -47,6 +47,11 @@ export function isTimeOfDayWallpaperEnabled() {
return loadTimeData.getBoolean('isTimeOfDayWallpaperEnabled');
}
export function isTimeOfDayWallpaperForcedAutoScheduleEnabled() {
return loadTimeData.getBoolean(
'isTimeOfDayWallpaperForcedAutoScheduleEnabled');
}
export function isCrosPrivacyHubLocationEnabled() {
return loadTimeData.getBoolean('isCrosPrivacyHubLocationEnabled');
}

@ -18,7 +18,7 @@ import {assert} from 'chrome://resources/js/assert.js';
import {CurrentWallpaper, OnlineImageType, WallpaperCollection, WallpaperImage, WallpaperType} from '../../personalization_app.mojom-webui.js';
import {dismissTimeOfDayBanner} from '../ambient/ambient_controller.js';
import {isTimeOfDayWallpaperEnabled} from '../load_time_booleans.js';
import {isTimeOfDayWallpaperForcedAutoScheduleEnabled} from '../load_time_booleans.js';
import {PersonalizationRouterElement} from '../personalization_router_element.js';
import {WithPersonalizationStore} from '../personalization_store.js';
import {setColorModeAutoSchedule} from '../theme/theme_controller.js';
@ -349,7 +349,7 @@ export class WallpaperImagesElement extends WithPersonalizationStore {
private async shouldShowTimeOfDayWallpaperDialog_(tile: ImageTile):
Promise<boolean> {
if (isTimeOfDayWallpaperEnabled()) {
if (isTimeOfDayWallpaperForcedAutoScheduleEnabled()) {
await getShouldShowTimeOfDayWallpaperDialog(
getWallpaperProvider(), this.getStore());
}

@ -3102,6 +3102,8 @@ constexpr char kWallpaperFastRefreshInternalName[] = "wallpaper-fast-refresh";
constexpr char kWallpaperGooglePhotosSharedAlbumsInternalName[] =
"wallpaper-google-photos-shared-albums";
constexpr char kWallpaperPerDeskName[] = "per-desk-wallpaper";
constexpr char kTimeOfDayWallpaperForcedAutoScheduleInternalName[] =
"time-of-day-wallpaper-forced-auto-schedule";
constexpr char kTimeOfDayDlcInternalName[] = "time-of-day-dlc";
constexpr char kGlanceablesV2InternalName[] = "glanceables-v2";
constexpr char kGlanceablesV2KeyName[] = "glanceables-v2-key";
@ -4392,6 +4394,11 @@ const FeatureEntry kFeatureEntries[] = {
{"passpoint-settings", flag_descriptions::kPasspointSettingsName,
flag_descriptions::kPasspointSettingsDescription, kOsCrOS,
FEATURE_VALUE_TYPE(ash::features::kPasspointSettings)},
{kTimeOfDayWallpaperForcedAutoScheduleInternalName,
flag_descriptions::kTimeOfDayWallpaperForcedAutoScheduleName,
flag_descriptions::kTimeOfDayWallpaperForcedAutoScheduleDescription,
kOsCrOS,
FEATURE_VALUE_TYPE(ash::features::kTimeOfDayWallpaperForcedAutoSchedule)},
{kTimeOfDayDlcInternalName, flag_descriptions::kTimeOfDayDlcName,
flag_descriptions::kTimeOfDayDlcDescription, kOsCrOS,
FEATURE_VALUE_TYPE(ash::features::kTimeOfDayDlc)},

@ -112,8 +112,11 @@ class PersonalizationAppTimeOfDayBrowserTest
public testing::WithParamInterface<TimeOfDayTestParams> {
public:
PersonalizationAppTimeOfDayBrowserTest() {
scoped_feature_list_.InitWithFeatures(
personalization_app::GetTimeOfDayEnabledFeatures(), {});
std::vector<base::test::FeatureRef> enabled_features =
personalization_app::GetTimeOfDayEnabledFeatures();
enabled_features.emplace_back(
features::kTimeOfDayWallpaperForcedAutoSchedule);
scoped_feature_list_.InitWithFeatures(enabled_features, {});
base::Time start_time = StartTime();
clock_.SetNow(start_time);
tick_clock_.SetNowTicks(base::TimeTicks() + (start_time - base::Time()));

@ -519,7 +519,7 @@ void PersonalizationAppWallpaperProviderImpl::SelectWallpaper(
client->RecordWallpaperSourceUMA(ash::WallpaperType::kOnline);
if (IsTimeOfDayWallpaper(collection_id) &&
features::IsTimeOfDayWallpaperEnabled()) {
features::IsTimeOfDayWallpaperForcedAutoScheduleEnabled()) {
// Records the display count of the time of day wallpaper dialog when the
// user selects one to determine whether to show it the next time.
contextual_tooltip::HandleGesturePerformed(
@ -804,7 +804,7 @@ void PersonalizationAppWallpaperProviderImpl::
ShouldShowTimeOfDayWallpaperDialog(
ShouldShowTimeOfDayWallpaperDialogCallback callback) {
std::move(callback).Run(
features::IsTimeOfDayWallpaperEnabled() &&
features::IsTimeOfDayWallpaperForcedAutoScheduleEnabled() &&
contextual_tooltip::ShouldShowNudge(
profile_->GetPrefs(),
contextual_tooltip::TooltipType::kTimeOfDayWallpaperDialog,

@ -572,7 +572,8 @@ TEST_F(PersonalizationAppWallpaperProviderImplTest,
ShouldShowTimeOfDayWallpaperDialog) {
test_wallpaper_controller()->ClearCounts();
base::test::ScopedFeatureList features;
features.InitWithFeatures({features::kFeatureManagementTimeOfDayWallpaper},
features.InitWithFeatures({features::kFeatureManagementTimeOfDayWallpaper,
features::kTimeOfDayWallpaperForcedAutoSchedule},
{});
auto image_info = GetDefaultImageInfo();

@ -7155,6 +7155,13 @@ const char kTetherDescription[] =
"Enables Instant Tethering. Instant Tethering allows your nearby Google "
"phone to share its Internet connection with this device.";
const char kTimeOfDayWallpaperForcedAutoScheduleName[] =
"Time of Day Wallpaper Forced Auto Schedule";
const char kTimeOfDayWallpaperForcedAutoScheduleDescription[] =
"Forces the time of day wallpaper to change on an automatic "
"sunset-to-sunrise schedule, regardless of what dark/light mode settings "
"are active. Not used if time of day wallpaper is not enabled.";
const char kTimeOfDayDlcName[] = "Time of Day Dlc";
const char kTimeOfDayDlcDescription[] =
"Enables downloading Time of Day Screen Saver assets from DLC rather than "

@ -4157,6 +4157,9 @@ extern const char kTerminalDevDescription[];
extern const char kTetherName[];
extern const char kTetherDescription[];
extern const char kTimeOfDayWallpaperForcedAutoScheduleName[];
extern const char kTimeOfDayWallpaperForcedAutoScheduleDescription[];
extern const char kTimeOfDayDlcName[];
extern const char kTimeOfDayDlcDescription[];

@ -5,6 +5,7 @@
import 'chrome://personalization/strings.m.js';
import {OnlineImageType, PersonalizationRouterElement, TimeOfDayWallpaperDialogElement, WallpaperGridItemElement, WallpaperImagesElement} from 'chrome://personalization/js/personalization_app.js';
import {loadTimeData} from 'chrome://resources/js/load_time_data.js';
import {assertDeepEquals, assertEquals, assertFalse, assertNotEquals, assertTrue} from 'chrome://webui-test/chai_assert.js';
import {waitAfterNextRender} from 'chrome://webui-test/polymer_test_util.js';
@ -341,6 +342,9 @@ suite('WallpaperImagesElementTest', function() {
});
test('shows dialog when clicking on a time of day wallpaper', async () => {
loadTimeData.overrideValues({
isTimeOfDayWallpaperForcedAutoScheduleEnabled: true,
});
personalizationStore.setReducersEnabled(true);
personalizationStore.data.theme.colorModeAutoScheduleEnabled = false;
wallpaperImagesElement =
@ -357,6 +361,9 @@ suite('WallpaperImagesElementTest', function() {
test(
'clicking cancel dismisses the time of day wallpaper dialog',
async () => {
loadTimeData.overrideValues({
isTimeOfDayWallpaperForcedAutoScheduleEnabled: true,
});
personalizationStore.setReducersEnabled(true);
personalizationStore.data.theme.colorModeAutoScheduleEnabled = false;
wallpaperImagesElement = await createWithDefaultData(
@ -381,6 +388,9 @@ suite('WallpaperImagesElementTest', function() {
});
test('clicking confirm on the time of day wallpaper dialog', async () => {
loadTimeData.overrideValues({
isTimeOfDayWallpaperForcedAutoScheduleEnabled: true,
});
personalizationStore.setReducersEnabled(true);
personalizationStore.data.theme.colorModeAutoScheduleEnabled = false;
wallpaperImagesElement =
@ -405,6 +415,9 @@ suite('WallpaperImagesElementTest', function() {
});
test('do not show time of day dialog with proper settings', async () => {
loadTimeData.overrideValues({
isTimeOfDayWallpaperForcedAutoScheduleEnabled: true,
});
personalizationStore.setReducersEnabled(true);
wallpaperProvider.shouldShowTimeOfDayWallpaperDialogResponse = false;
wallpaperImagesElement =