Skip to content

Commit

Permalink
cros: Clean up old wallpaper picker code (Part II)
Browse files Browse the repository at this point in the history
Bug: 812085
Change-Id: Ia2bf565c0ff5e5cd43e94079ae41b7a0be614430
Reviewed-on: https://chromium-review.googlesource.com/c/1297356
Reviewed-by: Xiyuan Xia <xiyuan@chromium.org>
Commit-Queue: Wenzhao (Colin) Zang <wzang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#602480}
  • Loading branch information
Wenzhao Zang authored and Commit Bot committed Oct 24, 2018
1 parent 6293992 commit ea82df7
Show file tree
Hide file tree
Showing 7 changed files with 5 additions and 74 deletions.
9 changes: 0 additions & 9 deletions ash/public/cpp/ash_features.cc
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,6 @@ const base::Feature kNewMessageListView{"NewMessageListView",
const base::Feature kMediaSessionAccelerators{
"MediaSessionAccelerators", base::FEATURE_DISABLED_BY_DEFAULT};

const base::Feature kNewWallpaperPicker{"NewWallpaperPicker",
base::FEATURE_ENABLED_BY_DEFAULT};

const base::Feature kNightLight{"NightLight", base::FEATURE_ENABLED_BY_DEFAULT};

const base::Feature kNotificationScrollBar{"NotificationScrollBar",
Expand Down Expand Up @@ -95,12 +92,6 @@ bool IsNewMessageListViewEnabled() {
return base::FeatureList::IsEnabled(kNewMessageListView);
}

bool IsNewWallpaperPickerEnabled() {
static bool use_new_wallpaper_picker =
base::FeatureList::IsEnabled(kNewWallpaperPicker);
return use_new_wallpaper_picker;
}

bool IsNightLightEnabled() {
return base::FeatureList::IsEnabled(kNightLight);
}
Expand Down
7 changes: 0 additions & 7 deletions ash/public/cpp/ash_features.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,6 @@ ASH_PUBLIC_EXPORT extern const base::Feature kMediaSessionAccelerators;
// Enables new message list view. https://crbug.com/769219
ASH_PUBLIC_EXPORT extern const base::Feature kNewMessageListView;

// Enables the new wallpaper picker.
// TODO(wzang): Remove this after the feature is fully launched.
// https://crbug.com/777293.
ASH_PUBLIC_EXPORT extern const base::Feature kNewWallpaperPicker;

// Enables the Night Light feature.
ASH_PUBLIC_EXPORT extern const base::Feature kNightLight;

Expand Down Expand Up @@ -102,8 +97,6 @@ ASH_PUBLIC_EXPORT bool IsLockScreenHideSensitiveNotificationsSupported();

ASH_PUBLIC_EXPORT bool IsNewMessageListViewEnabled();

ASH_PUBLIC_EXPORT bool IsNewWallpaperPickerEnabled();

ASH_PUBLIC_EXPORT bool IsNightLightEnabled();

ASH_PUBLIC_EXPORT bool IsNotificationScrollBarEnabled();
Expand Down
12 changes: 0 additions & 12 deletions chrome/app/chromeos_strings.grdp
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@
<message name="IDS_WALLPAPER_MANAGER_DELETE_COMMAND_LABEL" desc="Wallpaper delete command label.">
Delete
</message>
<message name="IDS_WALLPAPER_MANAGER_CUSTOM_CATEGORY_LABEL" desc="Wallpaper category label.">
Custom
</message>
<message name="IDS_WALLPAPER_MANAGER_MY_IMAGES_CATEGORY_LABEL" desc="Wallpaper category label, the equivalent of the Custom category on the new wallpaper picker.">
My Images
</message>
Expand All @@ -41,21 +38,12 @@
<message name="IDS_WALLPAPER_MANAGER_SHOW_CUSTOM_WALLPAPER_ON_START_WARNING" desc="The string displayed to user when set custom wallpaper.">
Wallpapers appear on the Sign-in Screen.
</message>
<message name="IDS_WALLPAPER_MANAGER_SURPRISE_ME_LABEL" desc="Wallpaper surprise me checkbox label. If the checkbox is checked, Chrome will automatically change wallpaper to either a random one available in wallpaper picker or a google pushed wallpaper (surprise factor).">
Surprise Me
</message>
<message name="IDS_WALLPAPER_MANAGER_DAILY_REFRESH_LABEL" desc="Wallpaper daily refresh checkbox label. It is the equivalent of surprise me on the new wallpaper picker.">
Daily Refresh
</message>
<message name="IDS_WALLPAPER_MANAGER_ACCESS_FAIL" desc="The string displayed to user when access wallpaper server failed.">
Chrome cannot access wallpapers. Please connect to a network.
</message>
<message name="IDS_WALLPAPER_MANAGER_NETWORK_ERROR" desc="The string displayed when user can't use wallpaper picker because they're not connected to the internet.">
The images are currently not available. Please reconnect to the internet to see wallpaper collections.
</message>
<message name="IDS_WALLPAPER_MANAGER_DOWNLOAD_FAIL" desc="The string displayed to user when downloading the wallpaper failed.">
Chrome cannot download this wallpaper.
</message>
<message name="IDS_WALLPAPER_MANAGER_IMAGE_ERROR" desc="The string displayed to user when downloading the wallpaper failed on the new wallpaper picker.">
There's an error. Please try again by choosing other images.
</message>
Expand Down
7 changes: 0 additions & 7 deletions chrome/browser/about_flags.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3879,13 +3879,6 @@ const FeatureEntry kFeatureEntries[] = {
flag_descriptions::kSignedHTTPExchangeDescription, kOsAll,
FEATURE_VALUE_TYPE(features::kSignedHTTPExchange)},

#if defined(OS_CHROMEOS)
{"enable-new-wallpaper-picker",
flag_descriptions::kEnableNewWallpaperPickerName,
flag_descriptions::kEnableNewWallpaperPickerDescription, kOsCrOS,
FEATURE_VALUE_TYPE(ash::features::kNewWallpaperPicker)},
#endif // OS_CHROMEOS

#if defined(OS_CHROMEOS)
{"enable-oobe-recommend-apps-screen",
flag_descriptions::kEnableOobeRecommendAppsScreenName,
Expand Down
37 changes: 5 additions & 32 deletions chrome/browser/chromeos/extensions/wallpaper_private_api.cc
Original file line number Diff line number Diff line change
Expand Up @@ -80,23 +80,11 @@ constexpr char kPngFilePattern[] = "*.[pP][nN][gG]";
constexpr char kJpgFilePattern[] = "*.[jJ][pP][gG]";
constexpr char kJpegFilePattern[] = "*.[jJ][pP][eE][gG]";

// The url suffix used by the old wallpaper picker.
constexpr char kHighResolutionSuffix[] = "_high_resolution.jpg";

#if defined(GOOGLE_CHROME_BUILD)
const char kWallpaperManifestBaseURL[] =
"https://storage.googleapis.com/chromeos-wallpaper-public/manifest_";
#endif

bool IsOEMDefaultWallpaper() {
return base::CommandLine::ForCurrentProcess()->HasSwitch(
chromeos::switches::kDefaultWallpaperIsOem);
}

bool IsUsingNewWallpaperPicker() {
return ash::features::IsNewWallpaperPickerEnabled();
}

// Returns a suffix to be appended to the base url of Backdrop wallpapers.
std::string GetBackdropWallpaperSuffix() {
// FIFE url is used for Backdrop wallpapers and the desired image size should
Expand Down Expand Up @@ -213,9 +201,7 @@ ExtensionFunction::ResponseAction WallpaperPrivateGetStringsFunction::Run() {
SET_STRING("allCategoryLabel", IDS_WALLPAPER_MANAGER_ALL_CATEGORY_LABEL);
SET_STRING("deleteCommandLabel", IDS_WALLPAPER_MANAGER_DELETE_COMMAND_LABEL);
SET_STRING("customCategoryLabel",
IsUsingNewWallpaperPicker()
? IDS_WALLPAPER_MANAGER_MY_IMAGES_CATEGORY_LABEL
: IDS_WALLPAPER_MANAGER_CUSTOM_CATEGORY_LABEL);
IDS_WALLPAPER_MANAGER_MY_IMAGES_CATEGORY_LABEL);
SET_STRING("selectCustomLabel",
IDS_WALLPAPER_MANAGER_SELECT_CUSTOM_LABEL);
SET_STRING("positionLabel", IDS_WALLPAPER_MANAGER_POSITION_LABEL);
Expand All @@ -226,21 +212,15 @@ ExtensionFunction::ResponseAction WallpaperPrivateGetStringsFunction::Run() {
IDS_WALLPAPER_MANAGER_LAYOUT_CENTER_CROPPED);
SET_STRING("centerLayout", IDS_WALLPAPER_MANAGER_LAYOUT_CENTER);
SET_STRING("stretchLayout", IDS_WALLPAPER_MANAGER_LAYOUT_STRETCH);
SET_STRING("connectionFailed", IsUsingNewWallpaperPicker()
? IDS_WALLPAPER_MANAGER_NETWORK_ERROR
: IDS_WALLPAPER_MANAGER_ACCESS_FAIL);
SET_STRING("downloadFailed", IsUsingNewWallpaperPicker()
? IDS_WALLPAPER_MANAGER_IMAGE_ERROR
: IDS_WALLPAPER_MANAGER_DOWNLOAD_FAIL);
SET_STRING("connectionFailed", IDS_WALLPAPER_MANAGER_NETWORK_ERROR);
SET_STRING("downloadFailed", IDS_WALLPAPER_MANAGER_IMAGE_ERROR);
SET_STRING("downloadCanceled", IDS_WALLPAPER_MANAGER_DOWNLOAD_CANCEL);
SET_STRING("customWallpaperWarning",
IDS_WALLPAPER_MANAGER_SHOW_CUSTOM_WALLPAPER_ON_START_WARNING);
SET_STRING("accessFileFailure", IDS_WALLPAPER_MANAGER_ACCESS_FILE_FAILURE);
SET_STRING("invalidWallpaper", IDS_WALLPAPER_MANAGER_INVALID_WALLPAPER);
SET_STRING("noImagesAvailable", IDS_WALLPAPER_MANAGER_NO_IMAGES_AVAILABLE);
SET_STRING("surpriseMeLabel", IsUsingNewWallpaperPicker()
? IDS_WALLPAPER_MANAGER_DAILY_REFRESH_LABEL
: IDS_WALLPAPER_MANAGER_SURPRISE_ME_LABEL);
SET_STRING("surpriseMeLabel", IDS_WALLPAPER_MANAGER_DAILY_REFRESH_LABEL);
SET_STRING("learnMore", IDS_LEARN_MORE);
SET_STRING("currentWallpaperSetByMessage",
IDS_CURRENT_WALLPAPER_SET_BY_MESSAGE);
Expand All @@ -254,17 +234,10 @@ ExtensionFunction::ResponseAction WallpaperPrivateGetStringsFunction::Run() {
const std::string& app_locale = g_browser_process->GetApplicationLocale();
webui::SetLoadTimeDataDefaults(app_locale, dict.get());

#if defined(GOOGLE_CHROME_BUILD)
dict->SetString("manifestBaseURL", kWallpaperManifestBaseURL);
#endif

dict->SetBoolean("isOEMDefaultWallpaper", IsOEMDefaultWallpaper());
dict->SetString("canceledWallpaper",
wallpaper_api_util::kCancelWallpaperMessage);
dict->SetBoolean("useNewWallpaperPicker", IsUsingNewWallpaperPicker());
dict->SetString("highResolutionSuffix", IsUsingNewWallpaperPicker()
? GetBackdropWallpaperSuffix()
: kHighResolutionSuffix);
dict->SetString("highResolutionSuffix", GetBackdropWallpaperSuffix());

WallpaperControllerClient::Get()->GetActiveUserWallpaperInfo(base::BindOnce(
&WallpaperPrivateGetStringsFunction::OnWallpaperInfoReturned, this,
Expand Down
4 changes: 0 additions & 4 deletions chrome/browser/flag_descriptions.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3287,10 +3287,6 @@ const char kEnableNewStyleLauncherDescription[] =
"Enables new style UI such as suggestion chips, resizable apps grid, etc. "
"in app launcher.";

const char kEnableNewWallpaperPickerName[] = "Enable new wallpaper picker";
const char kEnableNewWallpaperPickerDescription[] =
"Enable the redesigned wallpaper picker with new wallpaper collections.";

const char kEnableOobeRecommendAppsScreenName[] =
"Enable OOBE Recommend Apps Screen";
const char kEnableOobeRecommendAppsScreenDescription[] =
Expand Down
3 changes: 0 additions & 3 deletions chrome/browser/flag_descriptions.h
Original file line number Diff line number Diff line change
Expand Up @@ -2008,9 +2008,6 @@ extern const char kEnableMediaSessionAshMediaKeysDescription[];
extern const char kEnableNewStyleLauncherName[];
extern const char kEnableNewStyleLauncherDescription[];

extern const char kEnableNewWallpaperPickerName[];
extern const char kEnableNewWallpaperPickerDescription[];

extern const char kEnableOobeRecommendAppsScreenName[];
extern const char kEnableOobeRecommendAppsScreenDescription[];

Expand Down

0 comments on commit ea82df7

Please sign in to comment.