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

Side by Side Diff: ios/chrome/browser/suggestions/suggestions_coordinator.mm

Issue 2643753002: Add the suggestions UI in chrome (Closed)
Patch Set: Formatting 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/suggestions/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 @interface SuggestionsCoordinator ()<SuggestionsCommands> {
14 base::scoped_nsobject<UINavigationController> _navigationController;
15 }
16
17 @end
18
19 @implementation SuggestionsCoordinator
20
21 - (void)start {
22 SuggestionsViewController* suggestionsViewController =
23 [[[SuggestionsViewController alloc]
24 initWithStyle:CollectionViewControllerStyleDefault] autorelease];
25
26 suggestionsViewController.suggestionCommandHandler = self;
27 _navigationController.reset([[UINavigationController alloc]
28 initWithRootViewController:suggestionsViewController]);
29
30 suggestionsViewController.navigationItem.leftBarButtonItem =
31 [[[UIBarButtonItem alloc]
32 initWithTitle:l10n_util::GetNSString(IDS_IOS_SUGGESTIONS_DONE)
33 style:UIBarButtonItemStylePlain
34 target:self
35 action:@selector(stop)] autorelease];
36
37 [self.baseViewController presentViewController:_navigationController
38 animated:YES
39 completion:nil];
40 }
41
42 - (void)stop {
43 [[_navigationController presentingViewController]
44 dismissViewControllerAnimated:YES
45 completion:nil];
lpromero 2017/01/18 13:32:15 Optional: _navigationController.reset();
gambard 2017/01/18 14:34:47 Done.
46 }
47
48 #pragma mark - SuggestionsCommands
49
50 - (void)openReadingList {
51 }
52
53 - (void)openFirstPageOfReadingList {
54 }
55
56 - (void)addEmptyItem {
57 }
58
59 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698