OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef IOS_CHROME_BROWSER_UI_HISTORY_TAB_HISTORY_VIEW_CONTROLLER_H_ | 5 #ifndef IOS_CHROME_BROWSER_UI_HISTORY_TAB_HISTORY_VIEW_CONTROLLER_H_ |
6 #define IOS_CHROME_BROWSER_UI_HISTORY_TAB_HISTORY_VIEW_CONTROLLER_H_ | 6 #define IOS_CHROME_BROWSER_UI_HISTORY_TAB_HISTORY_VIEW_CONTROLLER_H_ |
7 | 7 |
8 #import <UIKit/UIKit.h> | 8 #import <UIKit/UIKit.h> |
9 | 9 |
10 #include "ios/web/public/navigation_item_list.h" | 10 // View controller for displaying a list of CRWSessionEntry objects in a table. |
11 | |
12 // View controller for displaying a list of NavigationItems in a table. | |
13 @interface TabHistoryViewController : UICollectionViewController | 11 @interface TabHistoryViewController : UICollectionViewController |
14 | 12 |
15 // Designated initializer that takes a NavigationItemList. | 13 // TODO(crbug.com/546355): Convert this class to use an array of |
16 - (instancetype)initWithItems:(const web::NavigationItemList&)items | 14 // NavigationEntries. |
17 NS_DESIGNATED_INITIALIZER; | 15 @property(nonatomic, strong) NSArray* sessionEntries; |
18 | |
19 // TabHistoryViewControllers must be initialized with |-initWithItems:|. | |
20 - (instancetype)initWithCoder:(NSCoder*)aDecoder NS_UNAVAILABLE; | |
21 - (instancetype)initWithCollectionViewLayout:(UICollectionViewLayout*)layout | |
22 NS_UNAVAILABLE; | |
23 - (instancetype)initWithNibName:(NSString*)nibNameOrNil | |
24 bundle:(NSBundle*)nibBundleOrNil NS_UNAVAILABLE; | |
25 | 16 |
26 // Returns the optimal height needed to display the session entries. | 17 // Returns the optimal height needed to display the session entries. |
27 // The height returned is usually less than the |suggestedHeight| unless | 18 // The height returned is usually less than the |suggestedHeight| unless |
28 // the last row of the table puts the height just over the |suggestedHeight|. | 19 // the last row of the table puts the height just over the |suggestedHeight|. |
29 // If the session entries table is taller than the |suggestedHeight| by at least | 20 // If the session entries table is taller than the |suggestedHeight| by at least |
30 // one row, the last visible session entry will be shown partially so the user | 21 // one row, the last visible session entry will be shown partially so the user |
31 // can tell that the table is scrollable. | 22 // can tell that the table is scrollable. |
32 - (CGFloat)optimalHeight:(CGFloat)suggestedHeight; | 23 - (CGFloat)optimalHeight:(CGFloat)suggestedHeight; |
33 | 24 |
34 @end | 25 @end |
35 | 26 |
36 #endif // IOS_CHROME_BROWSER_UI_HISTORY_TAB_HISTORY_VIEW_CONTROLLER_H_ | 27 #endif // IOS_CHROME_BROWSER_UI_HISTORY_TAB_HISTORY_VIEW_CONTROLLER_H_ |
OLD | NEW |