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

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

Issue 2890193003: Open Most Visited items (Closed)
Patch Set: Add myself as favicon owner Created 3 years, 7 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 e6690984f477a22d36d1abe8dbc890babd6a41fc..1863075eb533f2d29c60e658e20ac9610cab71e2 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 blurOmnibox];
[self.suggestionCommandHandler openPageForItem:item];
break;
case ContentSuggestionTypeMostVisited:
- // TODO(crbug.com/707754): Open the most visited site.
+ [self blurOmnibox];
+ [self.suggestionCommandHandler openMostVisitedItem:item
+ atIndex:indexPath.item];
break;
case ContentSuggestionTypeEmpty:
break;
@@ -271,4 +274,10 @@ using CSCollectionViewItem = CollectionViewItem<SuggestedContent>;
[self.collectionView insertItemsAtIndexPaths:@[ emptyItem ]];
}
+// Tells WebToolbarController to resign focus to the omnibox.
+- (void)blurOmnibox {
marq (ping after 24h) 2017/06/02 08:25:47 Minor naming nit: when 'focus' is used to mean 'ma
gambard 2017/06/02 13:26:58 I had the same reaction as you :) But as defocus w
+ // 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