| Index: ios/clean/chrome/browser/ui/tools/menu_view_controller.mm
|
| diff --git a/ios/clean/chrome/browser/ui/tools/menu_view_controller.mm b/ios/clean/chrome/browser/ui/tools/menu_view_controller.mm
|
| index 19f45db3a00f6ca1bcecbd29d355988a12ebee4b..5dedc543c2996baf0519105c6a79e7e2fbc236d5 100644
|
| --- a/ios/clean/chrome/browser/ui/tools/menu_view_controller.mm
|
| +++ b/ios/clean/chrome/browser/ui/tools/menu_view_controller.mm
|
| @@ -8,10 +8,10 @@
|
| #import "base/logging.h"
|
| #import "base/macros.h"
|
| #import "ios/chrome/browser/ui/rtl_geometry.h"
|
| -#import "ios/clean/chrome/browser/ui/actions/settings_actions.h"
|
| #import "ios/clean/chrome/browser/ui/actions/tools_menu_actions.h"
|
| #import "ios/clean/chrome/browser/ui/toolbar/toolbar_button.h"
|
| #import "ios/clean/chrome/browser/ui/tools/menu_overflow_controls_stackview.h"
|
| +#import "ios/clean/chrome/browser/ui/tools/tools_menu_item.h"
|
| #import "ios/third_party/material_roboto_font_loader_ios/src/src/MaterialRobotoFontLoader.h"
|
|
|
| #if !defined(__has_feature) || !__has_feature(objc_arc)
|
| @@ -23,19 +23,8 @@ const CGFloat kMenuWidth = 250;
|
| const CGFloat kMenuItemHeight = 48;
|
| }
|
|
|
| -// Placeholder model for menu item configuration.
|
| -@interface MenuItem : NSObject
|
| -@property(nonatomic, copy) NSString* title;
|
| -@property(nonatomic) SEL action;
|
| -@end
|
| -
|
| -@implementation MenuItem
|
| -@synthesize title = _title;
|
| -@synthesize action = _action;
|
| -@end
|
| -
|
| @interface MenuViewController ()
|
| -@property(nonatomic, readonly) NSArray<MenuItem*>* menuItems;
|
| +@property(nonatomic, strong) NSArray<ToolsMenuItem*>* menuItems;
|
| @property(nonatomic, strong)
|
| MenuOverflowControlsStackView* toolbarOverflowStackView;
|
| @end
|
| @@ -44,41 +33,6 @@ const CGFloat kMenuItemHeight = 48;
|
| @synthesize menuItems = _menuItems;
|
| @synthesize toolbarOverflowStackView = _toolbarOverflowStackView;
|
|
|
| -- (instancetype)init {
|
| - if ((self = [super init])) {
|
| - _menuItems = @[
|
| - [[MenuItem alloc] init], [[MenuItem alloc] init], [[MenuItem alloc] init],
|
| - [[MenuItem alloc] init], [[MenuItem alloc] init], [[MenuItem alloc] init],
|
| - [[MenuItem alloc] init], [[MenuItem alloc] init], [[MenuItem alloc] init],
|
| - [[MenuItem alloc] init], [[MenuItem alloc] init]
|
| - ];
|
| -
|
| - _menuItems[0].title = @"New Tab";
|
| -
|
| - _menuItems[1].title = @"New Incognito Tab";
|
| -
|
| - _menuItems[2].title = @"Bookmarks";
|
| -
|
| - _menuItems[3].title = @"Reading List";
|
| -
|
| - _menuItems[4].title = @"Recent Tabs";
|
| -
|
| - _menuItems[5].title = @"History";
|
| -
|
| - _menuItems[6].title = @"Report an Issue";
|
| -
|
| - _menuItems[7].title = @"Find in Pageā¦";
|
| -
|
| - _menuItems[8].title = @"Request Desktop Site";
|
| -
|
| - _menuItems[9].title = @"Settings";
|
| - _menuItems[9].action = @selector(showSettings:);
|
| -
|
| - _menuItems[10].title = @"Help";
|
| - }
|
| - return self;
|
| -}
|
| -
|
| - (void)loadView {
|
| CGRect frame;
|
| frame.size = CGSizeMake(kMenuWidth, kMenuItemHeight * _menuItems.count);
|
| @@ -93,7 +47,7 @@ const CGFloat kMenuItemHeight = 48;
|
| NSMutableArray<UIButton*>* buttons =
|
| [[NSMutableArray alloc] initWithCapacity:_menuItems.count];
|
|
|
| - for (MenuItem* item in _menuItems) {
|
| + for (ToolsMenuItem* item in _menuItems) {
|
| UIButton* menuButton = [UIButton buttonWithType:UIButtonTypeSystem];
|
| menuButton.translatesAutoresizingMaskIntoConstraints = NO;
|
| menuButton.tintColor = [UIColor blackColor];
|
| @@ -149,4 +103,10 @@ const CGFloat kMenuItemHeight = 48;
|
| ]];
|
| }
|
|
|
| +#pragma mark - Tools Consumer
|
| +
|
| +- (void)setToolsMenuItems:(NSArray*)menuItems {
|
| + _menuItems = menuItems;
|
| +}
|
| +
|
| @end
|
|
|