| 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/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 |
| OLD | NEW |