Chromium Code Reviews| Index: ios/clean/chrome/browser/ui/tab/tab_container_view_controller.mm |
| diff --git a/ios/clean/chrome/browser/ui/tab/tab_container_view_controller.mm b/ios/clean/chrome/browser/ui/tab/tab_container_view_controller.mm |
| index 4f8dd3a8f43f5268eb97a2d1196f40c42a903ec0..e00714a824359c6b1123b323d727a65fd6ba1cd5 100644 |
| --- a/ios/clean/chrome/browser/ui/tab/tab_container_view_controller.mm |
| +++ b/ios/clean/chrome/browser/ui/tab/tab_container_view_controller.mm |
| @@ -180,37 +180,11 @@ CGFloat kTabStripHeight = 120.0f; |
| #pragma mark - MenuPresentationDelegate |
| -- (CGRect)frameForMenuPresentation:(UIPresentationController*)presentation { |
| - CGSize menuSize = presentation.presentedView.frame.size; |
| - CGRect menuRect; |
| - menuRect.size = menuSize; |
| - |
| - CGRect menuOriginRect = [self rectForZoomWithKey:@"" inView:self.view]; |
| - if (CGRectIsNull(menuOriginRect)) { |
| - menuRect.origin = CGPointMake(50, 50); |
| - return menuRect; |
| - } |
| - // Calculate which corner of the menu the origin rect is in. This is |
| - // determined by comparing frames, and thus is RTL-independent. |
| - if (CGRectGetMinX(menuOriginRect) - CGRectGetMinX(self.view.bounds) < |
| - CGRectGetMaxX(self.view.bounds) - CGRectGetMaxX(menuOriginRect)) { |
| - // Origin rect is closer to the left edge of |self.view| than to the right. |
| - menuRect.origin.x = CGRectGetMinX(menuOriginRect); |
| - } else { |
| - // Origin rect is closer to the right edge of |self.view| than to the left. |
| - menuRect.origin.x = CGRectGetMaxX(menuOriginRect) - menuSize.width; |
| - } |
| - |
| - if (CGRectGetMinY(menuOriginRect) - CGRectGetMinY(self.view.bounds) < |
| - CGRectGetMaxY(self.view.bounds) - CGRectGetMaxY(menuOriginRect)) { |
| - // Origin rect is closer to the top edge of |self.view| than to the bottom. |
| - menuRect.origin.y = CGRectGetMinY(menuOriginRect); |
| - } else { |
| - // Origin rect is closer to the bottom edge of |self.view| than to the top. |
| - menuRect.origin.y = CGRectGetMaxY(menuOriginRect) - menuSize.height; |
| - } |
| - |
| - return menuRect; |
| +- (CGRect)boundsForMenuPresentation { |
| + return self.view.bounds; |
| +} |
| +- (CGRect)originForMenuPresentation { |
| + return [self rectForZoomWithKey:@"" inView:self.view]; |
|
lpromero
2017/06/23 15:42:52
Why @"" here and nil above?
sczs
2017/06/23 15:52:35
The ZoomDelegate handles nil and empty as differen
|
| } |
| #pragma mark - ZoomTransitionDelegate |