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..70c90cddf4713c880e36c532344625dfd6fe2f1f |
--- /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 the left margin in order to have the tiles centered in a view with a |
marq (ping after 24h)
2017/05/04 08:15:00
Left, or leading?
gambard
2017/05/04 15:12:31
It should be symmetrical.
Done.
|
+// |width|. |
+CGFloat leftMarginForWidth(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_ |