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

Side by Side Diff: ios/chrome/browser/ui/tools_menu/tools_menu_view_tools_cell.mm

Issue 2881183002: Revert of Replace ObjCPropertyReleaser with ReleaseProperties() project-wide. (Closed)
Patch Set: Created 3 years, 7 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 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 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/tools_menu/tools_menu_view_tools_cell.h" 5 #import "ios/chrome/browser/ui/tools_menu/tools_menu_view_tools_cell.h"
6 6
7 #include "base/mac/objc_release_properties.h" 7 #include "base/mac/objc_property_releaser.h"
8 #include "components/strings/grit/components_strings.h" 8 #include "components/strings/grit/components_strings.h"
9 #include "ios/chrome/browser/ui/commands/ios_command_ids.h" 9 #include "ios/chrome/browser/ui/commands/ios_command_ids.h"
10 #include "ios/chrome/browser/ui/rtl_geometry.h" 10 #include "ios/chrome/browser/ui/rtl_geometry.h"
11 #include "ios/chrome/browser/ui/toolbar/toolbar_resource_macros.h" 11 #include "ios/chrome/browser/ui/toolbar/toolbar_resource_macros.h"
12 #import "ios/chrome/browser/ui/uikit_ui_util.h" 12 #import "ios/chrome/browser/ui/uikit_ui_util.h"
13 #include "ios/chrome/grit/ios_strings.h" 13 #include "ios/chrome/grit/ios_strings.h"
14 14
15 // TODO(crbug.com/228521): Remove this once the new command/metric handling is 15 // TODO(crbug.com/228521): Remove this once the new command/metric handling is
16 // implemented. This is a temporary workaround to allow metrics recording to 16 // implemented. This is a temporary workaround to allow metrics recording to
17 // distinguish the action. The value used is in the dynamic range (< 17 // distinguish the action. The value used is in the dynamic range (<
18 // IDC_MinimumLabelValue) to avoid collisions. 18 // IDC_MinimumLabelValue) to avoid collisions.
19 #define IDC_TEMP_EDIT_BOOKMARK 3900 19 #define IDC_TEMP_EDIT_BOOKMARK 3900
20 20
21 @implementation ToolsMenuViewToolsCell 21 @implementation ToolsMenuViewToolsCell {
22 base::mac::ObjCPropertyReleaser _propertyReleaser_ToolsMenuViewToolsCell;
23 }
22 24
23 @synthesize reloadButton = _reloadButton; 25 @synthesize reloadButton = _reloadButton;
24 @synthesize shareButton = _shareButton; 26 @synthesize shareButton = _shareButton;
25 @synthesize starButton = _starButton; 27 @synthesize starButton = _starButton;
26 @synthesize starredButton = _starredButton; 28 @synthesize starredButton = _starredButton;
27 @synthesize stopButton = _stopButton; 29 @synthesize stopButton = _stopButton;
28 @synthesize toolsButton = _toolsButton; 30 @synthesize toolsButton = _toolsButton;
29 31
30 - (instancetype)initWithCoder:(NSCoder*)aDecoder { 32 - (instancetype)initWithCoder:(NSCoder*)aDecoder {
31 self = [super initWithCoder:aDecoder]; 33 self = [super initWithCoder:aDecoder];
32 if (self) 34 if (self)
33 [self commonInitialization]; 35 [self commonInitialization];
34 36
35 return self; 37 return self;
36 } 38 }
37 39
38 - (instancetype)initWithFrame:(CGRect)frame { 40 - (instancetype)initWithFrame:(CGRect)frame {
39 self = [super initWithFrame:frame]; 41 self = [super initWithFrame:frame];
40 if (self) 42 if (self)
41 [self commonInitialization]; 43 [self commonInitialization];
42 44
43 return self; 45 return self;
44 } 46 }
45 47
46 - (void)commonInitialization { 48 - (void)commonInitialization {
49 _propertyReleaser_ToolsMenuViewToolsCell.Init(self,
50 [ToolsMenuViewToolsCell class]);
51
47 [self setBackgroundColor:[UIColor whiteColor]]; 52 [self setBackgroundColor:[UIColor whiteColor]];
48 [self setOpaque:YES]; 53 [self setOpaque:YES];
49 54
50 int star[2][3] = TOOLBAR_IDR_TWO_STATE(STAR); 55 int star[2][3] = TOOLBAR_IDR_TWO_STATE(STAR);
51 _starButton = [self newButtonForImageIds:star 56 _starButton = [self newButtonForImageIds:star
52 commandID:IDC_BOOKMARK_PAGE 57 commandID:IDC_BOOKMARK_PAGE
53 accessibilityLabelID:IDS_BOOKMARK_ADD_EDITOR_TITLE 58 accessibilityLabelID:IDS_BOOKMARK_ADD_EDITOR_TITLE
54 automationName:@"Add Bookmark"]; 59 automationName:@"Add Bookmark"];
55 60
56 int star_pressed[2][3] = TOOLBAR_IDR_ONE_STATE(STAR_PRESSED); 61 int star_pressed[2][3] = TOOLBAR_IDR_ONE_STATE(STAR_PRESSED);
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 95
91 [contentView addSubview:_starredButton]; 96 [contentView addSubview:_starredButton];
92 [contentView addSubview:_starButton]; 97 [contentView addSubview:_starButton];
93 [contentView addSubview:_stopButton]; 98 [contentView addSubview:_stopButton];
94 [contentView addSubview:_reloadButton]; 99 [contentView addSubview:_reloadButton];
95 [contentView addSubview:_shareButton]; 100 [contentView addSubview:_shareButton];
96 101
97 [self addConstraints]; 102 [self addConstraints];
98 } 103 }
99 104
100 - (void)dealloc {
101 base::mac::ReleaseProperties(self);
102 [super dealloc];
103 }
104
105 - (UIButton*)newButtonForImageIds:(int[2][3])imageIds 105 - (UIButton*)newButtonForImageIds:(int[2][3])imageIds
106 commandID:(int)commandID 106 commandID:(int)commandID
107 accessibilityLabelID:(int)labelID 107 accessibilityLabelID:(int)labelID
108 automationName:(NSString*)name { 108 automationName:(NSString*)name {
109 return [self newButtonForImageIds:imageIds 109 return [self newButtonForImageIds:imageIds
110 commandID:commandID 110 commandID:commandID
111 accessibilityLabelID:labelID 111 accessibilityLabelID:labelID
112 automationName:name 112 automationName:name
113 reverseForRTL:NO]; 113 reverseForRTL:NO];
114 } 114 }
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
196 if (_reloadButton) 196 if (_reloadButton)
197 [allButtons addObject:_reloadButton]; 197 [allButtons addObject:_reloadButton];
198 198
199 if (_stopButton) 199 if (_stopButton)
200 [allButtons addObject:_stopButton]; 200 [allButtons addObject:_stopButton];
201 201
202 return allButtons; 202 return allButtons;
203 } 203 }
204 204
205 @end 205 @end
OLDNEW
« no previous file with comments | « ios/chrome/browser/ui/tools_menu/tools_menu_view_item.mm ('k') | ios/web/public/origin_util_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698