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

Unified Diff: ios/chrome/browser/ui/ntp/new_tab_page_view.mm

Issue 2785893003: [ios clean] Add placeholder for NTP bookmarks, chrome home and open tabs. (Closed)
Patch Set: Comments 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 side-by-side diff with in-line comments
Download patch
Index: ios/chrome/browser/ui/ntp/new_tab_page_view.mm
diff --git a/ios/chrome/browser/ui/ntp/new_tab_page_view.mm b/ios/chrome/browser/ui/ntp/new_tab_page_view.mm
index 7f9f7ab87e63cfe169c902b229e1c613ae416218..0fedbd148d776c18cd0c33db4f04c12ddefd9a67 100644
--- a/ios/chrome/browser/ui/ntp/new_tab_page_view.mm
+++ b/ios/chrome/browser/ui/ntp/new_tab_page_view.mm
@@ -80,11 +80,14 @@
[self.scrollView setContentOffset:point animated:NO];
}
- // Trigger a layout. The |-layoutIfNeeded| call is required because sometimes
- // |-layoutSubviews| is not successfully triggered when |-setNeedsLayout| is
- // called after frame changes due to autoresizing masks.
- [self setNeedsLayout];
- [self layoutIfNeeded];
+ if (self.translatesAutoresizingMaskIntoConstraints) {
marq (ping after 24h) 2017/04/05 12:22:47 It's not clear to my why this is conditional here.
justincohen 2017/04/05 19:28:23 Added a comment explaining why.
+ // Trigger a layout. The |-layoutIfNeeded| call is required because
+ // sometimes
+ // |-layoutSubviews| is not successfully triggered when |-setNeedsLayout| is
+ // called after frame changes due to autoresizing masks.
+ [self setNeedsLayout];
+ [self layoutIfNeeded];
+ }
}
- (void)layoutSubviews {
@@ -102,6 +105,10 @@
CGRectGetMinX(self.bounds), CGRectGetMinY(self.bounds),
CGRectGetWidth(self.bounds), CGRectGetMinY(self.tabBar.frame));
}
+
+ if (!self.translatesAutoresizingMaskIntoConstraints) {
+ [self setFrame:self.frame];
marq (ping after 24h) 2017/04/05 12:22:47 This feels deeply wrong. Why is it needed?
justincohen 2017/04/05 19:28:23 Added a comment explaining why.
+ }
}
- (void)updateScrollViewContentSize {

Powered by Google App Engine
This is Rietveld 408576698