Commit f5041207 authored by Regan Hsu's avatar Regan Hsu Committed by Commit Bot

[CrOS Wallpaper] Hide 'center' and 'center cropped' buttons on default.

Do not show "Center" and "Center Cropped" if the wallpaper is
of type 'OemDefaultWallpaper'.  These buttons should only be shown
when the Currently Set image is the user's.

Bug: 973011
Change-Id: Ib1899f430854fa928d807af552b79c51ed3b8ea6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1854797
Commit-Queue: Regan Hsu <hsuregan@chromium.org>
Reviewed-by: default avatarXiaoqian Dai <xdai@chromium.org>
Cr-Commit-Position: refs/heads/master@{#705310}
parent 66aa5163
...@@ -57,6 +57,9 @@ function WallpaperManager(dialogDom) { ...@@ -57,6 +57,9 @@ function WallpaperManager(dialogDom) {
// TODO(bshe): Get rid of anonymous namespace. // TODO(bshe): Get rid of anonymous namespace.
(function() { (function() {
// Default wallpaper url
var OEM_DEFAULT_WALLPAPER_URL = 'OemDefaultWallpaper';
/** /**
* The following values should be kept in sync with the style sheet. * The following values should be kept in sync with the style sheet.
*/ */
...@@ -461,7 +464,8 @@ WallpaperManager.prototype.decorateCurrentWallpaperInfoBar_ = function() { ...@@ -461,7 +464,8 @@ WallpaperManager.prototype.decorateCurrentWallpaperInfoBar_ = function() {
currentWallpaperInfo => { currentWallpaperInfo => {
// Initialize the "more options" buttons. // Initialize the "more options" buttons.
var isOnlineWallpaper = !!currentWallpaperInfo; var isOnlineWallpaper = !!currentWallpaperInfo;
var isDefaultWallpaper = !this.currentWallpaper_; var isDefaultWallpaper = !this.currentWallpaper_ ||
this.currentWallpaper_ == OEM_DEFAULT_WALLPAPER_URL;
var visibleItemList = []; var visibleItemList = [];
$('refresh').hidden = !isOnlineWallpaper || !this.dailyRefreshInfo_ || $('refresh').hidden = !isOnlineWallpaper || !this.dailyRefreshInfo_ ||
!this.dailyRefreshInfo_.enabled; !this.dailyRefreshInfo_.enabled;
...@@ -1288,7 +1292,7 @@ WallpaperManager.prototype.onCategoriesChange_ = function() { ...@@ -1288,7 +1292,7 @@ WallpaperManager.prototype.onCategoriesChange_ = function() {
if (loadTimeData.getBoolean('isOEMDefaultWallpaper')) { if (loadTimeData.getBoolean('isOEMDefaultWallpaper')) {
var defaultWallpaperInfo = { var defaultWallpaperInfo = {
wallpaperId: null, wallpaperId: null,
baseURL: 'OemDefaultWallpaper', baseURL: OEM_DEFAULT_WALLPAPER_URL,
layout: Constants.WallpaperThumbnailDefaultLayout, layout: Constants.WallpaperThumbnailDefaultLayout,
source: Constants.WallpaperSourceEnum.OEM, source: Constants.WallpaperSourceEnum.OEM,
ariaLabel: loadTimeData.getString('defaultWallpaperLabel'), ariaLabel: loadTimeData.getString('defaultWallpaperLabel'),
...@@ -1704,5 +1708,4 @@ WallpaperManager.prototype.disableDailyRefresh_ = function() { ...@@ -1704,5 +1708,4 @@ WallpaperManager.prototype.disableDailyRefresh_ = function() {
this.updateDailyRefreshItemStates_(this.dailyRefreshInfo_); this.updateDailyRefreshItemStates_(this.dailyRefreshInfo_);
this.decorateCurrentWallpaperInfoBar_(); this.decorateCurrentWallpaperInfoBar_();
}; };
})(); })();
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