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

Side by Side Diff: ios/chrome/browser/ui/suggestions/suggestions_view_controller.mm

Issue 2619353004: Creates the Suggestions UI (Closed)
Patch Set: Add OWNERS Created 3 years, 11 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
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #import "ios/chrome/browser/ui/suggestions/suggestions_view_controller.h"
6
7 #import "base/mac/foundation_util.h"
marq (ping after 24h) 2017/01/10 13:46:25 This doesn't seem to be needed.
gambard 2017/01/10 14:50:35 Done.
8
9 #if !defined(__has_feature) || !__has_feature(objc_arc)
10 #error "This file requires ARC support."
11 #endif
12
13 @implementation SuggestionsViewController {
14 BOOL _removeMe;
marq (ping after 24h) 2017/01/10 13:46:25 Good advice?
gambard 2017/01/10 14:50:35 Well, it shows that this name was carefully chosen
15 }
16
17 @synthesize dataSourceDelegate = _dataSourceDelegate;
18 @synthesize actionsDelegate = _actionsDelegate;
19
20 #pragma mark - UIViewController
21
22 - (void)viewDidLoad {
23 [super viewDidLoad];
24
25 self.collectionView.delegate = self;
26 self.styler.cellStyle = MDCCollectionViewCellStyleCard;
27 }
28
29 #pragma mark - UICollectionViewDelegate
30
31 - (BOOL)collectionView:(UICollectionView*)collectionView
32 shouldSelectItemAtIndexPath:(NSIndexPath*)indexPath {
33 [super collectionView:(UICollectionView*)collectionView
marq (ping after 24h) 2017/01/10 13:46:25 Does this have a return value that's being ignored
gambard 2017/01/10 14:50:35 Yes, but the default value is YES unless editing.
34 shouldSelectItemAtIndexPath:(NSIndexPath*)indexPath];
35
36 return YES;
37 }
38
39 #pragma mark - MDCCollectionViewStylingDelegate
40
41 - (CGFloat)collectionView:(UICollectionView*)collectionView
42 cellHeightAtIndexPath:(NSIndexPath*)indexPath {
43 return [self.dataSourceDelegate collectionView:collectionView
44 cellHeightAtIndexPath:indexPath];
45 }
46
47 #pragma mark - SuggestionsItemActions
48
49 - (void)buttonPressed {
50 [self.actionsDelegate addItem];
51 }
52
53 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698