Chromium Code Reviews| Index: chrome/browser/resources/chromeos/wallpaper_manager/js/event_page.js |
| diff --git a/chrome/browser/resources/chromeos/wallpaper_manager/js/event_page.js b/chrome/browser/resources/chromeos/wallpaper_manager/js/event_page.js |
| index 71062033f168ba4bc7d028f2f65f0f07528ae82b..52b9e62a416dcc7bf7e2b846f3136306b635fde9 100644 |
| --- a/chrome/browser/resources/chromeos/wallpaper_manager/js/event_page.js |
| +++ b/chrome/browser/resources/chromeos/wallpaper_manager/js/event_page.js |
| @@ -274,3 +274,16 @@ chrome.storage.onChanged.addListener(function(changes, namespace) { |
| chrome.alarms.onAlarm.addListener(function() { |
| SurpriseWallpaper.getInstance().next(); |
| }); |
| + |
| +/** |
| + * Enables surprise me wallpaper iff it has not already been configured. |
| + */ |
| +chrome.wallpaperPrivate.onRequestEnableSurpriseMe.addListener(function() { |
| + Constants.WallpaperSyncStorage.get(Constants.AccessSurpriseMeEnabledKey, |
| + function(items) { |
| + if (!items.hasOwnProperty(Constants.AccessSurpriseMeEnabledKey)) { |
|
Nikita (slow)
2014/04/08 16:58:27
I wonder if that's the right time to check for thi
Harry McCleave
2014/04/09 02:41:33
My impression was that if this sync fails for what
bshe
2014/04/09 14:32:15
Is this going to be called when an existing user l
|
| + WallpaperUtil.saveToStorage(Constants.AccessSurpriseMeEnabledKey, |
| + true, true); |
| + } |
| + }); |
| +}); |