Chromium Code Reviews| OLD | NEW |
|---|---|
| (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 | |
| OLD | NEW |