Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 // ====== New Architecture ===== | 5 // ====== New Architecture ===== |
| 6 // = This code is only used in the new iOS Chrome architecture. = | 6 // = This code is only used in the new iOS Chrome architecture. = |
| 7 // ============================================================================ | 7 // ============================================================================ |
| 8 | 8 |
| 9 #import "ios/clean/chrome/browser/ui/toolbar/toolbar_view_controller.h" | 9 #import "ios/clean/chrome/browser/ui/toolbar/toolbar_view_controller.h" |
| 10 | 10 |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 77 constant:kVerticalMargin], | 77 constant:kVerticalMargin], |
| 78 [self.stackView.bottomAnchor constraintEqualToAnchor:self.view.bottomAnchor | 78 [self.stackView.bottomAnchor constraintEqualToAnchor:self.view.bottomAnchor |
| 79 constant:-kVerticalMargin], | 79 constant:-kVerticalMargin], |
| 80 [self.stackView.leadingAnchor | 80 [self.stackView.leadingAnchor |
| 81 constraintEqualToAnchor:self.view.layoutMarginsGuide.leadingAnchor], | 81 constraintEqualToAnchor:self.view.layoutMarginsGuide.leadingAnchor], |
| 82 [self.stackView.trailingAnchor | 82 [self.stackView.trailingAnchor |
| 83 constraintEqualToAnchor:self.view.layoutMarginsGuide.trailingAnchor], | 83 constraintEqualToAnchor:self.view.layoutMarginsGuide.trailingAnchor], |
| 84 ]]; | 84 ]]; |
| 85 } | 85 } |
| 86 | 86 |
| 87 - (void)viewWillLayoutSubviews { | |
| 88 [self closeToolsMenu:nil]; | |
|
edchin
2017/02/15 04:14:50
Pls comment that this closes the menu when the dev
marq (ping after 24h)
2017/02/15 15:06:16
I'd like to not "fake" calls to target/action meth
sczs
2017/02/16 00:31:39
Done.
| |
| 89 } | |
| 90 | |
| 87 #pragma mark - Components Setup | 91 #pragma mark - Components Setup |
| 88 | 92 |
| 89 - (void)setUpToolbarButtons { | 93 - (void)setUpToolbarButtons { |
| 90 // Back button. | 94 // Back button. |
| 91 self.backButton = [ToolbarButton backToolbarButton]; | 95 self.backButton = [ToolbarButton backToolbarButton]; |
| 92 self.backButton.visibilityMask = ToolbarComponentVisibilityCompactWidth | | 96 self.backButton.visibilityMask = ToolbarComponentVisibilityCompactWidth | |
| 93 ToolbarComponentVisibilityRegularWidth; | 97 ToolbarComponentVisibilityRegularWidth; |
| 94 [self.backButton addTarget:nil | 98 [self.backButton addTarget:nil |
| 95 action:@selector(goBack:) | 99 action:@selector(goBack:) |
| 96 forControlEvents:UIControlEventTouchUpInside]; | 100 forControlEvents:UIControlEventTouchUpInside]; |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 192 - (void)updateAllButtonsVisibility { | 196 - (void)updateAllButtonsVisibility { |
| 193 for (UIView* view in self.stackView.arrangedSubviews) { | 197 for (UIView* view in self.stackView.arrangedSubviews) { |
| 194 if ([view isKindOfClass:[ToolbarButton class]]) { | 198 if ([view isKindOfClass:[ToolbarButton class]]) { |
| 195 ToolbarButton* button = base::mac::ObjCCastStrict<ToolbarButton>(view); | 199 ToolbarButton* button = base::mac::ObjCCastStrict<ToolbarButton>(view); |
| 196 [button setHiddenForCurrentStateAndSizeClass]; | 200 [button setHiddenForCurrentStateAndSizeClass]; |
| 197 } | 201 } |
| 198 } | 202 } |
| 199 } | 203 } |
| 200 | 204 |
| 201 @end | 205 @end |
| OLD | NEW |