Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(66)

Unified Diff: ios/chrome/browser/ui/bookmarks/bookmark_home_view_controller.h

Issue 2972733002: Creates common super class for bookmark handset and tablet view controllers (Closed)
Patch Set: Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ios/chrome/browser/ui/bookmarks/bookmark_home_view_controller.h
diff --git a/ios/chrome/browser/ui/bookmarks/bookmark_home_view_controller.h b/ios/chrome/browser/ui/bookmarks/bookmark_home_view_controller.h
new file mode 100644
index 0000000000000000000000000000000000000000..c7b5d2c7b6939d1a6b205e4a0d33019d3351b382
--- /dev/null
+++ b/ios/chrome/browser/ui/bookmarks/bookmark_home_view_controller.h
@@ -0,0 +1,89 @@
+// 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_BOOKMARKS_HOME_VIEW_CONTROLLER_H_
+#define IOS_CHROME_BROWSER_UI_BOOKMARKS_HOME_VIEW_CONTROLLER_H_
+
+#import <UIKit/UIKit.h>
+
+#include <set>
+#include <vector>
+
+@protocol UrlLoader;
+@protocol BookmarkHomePrimaryView;
+
+namespace ios {
+class ChromeBrowserState;
+} // namespace ios
+
+namespace bookmarks {
+class BookmarkModel;
+} // namespace bookmarks
+
+@class BookmarkCollectionView;
+@class BookmarkPanelView;
+@class BookmarkMenuView;
+@class BookmarkHomeWaitingView;
+@class BookmarkNavigationBar;
+@class BookmarkMenuItem;
+
+@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.
+
+// 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.
+- (instancetype)initWithLoader:(id<UrlLoader>)loader
+ browserState:(ios::ChromeBrowserState*)browserState;
+
+@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.
+
+// The user's browser state model used.
+@property(nonatomic, assign, readonly) ios::ChromeBrowserState* browserState;
+
+// 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.
+@property(nonatomic, strong, readonly) BookmarkCollectionView* folderView;
+
+@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.
+
+// 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 :
+@property(nonatomic, strong, readonly) BookmarkMenuView* menuView;
+
+// The navigation bar sits on top of the main content.
+@property(nonatomic, strong, readonly) BookmarkNavigationBar* navigationBar;
+
+// At any point in time, there is exactly one collection view whose view is part
+// 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.
+// visible. Not by accident, this property also reflects the selected menu item
+// 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.
+@property(nonatomic, strong, readonly) BookmarkMenuItem* primaryMenuItem;
+
+@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.
+
+// Either the menu or the primaryView can scrollToTop.
+@property(nonatomic, assign) BOOL scrollToTop;
+
+// This view is created and used if the model is not fully loaded yet by the
+// time this controller starts. Property is readwrite, so that subclasses can
+// set it to nil, once finished with it.
+@property(nonatomic, strong) BookmarkHomeWaitingView* waitForModelView;
+
+// This method should be called at most once in the life-cycle of the class.
+// It should be called at the soonest possible time after the view has been
+// loaded, and the bookmark model is loaded.
+- (void)loadBookmarkViews;
+
+// Returns the width of the menu.
+- (CGFloat)menuWidth;
+
+// This method is called if the view needs to be loaded and the model is not
+// ready yet.
+- (void)loadWaitingView;
+
+// Updates the property 'primaryMenuItem'.
+// Updates the UI to reflect the new state of 'primaryMenuItem'.
+- (void)updatePrimaryMenuItem:(BookmarkMenuItem*)menuItem;
+
+// The active collection view that corresponds to primaryMenuItem.
+- (UIView<BookmarkHomePrimaryView>*)primaryView;
+@end
+
+#endif // IOS_CHROME_BROWSER_UI_BOOKMARKS_HOME_VIEW_CONTROLLER_H_

Powered by Google App Engine
This is Rietveld 408576698