| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 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 | 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/clean/chrome/browser/ui/tools/tools_mediator.h" | 5 #import "ios/clean/chrome/browser/ui/tools/tools_mediator.h" |
| 6 | 6 |
| 7 #import "ios/chrome/browser/ui/tools_menu/tools_menu_configuration.h" |
| 7 #import "ios/clean/chrome/browser/ui/actions/settings_actions.h" | 8 #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_consumer.h" |
| 9 #import "ios/clean/chrome/browser/ui/tools/tools_menu_item.h" | 10 #import "ios/clean/chrome/browser/ui/tools/tools_menu_item.h" |
| 10 | 11 |
| 11 #if !defined(__has_feature) || !__has_feature(objc_arc) | 12 #if !defined(__has_feature) || !__has_feature(objc_arc) |
| 12 #error "This file requires ARC support." | 13 #error "This file requires ARC support." |
| 13 #endif | 14 #endif |
| 14 | 15 |
| 15 @interface ToolsMediator () | 16 @interface ToolsMediator () |
| 16 @property(nonatomic, strong) id<ToolsConsumer> consumer; | 17 @property(nonatomic, strong) id<ToolsConsumer> consumer; |
| 17 @end | 18 @end |
| 18 | 19 |
| 19 @implementation ToolsMediator | 20 @implementation ToolsMediator |
| 20 | 21 |
| 21 @synthesize consumer = _consumer; | 22 @synthesize consumer = _consumer; |
| 23 @synthesize toolsMenuConfiguration = _toolsMenuConfiguration; |
| 22 | 24 |
| 23 - (instancetype)initWithConsumer:(id<ToolsConsumer>)consumer { | 25 - (instancetype)initWithConsumer:(id<ToolsConsumer>)consumer { |
| 24 self = [super init]; | 26 self = [super init]; |
| 25 if (self) { | 27 if (self) { |
| 26 self.consumer = consumer; | 28 self.consumer = consumer; |
| 27 } | 29 } |
| 28 return self; | 30 return self; |
| 29 } | 31 } |
| 30 | 32 |
| 31 - (void)setConsumer:(id<ToolsConsumer>)consumer { | 33 - (void)setConsumer:(id<ToolsConsumer>)consumer { |
| (...skipping 27 matching lines...) Expand all Loading... |
| 59 menuItems[7].title = @"Find in Page…"; | 61 menuItems[7].title = @"Find in Page…"; |
| 60 | 62 |
| 61 menuItems[8].title = @"Request Desktop Site"; | 63 menuItems[8].title = @"Request Desktop Site"; |
| 62 | 64 |
| 63 menuItems[9].title = @"Settings"; | 65 menuItems[9].title = @"Settings"; |
| 64 menuItems[9].action = @selector(showSettings:); | 66 menuItems[9].action = @selector(showSettings:); |
| 65 | 67 |
| 66 menuItems[10].title = @"Help"; | 68 menuItems[10].title = @"Help"; |
| 67 | 69 |
| 68 [_consumer setToolsMenuItems:menuItems]; | 70 [_consumer setToolsMenuItems:menuItems]; |
| 71 [_consumer |
| 72 canDisplayOverflowControls:!self.toolsMenuConfiguration.isInTabSwitcher]; |
| 69 } | 73 } |
| 70 | 74 |
| 71 @end | 75 @end |
| OLD | NEW |