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

Unified Diff: ios/chrome/browser/ui/bookmarks/bookmark_home_handset_view_controller.mm

Issue 2662473003: Removing "All Bookmarks" (Closed)
Patch Set: feedback Created 3 years, 11 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_handset_view_controller.mm
diff --git a/ios/chrome/browser/ui/bookmarks/bookmark_home_handset_view_controller.mm b/ios/chrome/browser/ui/bookmarks/bookmark_home_handset_view_controller.mm
index ab58a753423e5d4d0159922599f8129d51781252..3cf3aa2a9bc80ec4a2facc248c35bb09ba2e1737 100644
--- a/ios/chrome/browser/ui/bookmarks/bookmark_home_handset_view_controller.mm
+++ b/ios/chrome/browser/ui/bookmarks/bookmark_home_handset_view_controller.mm
@@ -21,7 +21,6 @@
#import "ios/chrome/browser/ui/alert_coordinator/action_sheet_coordinator.h"
#import "ios/chrome/browser/ui/bookmarks/bars/bookmark_editing_bar.h"
#import "ios/chrome/browser/ui/bookmarks/bars/bookmark_navigation_bar.h"
-#import "ios/chrome/browser/ui/bookmarks/bookmark_all_collection_view.h"
#import "ios/chrome/browser/ui/bookmarks/bookmark_collection_cells.h"
#import "ios/chrome/browser/ui/bookmarks/bookmark_edit_view_controller.h"
#import "ios/chrome/browser/ui/bookmarks/bookmark_folder_collection_view.h"
@@ -68,7 +67,6 @@ const CGFloat kBookmarkMenuWidth = 264;
// time, it contains exactly one of the BookmarkCollectionView subclasses.
@property(nonatomic, retain) UIView* contentView;
// The possible views that can be shown from the menu.
-@property(nonatomic, retain) BookmarkAllCollectionView* allItemsView;
@property(nonatomic, retain) BookmarkFolderCollectionView* folderView;
// This view is created and used if the model is not fully loaded yet by the
// time this controller starts.
@@ -121,7 +119,6 @@ const CGFloat kBookmarkMenuWidth = 264;
// view has been loaded, and the bookmark model is loaded.
- (void)loadBookmarkViews;
// If the view doesn't exist, create it.
-- (void)ensureAllViewExists;
- (void)ensureFolderViewExists;
// Updates the property 'primaryMenuItem'.
// Updates the UI to reflect the new state of 'primaryMenuItem'.
@@ -219,7 +216,6 @@ const CGFloat kBookmarkMenuWidth = 264;
@end
@implementation BookmarkHomeHandsetViewController
-@synthesize allItemsView = _allItemsView;
@synthesize contentView = _contentView;
@synthesize folderView = _folderView;
@synthesize waitForModelView = _waitForModelView;
@@ -257,7 +253,6 @@ const CGFloat kBookmarkMenuWidth = 264;
}
- (void)dealloc {
- _allItemsView.delegate = nil;
_folderView.delegate = nil;
_menuView.delegate = nil;
@@ -380,21 +375,6 @@ const CGFloat kBookmarkMenuWidth = 264;
}
}
-- (void)ensureAllViewExists {
- if (self.allItemsView)
- return;
-
- base::scoped_nsobject<BookmarkAllCollectionView> view(
- [[BookmarkAllCollectionView alloc]
- initWithBrowserState:self.browserState
- frame:[self frameForPrimaryView]]);
- self.allItemsView = view;
- self.allItemsView.delegate = self;
- [self.allItemsView setEditing:self.editing animated:NO];
- self.allItemsView.autoresizingMask =
- UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth;
-}
-
- (void)ensureFolderViewExists {
if (self.folderView)
return;
@@ -423,9 +403,6 @@ const CGFloat kBookmarkMenuWidth = 264;
self.primaryMenuItem = menuItem;
switch (self.primaryMenuItem.type) {
- case bookmarks::MenuItemAll:
- [self ensureAllViewExists];
- break;
case bookmarks::MenuItemFolder:
[self ensureFolderViewExists];
[self.folderView resetFolder:self.primaryMenuItem.folder];
@@ -452,8 +429,6 @@ const CGFloat kBookmarkMenuWidth = 264;
- (UIView<BookmarkHomePrimaryView>*)primaryView {
switch (self.primaryMenuItem.type) {
- case bookmarks::MenuItemAll:
- return self.allItemsView;
case bookmarks::MenuItemFolder:
return self.folderView;
case bookmarks::MenuItemDivider:
@@ -1157,15 +1132,6 @@ const CGFloat kBookmarkMenuWidth = 264;
#pragma mark - BookmarkPromoControllerDelegate
- (void)promoStateChanged:(BOOL)promoEnabled {
- [self.allItemsView.collectionView reloadData];
- // This is required to workaround a crash seen once on iOS 7.1 when
- // the collection gets two reloadData without getting a call to layout
- // subviews, the collection view will reuse some cached data for the perfoming
- // the layout which are invalid after the second call to reloadData.
- // Forcing the layout invalidation after each reloadData seems to fix the
- // issue.
- [self.allItemsView.collectionView.collectionViewLayout invalidateLayout];
-
[self.folderView
promoStateChangedAnimated:self.folderView == [self primaryView]];
}

Powered by Google App Engine
This is Rietveld 408576698