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..364217a158406ac683098f5f877f1b61e3af87ce 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,29 @@ function WallpaperManager(dialogDom) { |
| $('set-wallpaper-layout').addEventListener( |
| 'change', this.onWallpaperLayoutChanged_.bind(this)); |
| - if (loadTimeData.valueExists('wallpaperAppName')) { |
| - $('wallpaper-set-by-message').textContent = loadTimeData.getStringF( |
| - 'currentWallpaperSetByMessage', str('wallpaperAppName')); |
| - $('wallpaper-grid').classList.add('small'); |
| - } else { |
| - $('wallpaper-grid').classList.remove('small'); |
| - } |
| + // Always prefer the value from local filesystem to avoid the time window |
| + // of setting the third party app name and the third party wallpaper. |
| + var getThirdPartyAppName = function(callback) { |
| + Constants.WallpaperLocalStorage.get( |
| + Constants.AccessLocalThirdPartyAppName, function(items) { |
| + if (items.hasOwnProperty(Constants.AccessLocalThirdPartyAppName)) |
| + callback(items[Constants.AccessLocalThirdPartyAppName]); |
| + else if (loadTimeData.valueExists('wallpaperAppName')) |
| + callback(str('wallpaperAppName')); |
| + else |
| + callback(''); |
| + }); |
| + }; |
| + |
| + getThirdPartyAppName(function(appName) { |
| + if (!!appName) { |
| + $('wallpaper-set-by-message').textContent = loadTimeData.getStringF( |
| + 'currentWallpaperSetByMessage', appName); |
| + $('wallpaper-grid').classList.add('small'); |
| + } else { |
| + $('wallpaper-grid').classList.remove('small'); |
| + } |
| + }); |
| if (this.enableOnlineWallpaper_) { |
| var self = this; |
| @@ -551,6 +567,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, third party app name should be cleared. |
| + WallpaperUtil.clearThirdPartyAppName(); |
|
tbarzic
2016/02/02 20:59:38
you should do this only when the rest of wallpaper
|
| }; |
| /** |