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

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

Issue 2610923005: Replace ObjCPropertyReleaser with ReleaseProperties() project-wide. (Closed)
Patch Set: weak -> assign 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 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_release_properties.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"
11 #include "ios/chrome/browser/bookmarks/bookmarks_utils.h" 11 #include "ios/chrome/browser/bookmarks/bookmarks_utils.h"
12 #include "ios/chrome/browser/experimental_flags.h" 12 #include "ios/chrome/browser/experimental_flags.h"
13 #import "ios/chrome/browser/ui/bookmarks/bookmark_collection_cells.h" 13 #import "ios/chrome/browser/ui/bookmarks/bookmark_collection_cells.h"
14 #import "ios/chrome/browser/ui/bookmarks/bookmark_promo_cell.h" 14 #import "ios/chrome/browser/ui/bookmarks/bookmark_promo_cell.h"
15 #import "ios/chrome/browser/ui/bookmarks/bookmark_utils_ios.h" 15 #import "ios/chrome/browser/ui/bookmarks/bookmark_utils_ios.h"
16 16
17 using bookmarks::BookmarkNode; 17 using bookmarks::BookmarkNode;
18 18
19 @interface BookmarkFolderCollectionView ()<BookmarkPromoCellDelegate> { 19 @interface BookmarkFolderCollectionView ()<BookmarkPromoCellDelegate> {
20 base::mac::ObjCPropertyReleaser
21 _propertyReleaser_BookmarkFolderCollectionView;
22 // A vector of folders to display in the collection view. 20 // A vector of folders to display in the collection view.
23 std::vector<const BookmarkNode*> _subFolders; 21 std::vector<const BookmarkNode*> _subFolders;
24 // A vector of bookmark urls to display in the collection view. 22 // A vector of bookmark urls to display in the collection view.
25 std::vector<const BookmarkNode*> _subItems; 23 std::vector<const BookmarkNode*> _subItems;
26 24
27 // True if the promo is visible. 25 // True if the promo is visible.
28 BOOL _promoVisible; 26 BOOL _promoVisible;
29 } 27 }
30 @property(nonatomic, assign) const bookmarks::BookmarkNode* folder; 28 @property(nonatomic, assign) const bookmarks::BookmarkNode* folder;
31 29
(...skipping 10 matching lines...) Expand all
42 40
43 @implementation BookmarkFolderCollectionView 41 @implementation BookmarkFolderCollectionView
44 @synthesize delegate = _delegate; 42 @synthesize delegate = _delegate;
45 @synthesize folder = _folder; 43 @synthesize folder = _folder;
46 @synthesize promoCell = _promoCell; 44 @synthesize promoCell = _promoCell;
47 45
48 - (instancetype)initWithBrowserState:(ios::ChromeBrowserState*)browserState 46 - (instancetype)initWithBrowserState:(ios::ChromeBrowserState*)browserState
49 frame:(CGRect)frame { 47 frame:(CGRect)frame {
50 self = [super initWithBrowserState:browserState frame:frame]; 48 self = [super initWithBrowserState:browserState frame:frame];
51 if (self) { 49 if (self) {
52 _propertyReleaser_BookmarkFolderCollectionView.Init(
53 self, [BookmarkFolderCollectionView class]);
54
55 [self updateCollectionView]; 50 [self updateCollectionView];
56 } 51 }
57 return self; 52 return self;
58 } 53 }
59 54
60 - (void)dealloc { 55 - (void)dealloc {
61 _promoCell.delegate = nil; 56 _promoCell.delegate = nil;
57 base::mac::ReleaseProperties(self);
62 [super dealloc]; 58 [super dealloc];
63 } 59 }
64 60
65 - (void)setDelegate:(id<BookmarkFolderCollectionViewDelegate>)delegate { 61 - (void)setDelegate:(id<BookmarkFolderCollectionViewDelegate>)delegate {
66 _delegate = delegate; 62 _delegate = delegate;
67 [self promoStateChangedAnimated:NO]; 63 [self promoStateChangedAnimated:NO];
68 } 64 }
69 65
70 - (NSInteger)promoSection { 66 - (NSInteger)promoSection {
71 return [self shouldShowPromoCell] ? 0 : -1; 67 return [self shouldShowPromoCell] ? 0 : -1;
(...skipping 393 matching lines...) Expand 10 before | Expand all | Expand 10 after
465 [self.delegate bookmarkCollectionViewDismissPromo:self]; 461 [self.delegate bookmarkCollectionViewDismissPromo:self];
466 } 462 }
467 463
468 #pragma mark - Promo Cell 464 #pragma mark - Promo Cell
469 465
470 - (BOOL)shouldShowPromoCell { 466 - (BOOL)shouldShowPromoCell {
471 return _promoVisible; 467 return _promoVisible;
472 } 468 }
473 469
474 @end 470 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698