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

Side by Side Diff: ios/chrome/browser/ui/content_suggestions/content_suggestions_view_controller.mm

Issue 2751653008: Add header for the Content Suggestions (Closed)
Patch Set: Address comment Created 3 years, 9 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 unified diff | Download patch
« no previous file with comments | « ios/chrome/browser/ui/content_suggestions/content_suggestions_footer_item.mm ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #import "ios/chrome/browser/ui/content_suggestions/content_suggestions_view_cont roller.h" 5 #import "ios/chrome/browser/ui/content_suggestions/content_suggestions_view_cont roller.h"
6 6
7 #include "base/mac/foundation_util.h" 7 #include "base/mac/foundation_util.h"
8 #import "ios/chrome/browser/ui/collection_view/cells/MDCCollectionViewCell+Chrom e.h" 8 #import "ios/chrome/browser/ui/collection_view/cells/MDCCollectionViewCell+Chrom e.h"
9 #import "ios/chrome/browser/ui/collection_view/cells/collection_view_item.h" 9 #import "ios/chrome/browser/ui/collection_view/cells/collection_view_item.h"
10 #import "ios/chrome/browser/ui/collection_view/collection_view_model.h" 10 #import "ios/chrome/browser/ui/collection_view/collection_view_model.h"
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 177
178 - (BOOL)collectionView:(nonnull UICollectionView*)collectionView 178 - (BOOL)collectionView:(nonnull UICollectionView*)collectionView
179 shouldHideItemBackgroundAtIndexPath:(nonnull NSIndexPath*)indexPath { 179 shouldHideItemBackgroundAtIndexPath:(nonnull NSIndexPath*)indexPath {
180 if ([self.collectionUpdater 180 if ([self.collectionUpdater
181 shouldUseCustomStyleForSection:indexPath.section]) { 181 shouldUseCustomStyleForSection:indexPath.section]) {
182 return YES; 182 return YES;
183 } 183 }
184 return NO; 184 return NO;
185 } 185 }
186 186
187 - (BOOL)collectionView:(UICollectionView*)collectionView
188 shouldHideHeaderBackgroundForSection:(NSInteger)section {
189 return YES;
190 }
191
187 - (CGFloat)collectionView:(UICollectionView*)collectionView 192 - (CGFloat)collectionView:(UICollectionView*)collectionView
188 cellHeightAtIndexPath:(NSIndexPath*)indexPath { 193 cellHeightAtIndexPath:(NSIndexPath*)indexPath {
189 CollectionViewItem* item = 194 CollectionViewItem* item =
190 [self.collectionViewModel itemAtIndexPath:indexPath]; 195 [self.collectionViewModel itemAtIndexPath:indexPath];
191 UIEdgeInsets inset = [self collectionView:collectionView 196 UIEdgeInsets inset = [self collectionView:collectionView
192 layout:collectionView.collectionViewLayout 197 layout:collectionView.collectionViewLayout
193 insetForSectionAtIndex:indexPath.section]; 198 insetForSectionAtIndex:indexPath.section];
194 199
195 return [MDCCollectionViewCell 200 return [MDCCollectionViewCell
196 cr_preferredHeightForWidth:CGRectGetWidth(collectionView.bounds) - 201 cr_preferredHeightForWidth:CGRectGetWidth(collectionView.bounds) -
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
255 ContentSuggestionsArticleItem* articleItem = 260 ContentSuggestionsArticleItem* articleItem =
256 base::mac::ObjCCastStrict<ContentSuggestionsArticleItem>(touchedItem); 261 base::mac::ObjCCastStrict<ContentSuggestionsArticleItem>(touchedItem);
257 262
258 [self.suggestionCommandHandler 263 [self.suggestionCommandHandler
259 displayContextMenuForArticle:articleItem 264 displayContextMenuForArticle:articleItem
260 atPoint:touchLocation 265 atPoint:touchLocation
261 atIndexPath:touchedItemIndexPath]; 266 atIndexPath:touchedItemIndexPath];
262 } 267 }
263 268
264 @end 269 @end
OLDNEW
« no previous file with comments | « ios/chrome/browser/ui/content_suggestions/content_suggestions_footer_item.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698