Commit f1ee23c7 authored by Gauthier Ambard's avatar Gauthier Ambard Committed by Commit Bot

Display the stack view button only on iPhone

The stack view button is only needed on iPhone. The iPad have the tab
switcher button.

Bug: 791456
Cq-Include-Trybots: master.tryserver.chromium.mac:ios-simulator-cronet;master.tryserver.chromium.mac:ios-simulator-full-configs
Change-Id: Ie2f0044d59218d27f8253b3b44bea1c5fbc7ef19
Reviewed-on: https://chromium-review.googlesource.com/808864Reviewed-by: default avatarElodie Banel <lod@chromium.org>
Commit-Queue: Gauthier Ambard <gambard@chromium.org>
Cr-Commit-Position: refs/heads/master@{#522063}
parent 05edf9ed
...@@ -50,7 +50,8 @@ ...@@ -50,7 +50,8 @@
if (self.visibilityMask & if (self.visibilityMask &
ToolbarComponentVisibilityCompactWidthOnlyWhenEnabled) { ToolbarComponentVisibilityCompactWidthOnlyWhenEnabled) {
newHiddenValue = !self.enabled; newHiddenValue = !self.enabled;
} else if (self.visibilityMask & ToolbarComponentVisibilityCompactWidth) { } else if (self.visibilityMask & ToolbarComponentVisibilityCompactWidth ||
self.visibilityMask & ToolbarComponentVisibilityIPhoneOnly) {
newHiddenValue = NO; newHiddenValue = NO;
} }
} else { } else {
......
...@@ -20,6 +20,8 @@ typedef NS_OPTIONS(NSUInteger, ToolbarComponentVisibility) { ...@@ -20,6 +20,8 @@ typedef NS_OPTIONS(NSUInteger, ToolbarComponentVisibility) {
// Use this option when the component should be visible in CompactWidth only // Use this option when the component should be visible in CompactWidth only
// if it's enabled. // if it's enabled.
ToolbarComponentVisibilityCompactWidthOnlyWhenEnabled = 1 << 2, ToolbarComponentVisibilityCompactWidthOnlyWhenEnabled = 1 << 2,
// Use this option when the component should be always visible on iPhone only.
ToolbarComponentVisibilityIPhoneOnly = 1 << 3,
}; };
#endif // IOS_CHROME_BROWSER_UI_TOOLBAR_CLEAN_TOOLBAR_COMPONENT_OPTIONS_H_ #endif // IOS_CHROME_BROWSER_UI_TOOLBAR_CLEAN_TOOLBAR_COMPONENT_OPTIONS_H_
...@@ -389,8 +389,7 @@ ...@@ -389,8 +389,7 @@
self.tabSwitchStripButton = self.tabSwitchStripButton =
[self.buttonFactory tabSwitcherStripToolbarButton]; [self.buttonFactory tabSwitcherStripToolbarButton];
self.tabSwitchStripButton.visibilityMask = self.tabSwitchStripButton.visibilityMask =
ToolbarComponentVisibilityCompactWidth | ToolbarComponentVisibilityIPhoneOnly;
ToolbarComponentVisibilityRegularWidth;
[buttonConstraints [buttonConstraints
addObject:[self.tabSwitchStripButton.widthAnchor addObject:[self.tabSwitchStripButton.widthAnchor
constraintEqualToConstant:kToolbarButtonWidth]]; constraintEqualToConstant:kToolbarButtonWidth]];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment