| 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..d47d24d885d5bce970e0427099cfc6aa8c1b4987
|
| --- /dev/null
|
| +++ b/ios/chrome/browser/ui/content_suggestions/content_suggestions_collection_utils.h
|
| @@ -0,0 +1,40 @@
|
| +// 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 {
|
| +
|
| +// Returns the maximum number of tiles fitting in |availableWidth|, limited to
|
| +// 4.
|
| +NSUInteger numberOfTilesForWidth(CGFloat availableWidth);
|
| +// Returns the spacing between tiles, based on the device.
|
| +CGFloat spacingBetweenTiles();
|
| +
|
| +// 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 x-offset in order to have the tiles centered in a view with a
|
| +// |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_
|
|
|