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

Side by Side Diff: ios/chrome/browser/ui/bookmarks/bookmark_folder_collection_view.mm

Issue 2666833003: Revert of Removing "All Bookmarks" (Closed)
Patch Set: Created 3 years, 10 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 unified diff | Download patch
OLDNEW
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 #import "ios/chrome/browser/ui/bookmarks/bookmark_folder_collection_view.h" 5 #import "ios/chrome/browser/ui/bookmarks/bookmark_folder_collection_view.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/mac/objc_property_releaser.h" 8 #include "base/mac/objc_property_releaser.h"
9 #include "base/strings/sys_string_conversions.h" 9 #include "base/strings/sys_string_conversions.h"
10 #include "components/bookmarks/browser/bookmark_model.h" 10 #include "components/bookmarks/browser/bookmark_model.h"
(...skipping 421 matching lines...) Expand 10 before | Expand all | Expand 10 after
432 - (void)collectionViewScrolled { 432 - (void)collectionViewScrolled {
433 [self.delegate bookmarkCollectionViewDidScroll:self]; 433 [self.delegate bookmarkCollectionViewDidScroll:self];
434 } 434 }
435 435
436 - (void)setEditing:(BOOL)editing animated:(BOOL)animated { 436 - (void)setEditing:(BOOL)editing animated:(BOOL)animated {
437 [super setEditing:editing animated:animated]; 437 [super setEditing:editing animated:animated];
438 [self promoStateChangedAnimated:animated]; 438 [self promoStateChangedAnimated:animated];
439 } 439 }
440 440
441 - (void)promoStateChangedAnimated:(BOOL)animate { 441 - (void)promoStateChangedAnimated:(BOOL)animate {
442 if (experimental_flags::IsAllBookmarksEnabled())
443 return; // The promo is not shown if All Bookmarks is enabled.
444
442 BOOL newPromoState = 445 BOOL newPromoState =
443 !self.editing && self.folder && 446 !self.editing && self.folder &&
444 self.folder->type() == BookmarkNode::MOBILE && 447 self.folder->type() == BookmarkNode::MOBILE &&
445 [self.delegate bookmarkCollectionViewShouldShowPromoCell:self]; 448 [self.delegate bookmarkCollectionViewShouldShowPromoCell:self];
446 if (newPromoState != _promoVisible) { 449 if (newPromoState != _promoVisible) {
447 // This is awful, but until the old code to do the refresh when switching 450 // This is awful, but until the old code to do the refresh when switching
448 // in and out of edit mode is fixed, this is probably the cleanest thing to 451 // in and out of edit mode is fixed, this is probably the cleanest thing to
449 // do. 452 // do.
450 _promoVisible = newPromoState; 453 _promoVisible = newPromoState;
451 [self.collectionView reloadData]; 454 [self.collectionView reloadData];
(...skipping 10 matching lines...) Expand all
462 [self.delegate bookmarkCollectionViewDismissPromo:self]; 465 [self.delegate bookmarkCollectionViewDismissPromo:self];
463 } 466 }
464 467
465 #pragma mark - Promo Cell 468 #pragma mark - Promo Cell
466 469
467 - (BOOL)shouldShowPromoCell { 470 - (BOOL)shouldShowPromoCell {
468 return _promoVisible; 471 return _promoVisible;
469 } 472 }
470 473
471 @end 474 @end
OLDNEW
« no previous file with comments | « ios/chrome/browser/ui/bookmarks/BUILD.gn ('k') | ios/chrome/browser/ui/bookmarks/bookmark_home_handset_view_controller.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698