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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: ios/chrome/browser/ui/suggestions/suggestions_view_controller.mm
diff --git a/ios/chrome/browser/ui/suggestions/suggestions_view_controller.mm b/ios/chrome/browser/ui/suggestions/suggestions_view_controller.mm
new file mode 100644
index 0000000000000000000000000000000000000000..d686cae894248af18cf79e3e2d0cddb782107503
--- /dev/null
+++ b/ios/chrome/browser/ui/suggestions/suggestions_view_controller.mm
@@ -0,0 +1,53 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#import "ios/chrome/browser/ui/suggestions/suggestions_view_controller.h"
+
+#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.
+
+#if !defined(__has_feature) || !__has_feature(objc_arc)
+#error "This file requires ARC support."
+#endif
+
+@implementation SuggestionsViewController {
+ 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
+}
+
+@synthesize dataSourceDelegate = _dataSourceDelegate;
+@synthesize actionsDelegate = _actionsDelegate;
+
+#pragma mark - UIViewController
+
+- (void)viewDidLoad {
+ [super viewDidLoad];
+
+ self.collectionView.delegate = self;
+ self.styler.cellStyle = MDCCollectionViewCellStyleCard;
+}
+
+#pragma mark - UICollectionViewDelegate
+
+- (BOOL)collectionView:(UICollectionView*)collectionView
+ shouldSelectItemAtIndexPath:(NSIndexPath*)indexPath {
+ [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.
+ shouldSelectItemAtIndexPath:(NSIndexPath*)indexPath];
+
+ return YES;
+}
+
+#pragma mark - MDCCollectionViewStylingDelegate
+
+- (CGFloat)collectionView:(UICollectionView*)collectionView
+ cellHeightAtIndexPath:(NSIndexPath*)indexPath {
+ return [self.dataSourceDelegate collectionView:collectionView
+ cellHeightAtIndexPath:indexPath];
+}
+
+#pragma mark - SuggestionsItemActions
+
+- (void)buttonPressed {
+ [self.actionsDelegate addItem];
+}
+
+@end

Powered by Google App Engine
This is Rietveld 408576698