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

Unified Diff: ios/chrome/browser/ui/content_suggestions/content_suggestions_view_controller.mm

Issue 2890193003: Open Most Visited items (Closed)
Patch Set: Fix showcase Created 3 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: ios/chrome/browser/ui/content_suggestions/content_suggestions_view_controller.mm
diff --git a/ios/chrome/browser/ui/content_suggestions/content_suggestions_view_controller.mm b/ios/chrome/browser/ui/content_suggestions/content_suggestions_view_controller.mm
index 45428e1b425488a742e17cf13541247740cd4702..6283c89f643f6da5d31b0c26b239d9b86ebc96c2 100644
--- a/ios/chrome/browser/ui/content_suggestions/content_suggestions_view_controller.mm
+++ b/ios/chrome/browser/ui/content_suggestions/content_suggestions_view_controller.mm
@@ -141,10 +141,13 @@ using CSCollectionViewItem = CollectionViewItem<SuggestedContent>;
switch ([self.collectionUpdater contentSuggestionTypeForItem:item]) {
case ContentSuggestionTypeReadingList:
case ContentSuggestionTypeArticle:
+ [self unfocusOmnibox];
[self.suggestionCommandHandler openPageForItem:item];
break;
case ContentSuggestionTypeMostVisited:
- // TODO(crbug.com/707754): Open the most visited site.
+ [self unfocusOmnibox];
+ [self.suggestionCommandHandler openMostVisitedItem:item
+ atIndex:indexPath.item];
break;
case ContentSuggestionTypeEmpty:
break;
@@ -268,4 +271,10 @@ using CSCollectionViewItem = CollectionViewItem<SuggestedContent>;
[self.collectionView insertItemsAtIndexPaths:@[ emptyItem ]];
}
+// Tells WebToolbarController to resign focus to the omnibox.
+- (void)unfocusOmnibox {
+ // TODO(crbug.com/700375): once the omnibox is part of Content Suggestions,
+ // remove the fake omnibox focus here.
+}
+
@end
« no previous file with comments | « ios/chrome/browser/ui/content_suggestions/content_suggestions_commands.h ('k') | ios/chrome/browser/ui/favicon/OWNERS » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698