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/menu_overflow_controls_stackview.h" | 5 #import "ios/clean/chrome/browser/ui/tools/menu_overflow_controls_stackview.h" |
6 | 6 |
7 #import "ios/clean/chrome/browser/ui/toolbar/toolbar_button+factory.h" | 7 #import "ios/clean/chrome/browser/ui/toolbar/toolbar_button+factory.h" |
8 | 8 |
9 @implementation MenuOverflowControlsStackView | 9 @implementation MenuOverflowControlsStackView |
10 @synthesize toolsMenuButton = _toolsMenuButton; | |
11 @synthesize shareButton = _shareButton; | 10 @synthesize shareButton = _shareButton; |
12 @synthesize reloadButton = _reloadButton; | 11 @synthesize reloadButton = _reloadButton; |
13 @synthesize stopButton = _stopButton; | 12 @synthesize stopButton = _stopButton; |
14 | 13 |
15 - (instancetype)init { | 14 - (instancetype)init { |
16 if ((self = [super init])) { | 15 if ((self = [super init])) { |
17 // PLACEHOLDER: Buttons and UI config is not final and will be improved. | 16 // PLACEHOLDER: Buttons and UI config is not final and will be improved. |
18 [self setUpToolbarButtons]; | 17 [self setUpToolbarButtons]; |
19 [self addArrangedSubview:self.shareButton]; | 18 [self addArrangedSubview:self.shareButton]; |
20 [self addArrangedSubview:self.stopButton]; | 19 [self addArrangedSubview:self.stopButton]; |
21 [self addArrangedSubview:self.reloadButton]; | 20 [self addArrangedSubview:self.reloadButton]; |
22 [self addArrangedSubview:self.toolsMenuButton]; | |
23 | 21 |
24 self.axis = UILayoutConstraintAxisHorizontal; | 22 self.axis = UILayoutConstraintAxisHorizontal; |
25 self.distribution = UIStackViewDistributionFillEqually; | 23 self.distribution = UIStackViewDistributionFillEqually; |
26 } | 24 } |
27 return self; | 25 return self; |
28 } | 26 } |
29 | 27 |
30 #pragma mark - Components Setup | 28 #pragma mark - Components Setup |
31 | 29 |
32 - (void)setUpToolbarButtons { | 30 - (void)setUpToolbarButtons { |
33 // Tools menu button. | |
34 self.toolsMenuButton = [ToolbarButton toolsMenuToolbarButton]; | |
35 | |
36 // Share button. | 31 // Share button. |
37 self.shareButton = [ToolbarButton shareToolbarButton]; | 32 self.shareButton = [ToolbarButton shareToolbarButton]; |
38 | 33 |
39 // Reload button. | 34 // Reload button. |
40 self.reloadButton = [ToolbarButton reloadToolbarButton]; | 35 self.reloadButton = [ToolbarButton reloadToolbarButton]; |
41 | 36 |
42 // Stop button. | 37 // Stop button. |
43 self.stopButton = [ToolbarButton stopToolbarButton]; | 38 self.stopButton = [ToolbarButton stopToolbarButton]; |
44 } | 39 } |
45 | 40 |
46 @end | 41 @end |
OLD | NEW |