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

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

Issue 2814963002: [ios clean] Use ToolsMenuConfiguration for Menu context. (Closed)
Patch Set: Update Unittest 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
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/clean/chrome/browser/ui/actions/settings_actions.h" 7 #import "ios/clean/chrome/browser/ui/actions/settings_actions.h"
8 #import "ios/clean/chrome/browser/ui/tools/tools_actions.h" 8 #import "ios/clean/chrome/browser/ui/tools/tools_actions.h"
9 #import "ios/clean/chrome/browser/ui/tools/tools_consumer.h" 9 #import "ios/clean/chrome/browser/ui/tools/tools_consumer.h"
10 #import "ios/clean/chrome/browser/ui/tools/tools_menu_item.h" 10 #import "ios/clean/chrome/browser/ui/tools/tools_menu_item.h"
11 #import "ios/shared/chrome/browser/ui/tools_menu/tools_menu_configuration.h"
11 12
12 #if !defined(__has_feature) || !__has_feature(objc_arc) 13 #if !defined(__has_feature) || !__has_feature(objc_arc)
13 #error "This file requires ARC support." 14 #error "This file requires ARC support."
14 #endif 15 #endif
15 16
16 @interface ToolsMediator () 17 @interface ToolsMediator ()
17 @property(nonatomic, strong) id<ToolsConsumer> consumer; 18 @property(nonatomic, strong) id<ToolsConsumer> consumer;
19 @property(nonatomic, strong) ToolsMenuConfiguration* toolsMenuConfiguration;
18 @end 20 @end
19 21
20 @implementation ToolsMediator 22 @implementation ToolsMediator
21 23
22 @synthesize consumer = _consumer; 24 @synthesize consumer = _consumer;
25 @synthesize toolsMenuConfiguration = _toolsMenuConfiguration;
23 26
24 - (instancetype)initWithConsumer:(id<ToolsConsumer>)consumer { 27 - (instancetype)initWithConsumer:(id<ToolsConsumer>)consumer
28 andConfiguration:(ToolsMenuConfiguration*)menuConfiguration {
25 self = [super init]; 29 self = [super init];
26 if (self) { 30 if (self) {
31 self.toolsMenuConfiguration = menuConfiguration;
27 self.consumer = consumer; 32 self.consumer = consumer;
28 } 33 }
29 return self; 34 return self;
30 } 35 }
31 36
32 - (void)setConsumer:(id<ToolsConsumer>)consumer { 37 - (void)setConsumer:(id<ToolsConsumer>)consumer {
33 _consumer = consumer; 38 _consumer = consumer;
34 39
35 // PLACEHOLDER: Temporary hardcoded consumer model. 40 // PLACEHOLDER: Temporary hardcoded consumer model.
36 NSArray<ToolsMenuItem*>* menuItems = [[NSArray alloc] init]; 41 NSArray<ToolsMenuItem*>* menuItems = [[NSArray alloc] init];
(...skipping 24 matching lines...) Expand all
61 menuItems[7].action = @selector(showFindInPage); 66 menuItems[7].action = @selector(showFindInPage);
62 67
63 menuItems[8].title = @"Request Desktop Site"; 68 menuItems[8].title = @"Request Desktop Site";
64 69
65 menuItems[9].title = @"Settings"; 70 menuItems[9].title = @"Settings";
66 menuItems[9].action = @selector(showSettings:); 71 menuItems[9].action = @selector(showSettings:);
67 72
68 menuItems[10].title = @"Help"; 73 menuItems[10].title = @"Help";
69 74
70 [_consumer setToolsMenuItems:menuItems]; 75 [_consumer setToolsMenuItems:menuItems];
76 [_consumer
77 setDisplayOverflowControls:!self.toolsMenuConfiguration.isInTabSwitcher];
71 } 78 }
72 79
73 @end 80 @end
OLDNEW
« no previous file with comments | « ios/clean/chrome/browser/ui/tools/tools_mediator.h ('k') | ios/clean/chrome/browser/ui/tools/tools_mediator_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698