OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef IOS_CHROME_BROWSER_UI_BOOKMARKS_HOME_VIEW_CONTROLLER_H_ | |
6 #define IOS_CHROME_BROWSER_UI_BOOKMARKS_HOME_VIEW_CONTROLLER_H_ | |
7 | |
8 #import <UIKit/UIKit.h> | |
9 | |
10 #include <set> | |
11 #include <vector> | |
12 | |
13 @protocol UrlLoader; | |
14 @protocol BookmarkHomePrimaryView; | |
15 | |
16 namespace ios { | |
17 class ChromeBrowserState; | |
18 } // namespace ios | |
19 | |
20 namespace bookmarks { | |
21 class BookmarkModel; | |
22 } // namespace bookmarks | |
23 | |
24 @class BookmarkCollectionView; | |
25 @class BookmarkPanelView; | |
26 @class BookmarkMenuView; | |
27 @class BookmarkHomeWaitingView; | |
28 @class BookmarkNavigationBar; | |
29 @class BookmarkMenuItem; | |
30 | |
31 @interface BookmarkHomeViewController : UIViewController | |
noyau (Ping after 24h)
2017/07/07 09:37:18
Please add a class comment.
ramyasharma
2017/07/10 06:55:58
Done.
| |
32 | |
33 // Designated initializer. | |
noyau (Ping after 24h)
2017/07/07 09:37:19
Replace this comment by NS_DESIGNATED_INITIALIZER.
ramyasharma
2017/07/10 06:55:58
Done.
| |
34 - (instancetype)initWithLoader:(id<UrlLoader>)loader | |
35 browserState:(ios::ChromeBrowserState*)browserState; | |
36 | |
37 @property(nonatomic, assign, readonly) bookmarks::BookmarkModel* bookmarks; | |
noyau (Ping after 24h)
2017/07/07 09:37:20
Need a quick comment.
ramyasharma
2017/07/10 06:55:58
Done.
| |
38 | |
39 // The user's browser state model used. | |
40 @property(nonatomic, assign, readonly) ios::ChromeBrowserState* browserState; | |
41 | |
42 // View shown from the menu. | |
noyau (Ping after 24h)
2017/07/07 09:37:22
This comment is net very informative. "The main vi
ramyasharma
2017/07/10 06:55:58
Done.
| |
43 @property(nonatomic, strong, readonly) BookmarkCollectionView* folderView; | |
44 | |
45 @property(nonatomic, weak, readonly) id<UrlLoader> loader; | |
noyau (Ping after 24h)
2017/07/07 09:37:22
Add comment
ramyasharma
2017/07/10 06:55:58
Done.
| |
46 | |
47 // The menu with all the folders and special entries. | |
noyau (Ping after 24h)
2017/07/07 09:37:18
I don't think there are any special entries left :
ramyasharma
2017/07/10 06:55:58
thanks, just copied over the comment from before :
| |
48 @property(nonatomic, strong, readonly) BookmarkMenuView* menuView; | |
49 | |
50 // The navigation bar sits on top of the main content. | |
51 @property(nonatomic, strong, readonly) BookmarkNavigationBar* navigationBar; | |
52 | |
53 // At any point in time, there is exactly one collection view whose view is part | |
54 // of the view hierarchy. This property determine which collection view is | |
lpromero
2017/07/07 13:30:09
*determines
ramyasharma
2017/07/10 06:55:58
Done.
| |
55 // visible. Not by accident, this property also reflects the selected menu item | |
56 // in the BookmarkMenuView. | |
noyau (Ping after 24h)
2017/07/07 09:37:21
I think this comment is misleading a bit. I believ
ramyasharma
2017/07/10 06:55:58
Done.
| |
57 @property(nonatomic, strong, readonly) BookmarkMenuItem* primaryMenuItem; | |
58 | |
59 @property(nonatomic, strong, readonly) BookmarkPanelView* panelView; | |
noyau (Ping after 24h)
2017/07/07 09:37:18
Can you add a comment?
ramyasharma
2017/07/10 06:55:58
Done.
| |
60 | |
61 // Either the menu or the primaryView can scrollToTop. | |
62 @property(nonatomic, assign) BOOL scrollToTop; | |
63 | |
64 // This view is created and used if the model is not fully loaded yet by the | |
65 // time this controller starts. Property is readwrite, so that subclasses can | |
66 // set it to nil, once finished with it. | |
67 @property(nonatomic, strong) BookmarkHomeWaitingView* waitForModelView; | |
68 | |
69 // This method should be called at most once in the life-cycle of the class. | |
70 // It should be called at the soonest possible time after the view has been | |
71 // loaded, and the bookmark model is loaded. | |
72 - (void)loadBookmarkViews; | |
73 | |
74 // Returns the width of the menu. | |
75 - (CGFloat)menuWidth; | |
76 | |
77 // This method is called if the view needs to be loaded and the model is not | |
78 // ready yet. | |
79 - (void)loadWaitingView; | |
80 | |
81 // Updates the property 'primaryMenuItem'. | |
82 // Updates the UI to reflect the new state of 'primaryMenuItem'. | |
83 - (void)updatePrimaryMenuItem:(BookmarkMenuItem*)menuItem; | |
84 | |
85 // The active collection view that corresponds to primaryMenuItem. | |
86 - (UIView<BookmarkHomePrimaryView>*)primaryView; | |
87 @end | |
88 | |
89 #endif // IOS_CHROME_BROWSER_UI_BOOKMARKS_HOME_VIEW_CONTROLLER_H_ | |
OLD | NEW |