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

Side by Side Diff: ios/showcase/suggestions/sc_suggestions_coordinator.mm

Issue 2644123003: Move ios/ui/suggestions to ios/ui/content_suggestions (Closed)
Patch Set: 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
1 // Copyright 2016 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #import "ios/showcase/suggestions/sc_suggestions_coordinator.h" 5 #import "ios/showcase/suggestions/sc_suggestions_coordinator.h"
6 6
7 #import "ios/chrome/browser/ui/suggestions/suggestions_commands.h" 7 #import "ios/chrome/browser/ui/content_suggestions/content_suggestions_commands. h"
8 #import "ios/chrome/browser/ui/suggestions/suggestions_view_controller.h" 8 #import "ios/chrome/browser/ui/content_suggestions/content_suggestions_view_cont roller.h"
9 #import "ios/showcase/common/protocol_alerter.h" 9 #import "ios/showcase/common/protocol_alerter.h"
10 10
11 #if !defined(__has_feature) || !__has_feature(objc_arc) 11 #if !defined(__has_feature) || !__has_feature(objc_arc)
12 #error "This file requires ARC support." 12 #error "This file requires ARC support."
13 #endif 13 #endif
14 14
15 @interface SCSuggestionsCoordinator ()<SuggestionsCommands> 15 @interface SCSuggestionsCoordinator ()<ContentSuggestionsCommands>
16 16
17 @property(nonatomic, strong) 17 @property(nonatomic, strong)
18 SuggestionsViewController* suggestionViewController; 18 ContentSuggestionsViewController* suggestionViewController;
19 @property(nonatomic, strong) ProtocolAlerter* alerter; 19 @property(nonatomic, strong) ProtocolAlerter* alerter;
20 20
21 @end 21 @end
22 22
23 @implementation SCSuggestionsCoordinator 23 @implementation SCSuggestionsCoordinator
24 24
25 @synthesize baseViewController; 25 @synthesize baseViewController;
26 @synthesize suggestionViewController = _suggestionViewController; 26 @synthesize suggestionViewController = _suggestionViewController;
27 @synthesize alerter = _alerter; 27 @synthesize alerter = _alerter;
28 28
29 #pragma mark - Coordinator 29 #pragma mark - Coordinator
30 30
31 - (void)start { 31 - (void)start {
32 self.alerter = [[ProtocolAlerter alloc] 32 self.alerter = [[ProtocolAlerter alloc]
33 initWithProtocols:@[ @protocol(SuggestionsCommands) ]]; 33 initWithProtocols:@[ @protocol(ContentSuggestionsCommands) ]];
34 self.alerter.baseViewController = self.baseViewController; 34 self.alerter.baseViewController = self.baseViewController;
35 35
36 _suggestionViewController = [[SuggestionsViewController alloc] 36 _suggestionViewController = [[ContentSuggestionsViewController alloc]
37 initWithStyle:CollectionViewControllerStyleDefault]; 37 initWithStyle:CollectionViewControllerStyleDefault];
38 38
39 _suggestionViewController.suggestionCommandHandler = self; 39 _suggestionViewController.suggestionCommandHandler = self;
lpromero 2017/01/20 12:15:44 Might be out of scope: wasn't the alerter supposed
gambard 2017/01/20 12:32:12 It has been done in another CL (I will need to reb
40 40
41 [self.baseViewController pushViewController:_suggestionViewController 41 [self.baseViewController pushViewController:_suggestionViewController
42 animated:YES]; 42 animated:YES];
43 } 43 }
44 44
45 #pragma mark - SuggestionsCommands 45 #pragma mark - ContentSuggestionsCommands
46 46
47 - (void)addEmptyItem { 47 - (void)addEmptyItem {
48 [self.suggestionViewController addTextItem:@"Button clicked" 48 [self.suggestionViewController addTextItem:@"Button clicked"
49 subtitle:@"Item Added!" 49 subtitle:@"Item Added!"
50 toSection:5]; 50 toSection:5];
51 } 51 }
52 52
53 - (void)openReadingList { 53 - (void)openReadingList {
54 [static_cast<id<SuggestionsCommands>>(self.alerter) openReadingList]; 54 [static_cast<id<ContentSuggestionsCommands>>(self.alerter) openReadingList];
55 } 55 }
56 56
57 - (void)openFirstPageOfReadingList { 57 - (void)openFirstPageOfReadingList {
58 [static_cast<id<SuggestionsCommands>>(self.alerter) 58 [static_cast<id<ContentSuggestionsCommands>>(self.alerter)
59 openFirstPageOfReadingList]; 59 openFirstPageOfReadingList];
60 } 60 }
61 61
62 @end 62 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698