Index: ios/chrome/browser/ui/content_suggestions/content_suggestions_collection_utils.h |
diff --git a/ios/chrome/browser/ui/content_suggestions/content_suggestions_collection_utils.h b/ios/chrome/browser/ui/content_suggestions/content_suggestions_collection_utils.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..f7cdadb33be4852425c2d0edeb8eb02bfe77fbd4 |
--- /dev/null |
+++ b/ios/chrome/browser/ui/content_suggestions/content_suggestions_collection_utils.h |
@@ -0,0 +1,34 @@ |
+// Copyright 2017 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef IOS_CHROME_BROWSER_UI_CONTENT_SUGGESTIONS_CONTENT_SUGGESTIONS_COLLECTION_UTILS_H_ |
+#define IOS_CHROME_BROWSER_UI_CONTENT_SUGGESTIONS_CONTENT_SUGGESTIONS_COLLECTION_UTILS_H_ |
+ |
+#import <UIKit/UIKit.h> |
+ |
+namespace content_suggestions { |
+ |
+// iPhone landscape uses a slightly different layout for the doodle and search |
+// field frame. Returns the proper frame from |frames| based on orientation, |
+// centered in the view of |width|. |
+CGRect getOrientationFrame(const CGRect frames[], CGFloat width); |
+// Returns left margin in order to have the tiles centered in a view with a |
marq (ping after 24h)
2017/05/10 09:23:49
For clarity, maybe 'x-offset' is clearer than 'lef
gambard
2017/05/10 11:09:40
Done.
|
+// |width|. |
+CGFloat centeredTilesMarginForWidth(CGFloat width); |
+// Returns the proper frame for the doodle inside a view with a |width|. |
+// |logoIsShowing| refers to the Google logo or the doodle. |
+CGRect doodleFrame(CGFloat width, BOOL logoIsShowing); |
+// Returns the proper frame for the search field inside a view with a |width|. |
+// |logoIsShowing| refers to the Google logo or the doodle. |
+CGRect searchFieldFrame(CGFloat width, BOOL logoIsShowing); |
+// Returns the expected height of the NewTabPageHeaderView inside a view with a |
+// |width|. |logoIsShowing| refers to the Google logo or the doodle. |
+// |promoCanShow| represents whether a what's new promo can be displayed. |
+CGFloat heightForLogoHeader(CGFloat width, |
+ BOOL logoIsShowing, |
+ BOOL promoCanShow); |
+ |
+} // namespace content_suggestions |
+ |
+#endif // IOS_CHROME_BROWSER_UI_CONTENT_SUGGESTIONS_CONTENT_SUGGESTIONS_COLLECTION_UTILS_H_ |