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

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

Issue 2662473003: Removing "All Bookmarks" (Closed)
Patch Set: feedback 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
445 BOOL newPromoState = 442 BOOL newPromoState =
446 !self.editing && self.folder && 443 !self.editing && self.folder &&
447 self.folder->type() == BookmarkNode::MOBILE && 444 self.folder->type() == BookmarkNode::MOBILE &&
448 [self.delegate bookmarkCollectionViewShouldShowPromoCell:self]; 445 [self.delegate bookmarkCollectionViewShouldShowPromoCell:self];
449 if (newPromoState != _promoVisible) { 446 if (newPromoState != _promoVisible) {
450 // This is awful, but until the old code to do the refresh when switching 447 // This is awful, but until the old code to do the refresh when switching
451 // in and out of edit mode is fixed, this is probably the cleanest thing to 448 // in and out of edit mode is fixed, this is probably the cleanest thing to
452 // do. 449 // do.
453 _promoVisible = newPromoState; 450 _promoVisible = newPromoState;
454 [self.collectionView reloadData]; 451 [self.collectionView reloadData];
(...skipping 10 matching lines...) Expand all
465 [self.delegate bookmarkCollectionViewDismissPromo:self]; 462 [self.delegate bookmarkCollectionViewDismissPromo:self];
466 } 463 }
467 464
468 #pragma mark - Promo Cell 465 #pragma mark - Promo Cell
469 466
470 - (BOOL)shouldShowPromoCell { 467 - (BOOL)shouldShowPromoCell {
471 return _promoVisible; 468 return _promoVisible;
472 } 469 }
473 470
474 @end 471 @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