Chromium Code Reviews| 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 ea66985b36e708b054e811f62694fc36aaee379b..07815ec6d3da3306c2e0f19f5884c9f6e50761e2 100644 |
| --- a/chrome/browser/resources/chromeos/wallpaper_manager/js/wallpaper_manager.js |
| +++ b/chrome/browser/resources/chromeos/wallpaper_manager/js/wallpaper_manager.js |
| @@ -285,13 +285,20 @@ function WallpaperManager(dialogDom) { |
| $('set-wallpaper-layout').addEventListener( |
| 'change', this.onWallpaperLayoutChanged_.bind(this)); |
| - if (loadTimeData.valueExists('wallpaperAppName')) { |
|
tbarzic
2016/01/28 20:10:48
I don't think you can get rid of this yet.
You can
xdai1
2016/02/02 01:19:42
Done.
|
| - $('wallpaper-set-by-message').textContent = loadTimeData.getStringF( |
| - 'currentWallpaperSetByMessage', str('wallpaperAppName')); |
| - $('wallpaper-grid').classList.add('small'); |
| - } else { |
| - $('wallpaper-grid').classList.remove('small'); |
| - } |
| + // Always use the value from local filesystem to avoid the time window of |
| + // setting the third party app name and the third party wallpaper. |
| + Constants.WallpaperLocalStorage.get( |
| + Constants.AccessLocalThirdPartyAppName, function(items) { |
| + if (items.hasOwnProperty(Constants.AccessLocalThirdPartyAppName) && |
| + items[Constants.AccessLocalThirdPartyAppName]) { |
| + $('wallpaper-set-by-message').textContent = |
| + loadTimeData.getStringF('currentWallpaperSetByMessage', |
| + items[Constants.AccessLocalThirdPartyAppName]); |
| + $('wallpaper-grid').classList.add('small'); |
| + } else { |
| + $('wallpaper-grid').classList.remove('small'); |
| + } |
| + }); |
|
tbarzic
2016/01/28 20:10:48
Maybe add listener to local storage to update the
xdai1
2016/02/02 01:19:42
Will do it in a following CL.
|
| if (this.enableOnlineWallpaper_) { |
| var self = this; |
| @@ -551,6 +558,9 @@ function WallpaperManager(dialogDom) { |
| // Hides the wallpaper set by message. |
| $('wallpaper-set-by-message').textContent = ''; |
| $('wallpaper-grid').classList.remove('small'); |
| + // If the user manually selects a wallpaper from the built-in wallpaper |
| + // picker app, we should clear the third party app name if possible. |
|
tbarzic
2016/01/28 20:10:48
nit: remove "if possible" from the comment.
Also,
xdai1
2016/02/02 01:19:42
Done.
|
| + WallpaperUtil.clearThirdPartyAppName(); |
| }; |
| /** |