Commit c2c43737 authored by Wenzhao Zang's avatar Wenzhao Zang Committed by Commit Bot

cros: Add strings for new wallpaper picker

The mock is at: goo.gl/kGgEVr

TBR=cpu@chromium.org

Bug: 811619
Change-Id: I1b3c773bae64031e47a9e7ab2aee65da9bb0c2f0
Reviewed-on: https://chromium-review.googlesource.com/922399
Commit-Queue: Wenzhao (Colin) Zang <wzang@chromium.org>
Reviewed-by: default avatarXiyuan Xia <xiyuan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#537167}
parent 2d2eeb0f
...@@ -20,21 +20,33 @@ ...@@ -20,21 +20,33 @@
<message name="IDS_WALLPAPER_MANAGER_CUSTOM_CATEGORY_LABEL" desc="Wallpaper category label."> <message name="IDS_WALLPAPER_MANAGER_CUSTOM_CATEGORY_LABEL" desc="Wallpaper category label.">
Custom Custom
</message> </message>
<message name="IDS_WALLPAPER_MANAGER_MY_PHOTOS_CATEGORY_LABEL" desc="Wallpaper category label, the equivalent of the Custom category on the new wallpaper picker.">
My Photos
</message>
<message name="IDS_WALLPAPER_MANAGER_SELECT_CUSTOM_LABEL" desc="Selects custom wallpaper label."> <message name="IDS_WALLPAPER_MANAGER_SELECT_CUSTOM_LABEL" desc="Selects custom wallpaper label.">
Custom Image: Custom Image:
</message> </message>
<message name="IDS_WALLPAPER_MANAGER_POSITION_LABEL" desc="Custom wallpaper position label"> <message name="IDS_WALLPAPER_MANAGER_POSITION_LABEL" desc="Custom wallpaper position label.">
Position: Position:
</message> </message>
<message name="IDS_WALLPAPER_MANAGER_COLOR_LABEL" desc="Custom wallpaper color label."> <message name="IDS_WALLPAPER_MANAGER_COLOR_LABEL" desc="Custom wallpaper color label.">
Color: Color:
</message> </message>
<message name="IDS_WALLPAPER_MANAGER_SHOW_CUSTOM_WALLPAPER_ON_START_WARNING" desc="The string displayed to user when set custom wallpaper"> <message name="IDS_WALLPAPER_MANAGER_REFRESH_LABEL" desc="The label of the refresh option in the top bar. Upon click, the wallpaper picker will fetch the online wallpapers again.">
Refresh
</message>
<message name="IDS_WALLPAPER_MANAGER_EXPLORE_LABEL" desc="The label of the explore option in the top bar. Upon click, a link with more information on the selected wallpaper will open.">
Explore
</message>
<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. Wallpapers appear on the Sign-in Screen.
</message> </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)."> <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 Surprise Me
</message> </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."> <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. Chrome cannot access wallpapers. Please connect to a network.
</message> </message>
...@@ -50,6 +62,9 @@ ...@@ -50,6 +62,9 @@
<message name="IDS_WALLPAPER_MANAGER_INVALID_WALLPAPER" desc="The string displayed to user when user selected wallpaper can not be set as a wallpaper."> <message name="IDS_WALLPAPER_MANAGER_INVALID_WALLPAPER" desc="The string displayed to user when user selected wallpaper can not be set as a wallpaper.">
Chrome cannot set wallpaper. Chrome cannot set wallpaper.
</message> </message>
<message name="IDS_WALLPAPER_MANAGER_NO_IMAGES_AVAILABLE" desc="The string displayed to user when there're no local files that can be used as wallpaper.">
No images available
</message>
<message name="IDS_WALLPAPER_MANAGER_LAYOUT_CENTER" desc="Label for option to center a customized wallpaper."> <message name="IDS_WALLPAPER_MANAGER_LAYOUT_CENTER" desc="Label for option to center a customized wallpaper.">
Center Center
</message> </message>
......
...@@ -93,6 +93,11 @@ bool IsOEMDefaultWallpaper() { ...@@ -93,6 +93,11 @@ bool IsOEMDefaultWallpaper() {
chromeos::switches::kDefaultWallpaperIsOem); chromeos::switches::kDefaultWallpaperIsOem);
} }
bool IsUsingNewWallpaperPicker() {
return base::CommandLine::ForCurrentProcess()->HasSwitch(
chromeos::switches::kNewWallpaperPicker);
}
// Saves |data| as |file_name| to directory with |key|. Return false if the // Saves |data| as |file_name| to directory with |key|. Return false if the
// directory can not be found/created or failed to write file. // directory can not be found/created or failed to write file.
bool SaveData(int key, bool SaveData(int key,
...@@ -198,11 +203,15 @@ ExtensionFunction::ResponseAction WallpaperPrivateGetStringsFunction::Run() { ...@@ -198,11 +203,15 @@ ExtensionFunction::ResponseAction WallpaperPrivateGetStringsFunction::Run() {
SET_STRING("allCategoryLabel", IDS_WALLPAPER_MANAGER_ALL_CATEGORY_LABEL); SET_STRING("allCategoryLabel", IDS_WALLPAPER_MANAGER_ALL_CATEGORY_LABEL);
SET_STRING("deleteCommandLabel", IDS_WALLPAPER_MANAGER_DELETE_COMMAND_LABEL); SET_STRING("deleteCommandLabel", IDS_WALLPAPER_MANAGER_DELETE_COMMAND_LABEL);
SET_STRING("customCategoryLabel", SET_STRING("customCategoryLabel",
IDS_WALLPAPER_MANAGER_CUSTOM_CATEGORY_LABEL); IsUsingNewWallpaperPicker()
? IDS_WALLPAPER_MANAGER_MY_PHOTOS_CATEGORY_LABEL
: IDS_WALLPAPER_MANAGER_CUSTOM_CATEGORY_LABEL);
SET_STRING("selectCustomLabel", SET_STRING("selectCustomLabel",
IDS_WALLPAPER_MANAGER_SELECT_CUSTOM_LABEL); IDS_WALLPAPER_MANAGER_SELECT_CUSTOM_LABEL);
SET_STRING("positionLabel", IDS_WALLPAPER_MANAGER_POSITION_LABEL); SET_STRING("positionLabel", IDS_WALLPAPER_MANAGER_POSITION_LABEL);
SET_STRING("colorLabel", IDS_WALLPAPER_MANAGER_COLOR_LABEL); SET_STRING("colorLabel", IDS_WALLPAPER_MANAGER_COLOR_LABEL);
SET_STRING("refreshLabel", IDS_WALLPAPER_MANAGER_REFRESH_LABEL);
SET_STRING("exploreLabel", IDS_WALLPAPER_MANAGER_EXPLORE_LABEL);
SET_STRING("centerCroppedLayout", SET_STRING("centerCroppedLayout",
IDS_WALLPAPER_MANAGER_LAYOUT_CENTER_CROPPED); IDS_WALLPAPER_MANAGER_LAYOUT_CENTER_CROPPED);
SET_STRING("centerLayout", IDS_WALLPAPER_MANAGER_LAYOUT_CENTER); SET_STRING("centerLayout", IDS_WALLPAPER_MANAGER_LAYOUT_CENTER);
...@@ -214,7 +223,10 @@ ExtensionFunction::ResponseAction WallpaperPrivateGetStringsFunction::Run() { ...@@ -214,7 +223,10 @@ ExtensionFunction::ResponseAction WallpaperPrivateGetStringsFunction::Run() {
IDS_WALLPAPER_MANAGER_SHOW_CUSTOM_WALLPAPER_ON_START_WARNING); IDS_WALLPAPER_MANAGER_SHOW_CUSTOM_WALLPAPER_ON_START_WARNING);
SET_STRING("accessFileFailure", IDS_WALLPAPER_MANAGER_ACCESS_FILE_FAILURE); SET_STRING("accessFileFailure", IDS_WALLPAPER_MANAGER_ACCESS_FILE_FAILURE);
SET_STRING("invalidWallpaper", IDS_WALLPAPER_MANAGER_INVALID_WALLPAPER); SET_STRING("invalidWallpaper", IDS_WALLPAPER_MANAGER_INVALID_WALLPAPER);
SET_STRING("surpriseMeLabel", IDS_WALLPAPER_MANAGER_SURPRISE_ME_LABEL); 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("learnMore", IDS_LEARN_MORE); SET_STRING("learnMore", IDS_LEARN_MORE);
SET_STRING("currentWallpaperSetByMessage", SET_STRING("currentWallpaperSetByMessage",
IDS_CURRENT_WALLPAPER_SET_BY_MESSAGE); IDS_CURRENT_WALLPAPER_SET_BY_MESSAGE);
...@@ -245,9 +257,7 @@ ExtensionFunction::ResponseAction WallpaperPrivateGetStringsFunction::Run() { ...@@ -245,9 +257,7 @@ ExtensionFunction::ResponseAction WallpaperPrivateGetStringsFunction::Run() {
dict->SetBoolean("isOEMDefaultWallpaper", IsOEMDefaultWallpaper()); dict->SetBoolean("isOEMDefaultWallpaper", IsOEMDefaultWallpaper());
dict->SetString("canceledWallpaper", dict->SetString("canceledWallpaper",
wallpaper_api_util::kCancelWallpaperMessage); wallpaper_api_util::kCancelWallpaperMessage);
dict->SetBoolean("useNewWallpaperPicker", dict->SetBoolean("useNewWallpaperPicker", IsUsingNewWallpaperPicker());
base::CommandLine::ForCurrentProcess()->HasSwitch(
chromeos::switches::kNewWallpaperPicker));
bool show_backdrop_wallpapers = false; bool show_backdrop_wallpapers = false;
#if defined(GOOGLE_CHROME_BUILD) #if defined(GOOGLE_CHROME_BUILD)
......
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