The new wallpaper picker uses a completely new way of fetching online wallpapers, so the 'Surprise me' needs to be updated too. Other than that, we should try to reuse the existing code.
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/d9d6e7eac6d2ff70095dbcb38900e0abbe621ce3 commit d9d6e7eac6d2ff70095dbcb38900e0abbe621ce3 Author: Wenzhao Zang <wzang@chromium.org> Date: Fri Feb 09 22:55:04 2018 cros: Implement 'Surprise me' for the new wallpaper picker The current (old) wallpaper picker saves all the wallpaper urls in local storage (in the manifest file). We don't have to do this for the new wallpaper picker because it's straightforward to directly request a new random wallpaper real-time from the server, and it will avoid the cases that the urls may become invalid. Call wallpaperManager.toggleSurpriseMe_() from the dev tool. Also consider adjust the timer for faster wallpaper change. And the current wallpaper picker should not have behavior changes Bug: 810169 Test: Use switch 'new-wallpaper-picker'. Cq-Include-Trybots: master.tryserver.chromium.linux:closure_compilation Change-Id: I09416a60863794ddecb5d1d2291bd5660241b7a7 Reviewed-on: https://chromium-review.googlesource.com/907697 Reviewed-by: Xiaoqian Dai <xdai@chromium.org> Commit-Queue: Wenzhao (Colin) Zang <wzang@chromium.org> Cr-Commit-Position: refs/heads/master@{#535869} [modify] https://crrev.com/d9d6e7eac6d2ff70095dbcb38900e0abbe621ce3/chrome/browser/resources/chromeos/wallpaper_manager/js/event_page.js [modify] https://crrev.com/d9d6e7eac6d2ff70095dbcb38900e0abbe621ce3/chrome/test/data/chromeos/wallpaper_manager/unit_tests/api_mock.js [modify] https://crrev.com/d9d6e7eac6d2ff70095dbcb38900e0abbe621ce3/chrome/test/data/chromeos/wallpaper_manager/unit_tests/event_page_unittest.js
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/9c06bd3c9ad71cee662fa3abb658a0592a3da0d5 commit 9c06bd3c9ad71cee662fa3abb658a0592a3da0d5 Author: Wenzhao Zang <wzang@chromium.org> Date: Fri Feb 23 02:30:03 2018 cros: Add the daily refresh toggle on wallpaper picker Daily refresh is the same with Surprise me and the back end is already implemented. A mock of the 'slideshow' animation: https://goo.gl/JqFkYg Bug: 810169 Cq-Include-Trybots: master.tryserver.chromium.linux:closure_compilation Change-Id: I91498c2a64bdf05b313f64eb101f0549db1412c7 Reviewed-on: https://chromium-review.googlesource.com/924982 Commit-Queue: Wenzhao (Colin) Zang <wzang@chromium.org> Reviewed-by: Alexander Alekseev <alemate@chromium.org> Cr-Commit-Position: refs/heads/master@{#538671} [modify] https://crrev.com/9c06bd3c9ad71cee662fa3abb658a0592a3da0d5/chrome/browser/resources/chromeos/wallpaper_manager/css/wallpaper_manager.css [modify] https://crrev.com/9c06bd3c9ad71cee662fa3abb658a0592a3da0d5/chrome/browser/resources/chromeos/wallpaper_manager/js/event_page.js [modify] https://crrev.com/9c06bd3c9ad71cee662fa3abb658a0592a3da0d5/chrome/browser/resources/chromeos/wallpaper_manager/js/util.js [modify] https://crrev.com/9c06bd3c9ad71cee662fa3abb658a0592a3da0d5/chrome/browser/resources/chromeos/wallpaper_manager/js/wallpaper_images_grid.js [modify] https://crrev.com/9c06bd3c9ad71cee662fa3abb658a0592a3da0d5/chrome/browser/resources/chromeos/wallpaper_manager/js/wallpaper_manager.js [modify] https://crrev.com/9c06bd3c9ad71cee662fa3abb658a0592a3da0d5/chrome/browser/resources/chromeos/wallpaper_manager/main.html
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/fdb4c49717877c2c5aea902f6a380435e1c2d71e commit fdb4c49717877c2c5aea902f6a380435e1c2d71e Author: Wenzhao Zang <wzang@chromium.org> Date: Thu May 31 19:24:56 2018 cros: Create "surprise me" image fetcher for new wallpaper picker The random wallpaper for "surprise me" should be selected by the Backdrop server. Creates a new fetcher to handle the request. Bug: 810169 Change-Id: I3dc6493ed7083b545caa1224424222a8290fcb8b Reviewed-on: https://chromium-review.googlesource.com/1077769 Commit-Queue: Wenzhao (Colin) Zang <wzang@chromium.org> Reviewed-by: Xiyuan Xia <xiyuan@chromium.org> Reviewed-by: Toni Barzic <tbarzic@chromium.org> Cr-Commit-Position: refs/heads/master@{#563343} [modify] https://crrev.com/fdb4c49717877c2c5aea902f6a380435e1c2d71e/chrome/browser/chromeos/extensions/backdrop_wallpaper_handlers/backdrop_wallpaper_handlers.cc [modify] https://crrev.com/fdb4c49717877c2c5aea902f6a380435e1c2d71e/chrome/browser/chromeos/extensions/backdrop_wallpaper_handlers/backdrop_wallpaper_handlers.h [modify] https://crrev.com/fdb4c49717877c2c5aea902f6a380435e1c2d71e/chrome/browser/chromeos/extensions/wallpaper_private_api.cc [modify] https://crrev.com/fdb4c49717877c2c5aea902f6a380435e1c2d71e/chrome/browser/chromeos/extensions/wallpaper_private_api.h [modify] https://crrev.com/fdb4c49717877c2c5aea902f6a380435e1c2d71e/chrome/common/extensions/api/wallpaper_private.json [modify] https://crrev.com/fdb4c49717877c2c5aea902f6a380435e1c2d71e/extensions/browser/extension_function_histogram_value.h [modify] https://crrev.com/fdb4c49717877c2c5aea902f6a380435e1c2d71e/tools/metrics/histograms/enums.xml
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/b7b138683324e5d48d556d923a6f065d4dc56bd4 commit b7b138683324e5d48d556d923a6f065d4dc56bd4 Author: Wenzhao Zang <wzang@chromium.org> Date: Wed Jun 20 05:20:20 2018 cros: Fetch daily refresh image from Backdrop service 1) The new wallpaper picker relies on the Backdrop server to select surprise me images, instead of selecting random images by ourseleves (the back-end was implemented by a prior CL). 2) The surprise me images are per-category, ie. each wallpaper category has a "daily refresh slider". At most one slider may be active at a time. Toggling one slider to active should deactivate others. 3) Use "daily refresh" instead of "surprise me" in the code to distinguish from the old picker. Although it's possible to share code path with the old picker, generally avoid it for clarity. Test steps include: 1) Toggle daily refresh between enabled/disabled, during tablet/clamshell mode, and among different categories. 2) Enable surprise me on the old picker, then add switch --new-wallpaper-picker, and see the migration. 3) See the sync is working for two devices with the same account id. Bug: 834998, 810169 , 834994, 837338 Change-Id: I369ce57ac4bd07e91da31bb2971b6970501f9c3a Reviewed-on: https://chromium-review.googlesource.com/1093742 Commit-Queue: Wenzhao (Colin) Zang <wzang@chromium.org> Reviewed-by: Xiaoqian Dai <xdai@chromium.org> Cr-Commit-Position: refs/heads/master@{#568732} [modify] https://crrev.com/b7b138683324e5d48d556d923a6f065d4dc56bd4/chrome/browser/resources/chromeos/wallpaper_manager/css/wallpaper_manager.css [modify] https://crrev.com/b7b138683324e5d48d556d923a6f065d4dc56bd4/chrome/browser/resources/chromeos/wallpaper_manager/js/constants.js [modify] https://crrev.com/b7b138683324e5d48d556d923a6f065d4dc56bd4/chrome/browser/resources/chromeos/wallpaper_manager/js/event_page.js [modify] https://crrev.com/b7b138683324e5d48d556d923a6f065d4dc56bd4/chrome/browser/resources/chromeos/wallpaper_manager/js/util.js [modify] https://crrev.com/b7b138683324e5d48d556d923a6f065d4dc56bd4/chrome/browser/resources/chromeos/wallpaper_manager/js/wallpaper_images_grid.js [modify] https://crrev.com/b7b138683324e5d48d556d923a6f065d4dc56bd4/chrome/browser/resources/chromeos/wallpaper_manager/js/wallpaper_manager.js [modify] https://crrev.com/b7b138683324e5d48d556d923a6f065d4dc56bd4/chrome/browser/resources/chromeos/wallpaper_manager/main.html [modify] https://crrev.com/b7b138683324e5d48d556d923a6f065d4dc56bd4/chrome/test/data/chromeos/wallpaper_manager/unit_tests/api_mock.js
Comment 1 by bugdroid1@chromium.org
, Feb 9 2018