Add support for pulling icons for OfflineItems

Desktop / Chromium - dtrainor [chromium.org] - 18 April 2017 01:09 EDT

- Add the concept of OfflineItemVisuals, which are heavyweight visual components associated with an OfflineItem. Make that API async and by request only.- Hook up the OfflineItemVisuals to the current bridge pipeline and notification system. This involves building a small cache in the bridge that handles passing these to the notification layer so that these are queried infrequently. In the future, having a unified cache mechanism would be better, but right now notifications and downloads home have
very different caching characteristics.- Added support for showing the icons in notifications. There are still some jumps where the icon vanishes and reappears because we process the action before notifying native. A follow up patch should look into removing setting those notifications early.

BUG=691805

Review-Url: https://codereview.chromium.org/2811803006 Cr-Commit-Position: refs/heads/master@{#465146}

cdde15e Add support for pulling icons for OfflineItems
.../chrome/browser/download/DownloadInfo.java | 21 +-
.../download/DownloadNotificationService.java | 125 ++++----
.../browser/download/SystemDownloadNotifier.java | 11 +-
...flineContentAggregatorNotificationBridgeUi.java | 155 ++++++++--
...ntentAggregatorNotificationBridgeUiFactory.java | 6 +-
chrome/android/java_sources.gni | 1 +
.../download/DownloadNotificationServiceTest.java | 11 +-
.../download/MockDownloadNotificationService.java | 15 +-
...eContentAggregatorNotificationBridgeUiTest.java | 334 +++++++++++++++++++++
components/offline_items_collection/core/BUILD.gn | 15 +-
components/offline_items_collection/core/DEPS | 1 +
.../OfflineContentAggregatorBridge.java | 33 +-
.../OfflineContentProvider.java | 6 +-
.../offline_items_collection/OfflineItem.java | 2 +-
.../OfflineItemVisuals.java | 21 ++
.../offline_items_collection/VisualsCallback.java | 19 ++
.../{ => bridges}/OfflineItemBridge.java | 7 +-
.../bridges/OfflineItemVisualsBridge.java | 33 ++
.../android/offline_content_aggregator_bridge.cc | 25 ++
.../android/offline_content_aggregator_bridge.h | 6 +
.../core/android/offline_item_visuals_bridge.cc | 33 ++
.../core/android/offline_item_visuals_bridge.h | 35 +++
.../core/offline_content_aggregator.cc | 14 +
.../core/offline_content_aggregator.h | 2 +
.../core/offline_content_aggregator_unittest.cc | 4 +
.../core/offline_content_provider.h | 12 +
.../offline_items_collection/core/offline_item.cc | 5 +
.../offline_items_collection/core/offline_item.h | 22 ++
.../test_support/mock_offline_content_provider.h | 2 +
.../core/throttled_offline_content_provider.cc | 6 +
.../core/throttled_offline_content_provider.h | 2 +
.../throttled_offline_content_provider_unittest.cc | 3 +-
tools/android/eclipse/.classpath | 1 +
33 files changed, 881 insertions(+), 107 deletions(-)

Upstream: git.chromium.org


  • Share