The ContentSuggestions collection should get directly item instead of ContentSuggestion converted to item. It would allow the mediator to pass item with model information like GURL and get them latter.
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/98264ec53c6ff8523e659903bd489483686622a5 commit 98264ec53c6ff8523e659903bd489483686622a5 Author: gambard <gambard@chromium.org> Date: Mon May 15 16:26:18 2017 ContentSuggestionsDataSource returns CollectionViewItem Before this CL, ContentSuggestionsDataSource returned ContentSuggestion. The ContentSuggestion were converted into CollectionViewItem in the ContentSuggestionsCollectionUpdater, then added to the collection. This CL changes the ContentSuggestionsDataSource and makes it return CollectionViewItem directly. ContentSuggestion is removed as it is no longer needed. BUG= 720271 , 706344 Review-Url: https://codereview.chromium.org/2877513003 Cr-Commit-Position: refs/heads/master@{#471784} [modify] https://crrev.com/98264ec53c6ff8523e659903bd489483686622a5/ios/chrome/browser/content_suggestions/content_suggestions_mediator.mm [modify] https://crrev.com/98264ec53c6ff8523e659903bd489483686622a5/ios/chrome/browser/content_suggestions/mediator_util.h [modify] https://crrev.com/98264ec53c6ff8523e659903bd489483686622a5/ios/chrome/browser/content_suggestions/mediator_util.mm [modify] https://crrev.com/98264ec53c6ff8523e659903bd489483686622a5/ios/chrome/browser/ui/content_suggestions/BUILD.gn [modify] https://crrev.com/98264ec53c6ff8523e659903bd489483686622a5/ios/chrome/browser/ui/content_suggestions/cells/BUILD.gn [modify] https://crrev.com/98264ec53c6ff8523e659903bd489483686622a5/ios/chrome/browser/ui/content_suggestions/cells/content_suggestions_item.h [modify] https://crrev.com/98264ec53c6ff8523e659903bd489483686622a5/ios/chrome/browser/ui/content_suggestions/cells/content_suggestions_item.mm [modify] https://crrev.com/98264ec53c6ff8523e659903bd489483686622a5/ios/chrome/browser/ui/content_suggestions/cells/content_suggestions_item_unittest.mm [modify] https://crrev.com/98264ec53c6ff8523e659903bd489483686622a5/ios/chrome/browser/ui/content_suggestions/cells/content_suggestions_most_visited_item.h [modify] https://crrev.com/98264ec53c6ff8523e659903bd489483686622a5/ios/chrome/browser/ui/content_suggestions/cells/content_suggestions_most_visited_item.mm [modify] https://crrev.com/98264ec53c6ff8523e659903bd489483686622a5/ios/chrome/browser/ui/content_suggestions/cells/content_suggestions_text_item.h [modify] https://crrev.com/98264ec53c6ff8523e659903bd489483686622a5/ios/chrome/browser/ui/content_suggestions/cells/content_suggestions_text_item.mm [add] https://crrev.com/98264ec53c6ff8523e659903bd489483686622a5/ios/chrome/browser/ui/content_suggestions/cells/suggested_content.h [delete] https://crrev.com/9a2fd54ac4061f0c26a00e3d9d3396095c8e1675/ios/chrome/browser/ui/content_suggestions/content_suggestion.h [delete] https://crrev.com/9a2fd54ac4061f0c26a00e3d9d3396095c8e1675/ios/chrome/browser/ui/content_suggestions/content_suggestion.mm [modify] https://crrev.com/98264ec53c6ff8523e659903bd489483686622a5/ios/chrome/browser/ui/content_suggestions/content_suggestions_collection_updater.h [modify] https://crrev.com/98264ec53c6ff8523e659903bd489483686622a5/ios/chrome/browser/ui/content_suggestions/content_suggestions_collection_updater.mm [modify] https://crrev.com/98264ec53c6ff8523e659903bd489483686622a5/ios/chrome/browser/ui/content_suggestions/content_suggestions_collection_updater_unittest.mm [modify] https://crrev.com/98264ec53c6ff8523e659903bd489483686622a5/ios/chrome/browser/ui/content_suggestions/content_suggestions_data_source.h [modify] https://crrev.com/98264ec53c6ff8523e659903bd489483686622a5/ios/chrome/browser/ui/content_suggestions/content_suggestions_view_controller.h [modify] https://crrev.com/98264ec53c6ff8523e659903bd489483686622a5/ios/chrome/browser/ui/content_suggestions/content_suggestions_view_controller.mm [modify] https://crrev.com/98264ec53c6ff8523e659903bd489483686622a5/ios/chrome/browser/ui/content_suggestions/identifier/content_suggestion_identifier.h [modify] https://crrev.com/98264ec53c6ff8523e659903bd489483686622a5/ios/chrome/browser/ui/content_suggestions/identifier/content_suggestions_section_information.h [modify] https://crrev.com/98264ec53c6ff8523e659903bd489483686622a5/ios/chrome/browser/ui/settings/material_cell_catalog_view_controller.mm
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/765e161bf83b6625bdd01796594b4fcc63c91762 commit 765e161bf83b6625bdd01796594b4fcc63c91762 Author: gambard <gambard@chromium.org> Date: Tue May 16 09:32:58 2017 Move the ContentSuggestions items to a new target The ContentSuggestions items contain GURL. The GURL cannot be included in the UI layer. This CL moves the ContentSuggestionsItem and ContentSuggestionsMostVisitedItem to a new target, keeping the associated cells in the old target in new files. BUG= 720271 Review-Url: https://codereview.chromium.org/2887433002 Cr-Commit-Position: refs/heads/master@{#472053} [modify] https://crrev.com/765e161bf83b6625bdd01796594b4fcc63c91762/ios/chrome/browser/content_suggestions/BUILD.gn [modify] https://crrev.com/765e161bf83b6625bdd01796594b4fcc63c91762/ios/chrome/browser/content_suggestions/content_suggestions_coordinator.mm [modify] https://crrev.com/765e161bf83b6625bdd01796594b4fcc63c91762/ios/chrome/browser/ui/content_suggestions/BUILD.gn [modify] https://crrev.com/765e161bf83b6625bdd01796594b4fcc63c91762/ios/chrome/browser/ui/content_suggestions/cells/BUILD.gn [add] https://crrev.com/765e161bf83b6625bdd01796594b4fcc63c91762/ios/chrome/browser/ui/content_suggestions/cells/content_suggestions_cell.h [add] https://crrev.com/765e161bf83b6625bdd01796594b4fcc63c91762/ios/chrome/browser/ui/content_suggestions/cells/content_suggestions_cell.mm [modify] https://crrev.com/765e161bf83b6625bdd01796594b4fcc63c91762/ios/chrome/browser/ui/content_suggestions/cells/content_suggestions_item.h [modify] https://crrev.com/765e161bf83b6625bdd01796594b4fcc63c91762/ios/chrome/browser/ui/content_suggestions/cells/content_suggestions_item.mm [modify] https://crrev.com/765e161bf83b6625bdd01796594b4fcc63c91762/ios/chrome/browser/ui/content_suggestions/cells/content_suggestions_item_unittest.mm [add] https://crrev.com/765e161bf83b6625bdd01796594b4fcc63c91762/ios/chrome/browser/ui/content_suggestions/cells/content_suggestions_most_visited_cell.h [add] https://crrev.com/765e161bf83b6625bdd01796594b4fcc63c91762/ios/chrome/browser/ui/content_suggestions/cells/content_suggestions_most_visited_cell.mm [modify] https://crrev.com/765e161bf83b6625bdd01796594b4fcc63c91762/ios/chrome/browser/ui/content_suggestions/cells/content_suggestions_most_visited_item.h [modify] https://crrev.com/765e161bf83b6625bdd01796594b4fcc63c91762/ios/chrome/browser/ui/content_suggestions/cells/content_suggestions_most_visited_item.mm [modify] https://crrev.com/765e161bf83b6625bdd01796594b4fcc63c91762/ios/chrome/browser/ui/content_suggestions/cells/content_suggestions_most_visited_item_unittest.mm [modify] https://crrev.com/765e161bf83b6625bdd01796594b4fcc63c91762/ios/chrome/browser/ui/content_suggestions/content_suggestions_collection_updater.mm [modify] https://crrev.com/765e161bf83b6625bdd01796594b4fcc63c91762/ios/chrome/browser/ui/content_suggestions/content_suggestions_collection_utils.mm [modify] https://crrev.com/765e161bf83b6625bdd01796594b4fcc63c91762/ios/chrome/browser/ui/content_suggestions/content_suggestions_commands.h [modify] https://crrev.com/765e161bf83b6625bdd01796594b4fcc63c91762/ios/chrome/browser/ui/content_suggestions/content_suggestions_data_sink.h [modify] https://crrev.com/765e161bf83b6625bdd01796594b4fcc63c91762/ios/chrome/browser/ui/content_suggestions/content_suggestions_view_controller.mm [modify] https://crrev.com/765e161bf83b6625bdd01796594b4fcc63c91762/ios/chrome/browser/ui/settings/BUILD.gn
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/91228d6c2af35f799237940bd218ab5df9d18008 commit 91228d6c2af35f799237940bd218ab5df9d18008 Author: gambard <gambard@chromium.org> Date: Wed May 17 16:11:16 2017 Identify MostVisited by item instead of URL The Most Visited items displayed by the Collection View cannot be identified by their URL as the UI layer cannot know about them. When a favicon of a Most Visited is updated, the ContentSuggestionsDataSource directly passes the item instead of the URL. BUG= 707754 , 720271 Review-Url: https://codereview.chromium.org/2888533002 Cr-Commit-Position: refs/heads/master@{#472466} [modify] https://crrev.com/91228d6c2af35f799237940bd218ab5df9d18008/ios/chrome/browser/content_suggestions/content_suggestions_mediator.mm [modify] https://crrev.com/91228d6c2af35f799237940bd218ab5df9d18008/ios/chrome/browser/content_suggestions/mediator_util.h [modify] https://crrev.com/91228d6c2af35f799237940bd218ab5df9d18008/ios/chrome/browser/content_suggestions/mediator_util.mm [modify] https://crrev.com/91228d6c2af35f799237940bd218ab5df9d18008/ios/chrome/browser/ui/content_suggestions/BUILD.gn [modify] https://crrev.com/91228d6c2af35f799237940bd218ab5df9d18008/ios/chrome/browser/ui/content_suggestions/content_suggestions_collection_updater.mm [modify] https://crrev.com/91228d6c2af35f799237940bd218ab5df9d18008/ios/chrome/browser/ui/content_suggestions/content_suggestions_data_sink.h
Comment 1 by bugdroid1@chromium.org
, May 15 2017