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

Side by Side Diff: ios/chrome/browser/content_suggestions/content_suggestions_coordinator.mm

Issue 2643753002: Add the suggestions UI in chrome (Closed)
Patch Set: Update comments 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 2017 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/content_suggestions/content_suggestions_coordinator. h"
6
7 #include "base/mac/scoped_nsobject.h"
8 #import "ios/chrome/browser/ui/suggestions/suggestions_commands.h"
9 #import "ios/chrome/browser/ui/suggestions/suggestions_view_controller.h"
10 #include "ios/chrome/grit/ios_strings.h"
11 #include "ui/base/l10n/l10n_util.h"
12
13 #if !defined(__has_feature) || !__has_feature(objc_arc)
14 #error "This file requires ARC support."
15 #endif
16
17 @interface ContentSuggestionsCoordinator ()<SuggestionsCommands> {
18 UINavigationController* _navigationController;
19 }
20
21 @end
22
23 @implementation ContentSuggestionsCoordinator
24
25 @synthesize visible = _visible;
26
27 - (void)start {
28 if (self.visible) {
29 // Prevent this coordinator from being started twice in a row.
30 return;
31 }
32
33 _visible = YES;
34
35 SuggestionsViewController* suggestionsViewController =
36 [[SuggestionsViewController alloc]
37 initWithStyle:CollectionViewControllerStyleDefault];
38
39 suggestionsViewController.suggestionCommandHandler = self;
40 _navigationController = [[UINavigationController alloc]
41 initWithRootViewController:suggestionsViewController];
42
43 suggestionsViewController.navigationItem.leftBarButtonItem =
44 [[UIBarButtonItem alloc]
45 initWithTitle:l10n_util::GetNSString(IDS_IOS_SUGGESTIONS_DONE)
46 style:UIBarButtonItemStylePlain
47 target:self
48 action:@selector(stop)];
49
50 [self.baseViewController presentViewController:_navigationController
51 animated:YES
52 completion:nil];
53 }
54
55 - (void)stop {
56 [[_navigationController presentingViewController]
57 dismissViewControllerAnimated:YES
58 completion:nil];
59 _navigationController = nil;
60 _visible = NO;
61 }
62
63 #pragma mark - SuggestionsCommands
64
65 - (void)openReadingList {
66 }
67
68 - (void)openFirstPageOfReadingList {
69 }
70
71 - (void)addEmptyItem {
72 }
73
74 - (void)openFaviconAtIndex:(NSInteger)index {
75 }
76
77 @end
OLDNEW
« no previous file with comments | « ios/chrome/browser/content_suggestions/content_suggestions_coordinator.h ('k') | ios/chrome/browser/experimental_flags.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698