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

Unified Diff: ios/chrome/browser/ui/bookmarks/bookmark_home_tablet_ntp_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_tablet_ntp_controller.mm
diff --git a/ios/chrome/browser/ui/bookmarks/bookmark_home_tablet_ntp_controller.mm b/ios/chrome/browser/ui/bookmarks/bookmark_home_tablet_ntp_controller.mm
index e4e521b936e50d6b08fa19c8c4c9ebf20f57ef26..82be0d6b6e1258d9814fdb413fc2031272e631da 100644
--- a/ios/chrome/browser/ui/bookmarks/bookmark_home_tablet_ntp_controller.mm
+++ b/ios/chrome/browser/ui/bookmarks/bookmark_home_tablet_ntp_controller.mm
@@ -24,7 +24,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_edit_view_controller.h"
#import "ios/chrome/browser/ui/bookmarks/bookmark_folder_collection_view.h"
#import "ios/chrome/browser/ui/bookmarks/bookmark_folder_editor_view_controller.h"
@@ -131,7 +130,6 @@ const CGFloat kNavigationBarTopMargin = 8.0;
// time, it contains exactly one of the BookmarkCollectionView subclasses.
@property(nonatomic, retain) ContentView* 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.
@@ -185,7 +183,6 @@ const CGFloat kNavigationBarTopMargin = 8.0;
// 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'.
@@ -282,7 +279,6 @@ const CGFloat kNavigationBarTopMargin = 8.0;
@synthesize bookmarks = _bookmarks;
@synthesize contentView = _contentView;
-@synthesize allItemsView = _allItemsView;
@synthesize folderView = _folderView;
@synthesize waitForModelView = _waitForModelView;
@@ -329,7 +325,6 @@ const CGFloat kNavigationBarTopMargin = 8.0;
- (void)dealloc {
_contentView.delegate = nil;
- _allItemsView.delegate = nil;
_folderView.delegate = nil;
_menuView.delegate = nil;
@@ -506,20 +501,6 @@ const CGFloat kNavigationBarTopMargin = 8.0;
}
}
-- (void)ensureAllViewExists {
- if (self.allItemsView)
- return;
-
- base::scoped_nsobject<BookmarkAllCollectionView> view(
- [[BookmarkAllCollectionView alloc] initWithBrowserState:self.browserState
- frame:CGRectZero]);
- 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;
@@ -547,9 +528,6 @@ const CGFloat kNavigationBarTopMargin = 8.0;
self.primaryMenuItem = menuItem;
switch (self.primaryMenuItem.type) {
- case bookmarks::MenuItemAll:
- [self ensureAllViewExists];
- break;
case bookmarks::MenuItemFolder:
[self ensureFolderViewExists];
[self.folderView resetFolder:self.primaryMenuItem.folder];
@@ -583,8 +561,6 @@ const CGFloat kNavigationBarTopMargin = 8.0;
DCHECK([self contentView]);
switch (self.primaryMenuItem.type) {
- case bookmarks::MenuItemAll:
- return self.allItemsView;
case bookmarks::MenuItemFolder:
return self.folderView;
case bookmarks::MenuItemDivider:
@@ -1324,14 +1300,6 @@ const CGFloat kNavigationBarTopMargin = 8.0;
#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