Enable icons specified under options here: https://github.com/WICG/background-fetch#starting-a-background-fetch
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/1cd280d1d52215094789d52a1284413042a0f128 commit 1cd280d1d52215094789d52a1284413042a0f128 Author: Mugdha Lakhani <nator@chromium.org> Date: Tue Feb 27 16:47:28 2018 Add an IconLoader for Background Fetch. This takes a url to an icon, and downloads it, in memory. It's not currently storing it in disk, or resizing it, or even allowing selection from a list of icons. This functionality will be added later. And a unit test to verify expected behavior. Bug: 813564 Change-Id: Ia00945d4f0c5f2b4bccd2fb03dcf289b265af110 Reviewed-on: https://chromium-review.googlesource.com/932121 Commit-Queue: Mugdha Lakhani <nator@chromium.org> Reviewed-by: Peter Beverloo <peter@chromium.org> Reviewed-by: Kentaro Hara <haraken@chromium.org> Cr-Commit-Position: refs/heads/master@{#539459} [modify] https://crrev.com/1cd280d1d52215094789d52a1284413042a0f128/third_party/WebKit/Source/modules/BUILD.gn [modify] https://crrev.com/1cd280d1d52215094789d52a1284413042a0f128/third_party/WebKit/Source/modules/background_fetch/BUILD.gn [add] https://crrev.com/1cd280d1d52215094789d52a1284413042a0f128/third_party/WebKit/Source/modules/background_fetch/BackgroundFetchIconLoader.cpp [add] https://crrev.com/1cd280d1d52215094789d52a1284413042a0f128/third_party/WebKit/Source/modules/background_fetch/BackgroundFetchIconLoader.h [add] https://crrev.com/1cd280d1d52215094789d52a1284413042a0f128/third_party/WebKit/Source/modules/background_fetch/BackgroundFetchIconLoaderTest.cpp [modify] https://crrev.com/1cd280d1d52215094789d52a1284413042a0f128/third_party/WebKit/Source/modules/background_fetch/DEPS
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/b0805c7666dbbb071dd5671acdc57772e3ddab99 commit b0805c7666dbbb071dd5671acdc57772e3ddab99 Author: Mugdha Lakhani <nator@chromium.org> Date: Fri Mar 02 13:06:19 2018 [Background Fetch] Add logic to fetch() to load first icon provided by the user as part of BackgroundFetchOptions. This functionality will be expanded in the future to select the icon that best suits the display area. Downloading of this icon is not fatal to the fetch, hence no feedback is given to the caller of the API. This is also why no layout tests are added. Tested manually using a test website and logging to validate the correct codepath is invoked, and the expect icon is loaded in memory. Bug: 813564 Change-Id: I75215fc55d7c61b472ceb1cb8e601ca5f477a174 Reviewed-on: https://chromium-review.googlesource.com/939781 Commit-Queue: Mugdha Lakhani <nator@chromium.org> Reviewed-by: Peter Beverloo <peter@chromium.org> Reviewed-by: Kentaro Hara <haraken@chromium.org> Cr-Commit-Position: refs/heads/master@{#540504} [modify] https://crrev.com/b0805c7666dbbb071dd5671acdc57772e3ddab99/third_party/WebKit/Source/modules/background_fetch/BackgroundFetchIconLoader.cpp [modify] https://crrev.com/b0805c7666dbbb071dd5671acdc57772e3ddab99/third_party/WebKit/Source/modules/background_fetch/BackgroundFetchIconLoader.h [modify] https://crrev.com/b0805c7666dbbb071dd5671acdc57772e3ddab99/third_party/WebKit/Source/modules/background_fetch/BackgroundFetchIconLoaderTest.cpp [modify] https://crrev.com/b0805c7666dbbb071dd5671acdc57772e3ddab99/third_party/WebKit/Source/modules/background_fetch/BackgroundFetchManager.cpp [modify] https://crrev.com/b0805c7666dbbb071dd5671acdc57772e3ddab99/third_party/WebKit/Source/modules/background_fetch/BackgroundFetchManager.h
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/4de0e19eda219aaa19a16750006cb215fcb23e51 commit 4de0e19eda219aaa19a16750006cb215fcb23e51 Author: Mugdha Lakhani <nator@chromium.org> Date: Thu Mar 15 13:07:32 2018 [Background Fetch] Pass developer-provided icon to browser process from the renderer, all the way through to OfflineItemsCollector, so that it can be used in notifications. Also persist it using DataManager. Additionally, a unit test has been added under browser_tests. Bug: 813564 Change-Id: I8953deb9a7b19ed6cdab16806e79ffad98186256 Reviewed-on: https://chromium-review.googlesource.com/956183 Commit-Queue: Mugdha Lakhani <nator@chromium.org> Reviewed-by: Robert Sesek <rsesek@chromium.org> Reviewed-by: David Trainor <dtrainor@chromium.org> Reviewed-by: Avi Drissman <avi@chromium.org> Reviewed-by: Peter Beverloo <peter@chromium.org> Cr-Commit-Position: refs/heads/master@{#543354} [modify] https://crrev.com/4de0e19eda219aaa19a16750006cb215fcb23e51/chrome/browser/background_fetch/background_fetch_browsertest.cc [modify] https://crrev.com/4de0e19eda219aaa19a16750006cb215fcb23e51/chrome/browser/background_fetch/background_fetch_delegate_impl.cc [modify] https://crrev.com/4de0e19eda219aaa19a16750006cb215fcb23e51/chrome/browser/background_fetch/background_fetch_delegate_impl.h [modify] https://crrev.com/4de0e19eda219aaa19a16750006cb215fcb23e51/chrome/test/data/background_fetch/background_fetch.js [modify] https://crrev.com/4de0e19eda219aaa19a16750006cb215fcb23e51/components/offline_items_collection/core/android/offline_content_aggregator_bridge.cc [modify] https://crrev.com/4de0e19eda219aaa19a16750006cb215fcb23e51/components/offline_items_collection/core/android/offline_item_visuals_bridge.cc [modify] https://crrev.com/4de0e19eda219aaa19a16750006cb215fcb23e51/components/offline_items_collection/core/android/offline_item_visuals_bridge.h [modify] https://crrev.com/4de0e19eda219aaa19a16750006cb215fcb23e51/components/offline_items_collection/core/offline_content_provider.h [modify] https://crrev.com/4de0e19eda219aaa19a16750006cb215fcb23e51/content/browser/background_fetch/background_fetch_context.cc [modify] https://crrev.com/4de0e19eda219aaa19a16750006cb215fcb23e51/content/browser/background_fetch/background_fetch_context.h [modify] https://crrev.com/4de0e19eda219aaa19a16750006cb215fcb23e51/content/browser/background_fetch/background_fetch_data_manager.cc [modify] https://crrev.com/4de0e19eda219aaa19a16750006cb215fcb23e51/content/browser/background_fetch/background_fetch_data_manager.h [modify] https://crrev.com/4de0e19eda219aaa19a16750006cb215fcb23e51/content/browser/background_fetch/background_fetch_data_manager_unittest.cc [modify] https://crrev.com/4de0e19eda219aaa19a16750006cb215fcb23e51/content/browser/background_fetch/background_fetch_delegate_proxy.cc [modify] https://crrev.com/4de0e19eda219aaa19a16750006cb215fcb23e51/content/browser/background_fetch/background_fetch_delegate_proxy.h [modify] https://crrev.com/4de0e19eda219aaa19a16750006cb215fcb23e51/content/browser/background_fetch/background_fetch_delegate_proxy_unittest.cc [modify] https://crrev.com/4de0e19eda219aaa19a16750006cb215fcb23e51/content/browser/background_fetch/background_fetch_job_controller.cc [modify] https://crrev.com/4de0e19eda219aaa19a16750006cb215fcb23e51/content/browser/background_fetch/background_fetch_job_controller.h [modify] https://crrev.com/4de0e19eda219aaa19a16750006cb215fcb23e51/content/browser/background_fetch/background_fetch_job_controller_unittest.cc [modify] https://crrev.com/4de0e19eda219aaa19a16750006cb215fcb23e51/content/browser/background_fetch/background_fetch_service_impl.cc [modify] https://crrev.com/4de0e19eda219aaa19a16750006cb215fcb23e51/content/browser/background_fetch/background_fetch_service_impl.h [modify] https://crrev.com/4de0e19eda219aaa19a16750006cb215fcb23e51/content/browser/background_fetch/background_fetch_service_unittest.cc [modify] https://crrev.com/4de0e19eda219aaa19a16750006cb215fcb23e51/content/browser/background_fetch/mock_background_fetch_delegate.cc [modify] https://crrev.com/4de0e19eda219aaa19a16750006cb215fcb23e51/content/browser/background_fetch/mock_background_fetch_delegate.h [modify] https://crrev.com/4de0e19eda219aaa19a16750006cb215fcb23e51/content/public/browser/background_fetch_delegate.h [modify] https://crrev.com/4de0e19eda219aaa19a16750006cb215fcb23e51/third_party/WebKit/Source/modules/background_fetch/BackgroundFetchBridge.cpp [modify] https://crrev.com/4de0e19eda219aaa19a16750006cb215fcb23e51/third_party/WebKit/Source/modules/background_fetch/BackgroundFetchBridge.h [modify] https://crrev.com/4de0e19eda219aaa19a16750006cb215fcb23e51/third_party/WebKit/Source/modules/background_fetch/BackgroundFetchManager.cpp [modify] https://crrev.com/4de0e19eda219aaa19a16750006cb215fcb23e51/third_party/WebKit/public/platform/modules/background_fetch/background_fetch.mojom
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/31a74e6d20e8bf00b6f73968486c6944d4635676 commit 31a74e6d20e8bf00b6f73968486c6944d4635676 Author: Mugdha Lakhani <nator@chromium.org> Date: Tue Mar 27 16:03:58 2018 [Background Fetch] Get the right icon size based on the display. Currently, I'm hardcoding values for Android and returning 0 for all other platforms. In a subsequent CL I'll pick the right icon size from the list provided by the developer, based on this size. TBR=peter@chromium.org Bug: 813564 Change-Id: If1d302a7439f7533d1c5649cce7eb2d0bf5583bc Reviewed-on: https://chromium-review.googlesource.com/968865 Commit-Queue: Anita Woodruff <awdf@chromium.org> Reviewed-by: Anita Woodruff <awdf@chromium.org> Reviewed-by: Avi Drissman <avi@chromium.org> Reviewed-by: Martin Barbella <mbarbella@chromium.org> Cr-Commit-Position: refs/heads/master@{#546115} [modify] https://crrev.com/31a74e6d20e8bf00b6f73968486c6944d4635676/chrome/browser/background_fetch/background_fetch_browsertest.cc [modify] https://crrev.com/31a74e6d20e8bf00b6f73968486c6944d4635676/chrome/browser/background_fetch/background_fetch_delegate_impl.cc [modify] https://crrev.com/31a74e6d20e8bf00b6f73968486c6944d4635676/chrome/browser/background_fetch/background_fetch_delegate_impl.h [modify] https://crrev.com/31a74e6d20e8bf00b6f73968486c6944d4635676/content/browser/background_fetch/background_fetch_context.cc [modify] https://crrev.com/31a74e6d20e8bf00b6f73968486c6944d4635676/content/browser/background_fetch/background_fetch_context.h [modify] https://crrev.com/31a74e6d20e8bf00b6f73968486c6944d4635676/content/browser/background_fetch/background_fetch_delegate_proxy.cc [modify] https://crrev.com/31a74e6d20e8bf00b6f73968486c6944d4635676/content/browser/background_fetch/background_fetch_delegate_proxy.h [modify] https://crrev.com/31a74e6d20e8bf00b6f73968486c6944d4635676/content/browser/background_fetch/background_fetch_delegate_proxy_unittest.cc [modify] https://crrev.com/31a74e6d20e8bf00b6f73968486c6944d4635676/content/browser/background_fetch/background_fetch_service_impl.cc [modify] https://crrev.com/31a74e6d20e8bf00b6f73968486c6944d4635676/content/browser/background_fetch/background_fetch_service_impl.h [modify] https://crrev.com/31a74e6d20e8bf00b6f73968486c6944d4635676/content/browser/background_fetch/mock_background_fetch_delegate.cc [modify] https://crrev.com/31a74e6d20e8bf00b6f73968486c6944d4635676/content/browser/background_fetch/mock_background_fetch_delegate.h [modify] https://crrev.com/31a74e6d20e8bf00b6f73968486c6944d4635676/content/public/browser/background_fetch_delegate.h [modify] https://crrev.com/31a74e6d20e8bf00b6f73968486c6944d4635676/third_party/WebKit/Source/modules/background_fetch/BackgroundFetchBridge.cpp [modify] https://crrev.com/31a74e6d20e8bf00b6f73968486c6944d4635676/third_party/WebKit/Source/modules/background_fetch/BackgroundFetchBridge.h [modify] https://crrev.com/31a74e6d20e8bf00b6f73968486c6944d4635676/third_party/WebKit/Source/modules/background_fetch/BackgroundFetchIconLoader.cpp [modify] https://crrev.com/31a74e6d20e8bf00b6f73968486c6944d4635676/third_party/WebKit/Source/modules/background_fetch/BackgroundFetchIconLoader.h [modify] https://crrev.com/31a74e6d20e8bf00b6f73968486c6944d4635676/third_party/WebKit/Source/modules/background_fetch/BackgroundFetchIconLoaderTest.cpp [modify] https://crrev.com/31a74e6d20e8bf00b6f73968486c6944d4635676/third_party/WebKit/Source/modules/background_fetch/BackgroundFetchManager.cpp [modify] https://crrev.com/31a74e6d20e8bf00b6f73968486c6944d4635676/third_party/WebKit/public/platform/modules/background_fetch/background_fetch.mojom
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/dd39355564f45673bf446633d80edfdb1e7ff18f commit dd39355564f45673bf446633d80edfdb1e7ff18f Author: Mugdha Lakhani <nator@chromium.org> Date: Fri Apr 06 18:28:12 2018 Pick right icon based on display size. Developers can provide multiple icons through BackgroundFetchOptions. We calculate an Icon Score for each, and pick the icon with the highest score to show with the UI. Scoring is a combination of size score (the image closest in size to the ideal display size gets the highest score) and an aspect ratio score (the image closest to a square shape gets the highest score). Design doc here: https://docs.google.com/document/d/1rEhpXios2wkeePHm6NfHzplESecn0-zQ2XBVjP7ykOk/edit# TBR=peter@chromium.org Bug: 813564 Change-Id: I4b74bc0db06a71ca276e98659ee1b2148358e1e7 Reviewed-on: https://chromium-review.googlesource.com/986265 Commit-Queue: Mugdha Lakhani <nator@chromium.org> Reviewed-by: Dan Elphick <delphick@chromium.org> Cr-Commit-Position: refs/heads/master@{#548867} [modify] https://crrev.com/dd39355564f45673bf446633d80edfdb1e7ff18f/third_party/WebKit/Source/modules/background_fetch/BackgroundFetchIconLoader.cpp [modify] https://crrev.com/dd39355564f45673bf446633d80edfdb1e7ff18f/third_party/WebKit/Source/modules/background_fetch/BackgroundFetchIconLoader.h [modify] https://crrev.com/dd39355564f45673bf446633d80edfdb1e7ff18f/third_party/WebKit/Source/modules/background_fetch/BackgroundFetchIconLoaderTest.cpp
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/5e366b220a29947ab5453c1d84457a00f9650199 commit 5e366b220a29947ab5453c1d84457a00f9650199 Author: Mugdha Lakhani <nator@chromium.org> Date: Thu Apr 12 22:41:56 2018 [Background Fetch] Add unit test to verify GetIconDisplaySize And follow up on review comments. Parent review: https://chromium-review.googlesource.com/c/chromium/src/+/968865 Bug: 813564 Change-Id: Ie2033f8f20ccd064d9e57f28958e52c87962b217 Reviewed-on: https://chromium-review.googlesource.com/1002896 Reviewed-by: Tom Sepez <tsepez@chromium.org> Reviewed-by: Peter Beverloo <peter@chromium.org> Commit-Queue: Mugdha Lakhani <nator@chromium.org> Cr-Commit-Position: refs/heads/master@{#550396} [modify] https://crrev.com/5e366b220a29947ab5453c1d84457a00f9650199/content/browser/background_fetch/background_fetch_delegate_proxy.cc [modify] https://crrev.com/5e366b220a29947ab5453c1d84457a00f9650199/content/browser/background_fetch/background_fetch_delegate_proxy.h [modify] https://crrev.com/5e366b220a29947ab5453c1d84457a00f9650199/content/browser/background_fetch/background_fetch_delegate_proxy_unittest.cc [modify] https://crrev.com/5e366b220a29947ab5453c1d84457a00f9650199/content/browser/background_fetch/mock_background_fetch_delegate.cc [modify] https://crrev.com/5e366b220a29947ab5453c1d84457a00f9650199/third_party/blink/public/platform/modules/background_fetch/background_fetch.mojom
Comment 1 by na...@chromium.org
, Feb 19 2018