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

Side by Side Diff: chrome/browser/resources/chromeos/wallpaper_manager/js/event_page.js

Issue 274163003: Revert 263741 "Enable surprise me wallpaper for new profiles." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: rebase Created 6 years, 7 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 var WALLPAPER_PICKER_WIDTH = 574; 5 var WALLPAPER_PICKER_WIDTH = 574;
6 var WALLPAPER_PICKER_HEIGHT = 420; 6 var WALLPAPER_PICKER_HEIGHT = 420;
7 var SURPRISE_ME_ALARM_NAME = 'DefaultEnableSurpriseMe';
8 7
9 var wallpaperPickerWindow; 8 var wallpaperPickerWindow;
10 9
11 var surpriseWallpaper = null; 10 var surpriseWallpaper = null;
12 11
13 function SurpriseWallpaper() { 12 function SurpriseWallpaper() {
14 } 13 }
15 14
16 /** 15 /**
17 * Gets SurpriseWallpaper instance. In case it hasn't been initialized, a new 16 * Gets SurpriseWallpaper instance. In case it hasn't been initialized, a new
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after
265 WallpaperUtil.setOnlineWallpaper(newValue.url, newValue.layout, 264 WallpaperUtil.setOnlineWallpaper(newValue.url, newValue.layout,
266 function() {}, function() {}); 265 function() {}, function() {});
267 } 266 }
268 WallpaperUtil.saveToStorage(Constants.AccessLocalWallpaperInfoKey, 267 WallpaperUtil.saveToStorage(Constants.AccessLocalWallpaperInfoKey,
269 newValue, false); 268 newValue, false);
270 } 269 }
271 }); 270 });
272 } 271 }
273 }); 272 });
274 273
275 chrome.alarms.onAlarm.addListener(function(alarm) { 274 chrome.alarms.onAlarm.addListener(function() {
276 if (alarm.name === SURPRISE_ME_ALARM_NAME) { 275 SurpriseWallpaper.getInstance().next();
277 Constants.WallpaperSyncStorage.get(Constants.AccessSurpriseMeEnabledKey,
278 function(items) {
279 if (!items.hasOwnProperty(Constants.AccessSurpriseMeEnabledKey)) {
280 WallpaperUtil.saveToStorage(Constants.AccessSurpriseMeEnabledKey,
281 true, true);
282 }
283 });
284 } else {
285 SurpriseWallpaper.getInstance().next();
286 }
287 }); 276 });
288
289 /**
290 * Enables surprise me wallpaper iff it has not already been configured.
291 */
292 chrome.wallpaperPrivate.onRequestEnableSurpriseMe.addListener(function() {
293 chrome.alarms.create(SURPRISE_ME_ALARM_NAME, {delayInMinutes: 5});
294 });
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/login/wallpaper_manager.cc ('k') | chrome/common/extensions/api/wallpaper_private.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698