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

Unified Diff: chrome/browser/resources/chromeos/wallpaper_manager/js/wallpaper_manager.js

Issue 1227413005: Disable Delete option for custom wallpapers when 'Surprise Me' is enabled. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 5 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/chromeos/wallpaper_manager/js/wallpaper_manager.js
diff --git a/chrome/browser/resources/chromeos/wallpaper_manager/js/wallpaper_manager.js b/chrome/browser/resources/chromeos/wallpaper_manager/js/wallpaper_manager.js
index b82d5cdce3ca21fa79a2eec14bd6761904ced6db..a0c6b3df8d77c48c6b717d0b722daaf73cb25bec 100644
--- a/chrome/browser/resources/chromeos/wallpaper_manager/js/wallpaper_manager.js
+++ b/chrome/browser/resources/chromeos/wallpaper_manager/js/wallpaper_manager.js
@@ -203,6 +203,8 @@ function WallpaperManager(dialogDom) {
if (chrome.runtime.lastError == null) {
if (shouldEnable) {
checkbox.classList.add('checked');
+ if (self.document_.body.hasAttribute('custom'))
+ self.document_.body.removeAttribute('custom');
bshe 2015/07/15 18:40:49 custom should only be used to indicate if we are a
// Hides the wallpaper set by message if there is any.
$('wallpaper-set-by-message').textContent = '';
} else {
@@ -213,6 +215,9 @@ function WallpaperManager(dialogDom) {
self.onWallpaperChanged_(self.wallpaperGrid_.activeItem,
self.currentWallpaper_);
}
+ var selectedIndex = self.categoriesList_.selectionModel.selectedIndex;
+ if (selectedIndex == self.categoriesList_.dataModel.length - 1)
+ self.document_.body.setAttribute('custom', '');
checkbox.classList.remove('checked');
}
$('categories-list').disabled = shouldEnable;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698