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

Side by Side Diff: ios/clean/chrome/browser/ui/tools/tools_mediator.mm

Issue 2769963007: [ios clean] Creates ToolsMenu Mediator and Consumer (Closed)
Patch Set: CL Feedback, ARC Guards and Comments Created 3 years, 8 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/clean/chrome/browser/ui/tools/tools_mediator.h"
6
7 #import "ios/clean/chrome/browser/ui/actions/settings_actions.h"
8 #import "ios/clean/chrome/browser/ui/tools/tools_consumer.h"
9 #import "ios/clean/chrome/browser/ui/tools/tools_menu_item.h"
10
11 #if !defined(__has_feature) || !__has_feature(objc_arc)
12 #error "This file requires ARC support."
13 #endif
14
15 @interface ToolsMediator ()
16 @property(nonatomic, strong) id<ToolsConsumer> consumer;
17 @end
18
19 @implementation ToolsMediator
20
21 @synthesize consumer = _consumer;
22
23 - (instancetype)initWithConsumer:(id<ToolsConsumer>)consumer {
24 self = [super init];
25 if (self) {
26 self.consumer = consumer;
27 }
28 return self;
29 }
30
31 - (void)setConsumer:(id<ToolsConsumer>)consumer {
32 _consumer = consumer;
33
34 // PLACEHOLDER: Temporary hardcoded consumer model.
35 NSArray<ToolsMenuItem*>* menuItems = [[NSArray alloc] init];
36 menuItems = @[
37 [[ToolsMenuItem alloc] init], [[ToolsMenuItem alloc] init],
38 [[ToolsMenuItem alloc] init], [[ToolsMenuItem alloc] init],
39 [[ToolsMenuItem alloc] init], [[ToolsMenuItem alloc] init],
40 [[ToolsMenuItem alloc] init], [[ToolsMenuItem alloc] init],
41 [[ToolsMenuItem alloc] init], [[ToolsMenuItem alloc] init],
42 [[ToolsMenuItem alloc] init]
43 ];
44
45 menuItems[0].title = @"New Tab";
46
47 menuItems[1].title = @"New Incognito Tab";
48
49 menuItems[2].title = @"Bookmarks";
50
51 menuItems[3].title = @"Reading List";
52
53 menuItems[4].title = @"Recent Tabs";
54
55 menuItems[5].title = @"History";
56
57 menuItems[6].title = @"Report an Issue";
58
59 menuItems[7].title = @"Find in Page…";
60
61 menuItems[8].title = @"Request Desktop Site";
62
63 menuItems[9].title = @"Settings";
64 menuItems[9].action = @selector(showSettings:);
65
66 menuItems[10].title = @"Help";
67
68 [_consumer setToolsMenuItems:menuItems];
69 }
70
71 @end
OLDNEW
« no previous file with comments | « ios/clean/chrome/browser/ui/tools/tools_mediator.h ('k') | ios/clean/chrome/browser/ui/tools/tools_menu_item.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698