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

Side by Side Diff: ios/chrome/browser/ui/stack_view/stack_view_controller.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 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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/stack_view/stack_view_controller.h" 5 #import "ios/chrome/browser/ui/stack_view/stack_view_controller.h"
6 6
7 #import <QuartzCore/QuartzCore.h> 7 #import <QuartzCore/QuartzCore.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <cmath> 10 #include <cmath>
11 #include <limits> 11 #include <limits>
12 12
13 #include "base/format_macros.h" 13 #include "base/format_macros.h"
14 #import "base/ios/block_types.h" 14 #import "base/ios/block_types.h"
15 #import "base/ios/weak_nsobject.h" 15 #import "base/ios/weak_nsobject.h"
16 #include "base/logging.h" 16 #include "base/logging.h"
17 #import "base/mac/bundle_locations.h" 17 #import "base/mac/bundle_locations.h"
18 #import "base/mac/foundation_util.h" 18 #import "base/mac/foundation_util.h"
19 #include "base/mac/objc_release_properties.h" 19 #import "base/mac/objc_property_releaser.h"
20 #include "base/mac/scoped_block.h" 20 #include "base/mac/scoped_block.h"
21 #import "base/mac/scoped_nsobject.h" 21 #import "base/mac/scoped_nsobject.h"
22 #include "base/metrics/histogram_macros.h" 22 #include "base/metrics/histogram_macros.h"
23 #include "base/metrics/user_metrics.h" 23 #include "base/metrics/user_metrics.h"
24 #include "base/metrics/user_metrics_action.h" 24 #include "base/metrics/user_metrics_action.h"
25 #include "base/strings/sys_string_conversions.h" 25 #include "base/strings/sys_string_conversions.h"
26 #include "ios/chrome/browser/chrome_url_constants.h" 26 #include "ios/chrome/browser/chrome_url_constants.h"
27 #include "ios/chrome/browser/experimental_flags.h" 27 #include "ios/chrome/browser/experimental_flags.h"
28 #import "ios/chrome/browser/tabs/tab.h" 28 #import "ios/chrome/browser/tabs/tab.h"
29 #import "ios/chrome/browser/tabs/tab_model.h" 29 #import "ios/chrome/browser/tabs/tab_model.h"
(...skipping 452 matching lines...) Expand 10 before | Expand all | Expand 10 after
482 base::scoped_nsobject<StackCard> _reverseDismissCard; 482 base::scoped_nsobject<StackCard> _reverseDismissCard;
483 // |YES| if the stack view is in the process of being dismissed. 483 // |YES| if the stack view is in the process of being dismissed.
484 BOOL _isBeingDismissed; 484 BOOL _isBeingDismissed;
485 // |YES| if the stack view is currently active. 485 // |YES| if the stack view is currently active.
486 BOOL _isActive; 486 BOOL _isActive;
487 // Records whether a memory warning occurred in the current session. 487 // Records whether a memory warning occurred in the current session.
488 BOOL _receivedMemoryWarningInSession; 488 BOOL _receivedMemoryWarningInSession;
489 // |YES| if there is card set animation being processed. For testing only. 489 // |YES| if there is card set animation being processed. For testing only.
490 // Save last touch point used by new tab animation. 490 // Save last touch point used by new tab animation.
491 CGPoint _lastTapPoint; 491 CGPoint _lastTapPoint;
492
493 base::mac::ObjCPropertyReleaser _propertyReleaserStackViewController;
492 } 494 }
493 495
494 @synthesize activeCardSet = _activeCardSet; 496 @synthesize activeCardSet = _activeCardSet;
495 @synthesize delegate = _delegate; 497 @synthesize delegate = _delegate;
496 @synthesize dummyToolbarBackgroundView = _dummyToolbarBackgroundView; 498 @synthesize dummyToolbarBackgroundView = _dummyToolbarBackgroundView;
497 @synthesize inActiveDeckChangeAnimation = _inActiveDeckChangeAnimation; 499 @synthesize inActiveDeckChangeAnimation = _inActiveDeckChangeAnimation;
498 @synthesize testDelegate = _testDelegate; 500 @synthesize testDelegate = _testDelegate;
499 @synthesize transitionStyle = _transitionStyle; 501 @synthesize transitionStyle = _transitionStyle;
500 @synthesize transitionTappedCard = _transitionTappedCard; 502 @synthesize transitionTappedCard = _transitionTappedCard;
501 @synthesize transitionToolbarController = _transitionToolbarController; 503 @synthesize transitionToolbarController = _transitionToolbarController;
502 @synthesize transitionToolbarFrame = _transitionToolbarFrame; 504 @synthesize transitionToolbarFrame = _transitionToolbarFrame;
503 @synthesize transitionToolbarOwner = _transitionToolbarOwner; 505 @synthesize transitionToolbarOwner = _transitionToolbarOwner;
504 @synthesize transitionWasCancelled = _transitionWasCancelled; 506 @synthesize transitionWasCancelled = _transitionWasCancelled;
505 507
506 - (instancetype)initWithMainCardSet:(CardSet*)mainCardSet 508 - (instancetype)initWithMainCardSet:(CardSet*)mainCardSet
507 otrCardSet:(CardSet*)otrCardSet 509 otrCardSet:(CardSet*)otrCardSet
508 activeCardSet:(CardSet*)activeCardSet { 510 activeCardSet:(CardSet*)activeCardSet {
509 DCHECK(mainCardSet); 511 DCHECK(mainCardSet);
510 DCHECK(otrCardSet); 512 DCHECK(otrCardSet);
511 DCHECK(activeCardSet == otrCardSet || activeCardSet == mainCardSet); 513 DCHECK(activeCardSet == otrCardSet || activeCardSet == mainCardSet);
512 self = [super initWithNibName:nil bundle:nil]; 514 self = [super initWithNibName:nil bundle:nil];
513 if (self) { 515 if (self) {
516 _propertyReleaserStackViewController.Init(self,
517 [StackViewController class]);
514 [self setUpWithMainCardSet:mainCardSet 518 [self setUpWithMainCardSet:mainCardSet
515 otrCardSet:otrCardSet 519 otrCardSet:otrCardSet
516 activeCardSet:activeCardSet]; 520 activeCardSet:activeCardSet];
517 _swipeDismissesCardRecognizer.reset([[UILongPressGestureRecognizer alloc] 521 _swipeDismissesCardRecognizer.reset([[UILongPressGestureRecognizer alloc]
518 initWithTarget:self 522 initWithTarget:self
519 action:@selector(handleLongPressFrom:)]); 523 action:@selector(handleLongPressFrom:)]);
520 [_swipeDismissesCardRecognizer 524 [_swipeDismissesCardRecognizer
521 setMinimumPressDuration: 525 setMinimumPressDuration:
522 kPressDurationForAmbiguousSwipeToTriggerDismissal]; 526 kPressDurationForAmbiguousSwipeToTriggerDismissal];
523 [_swipeDismissesCardRecognizer setDelegate:self]; 527 [_swipeDismissesCardRecognizer setDelegate:self];
(...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after
805 } 809 }
806 810
807 - (void)dealloc { 811 - (void)dealloc {
808 [_mainCardSet clearGestureRecognizerTargetAndDelegateFromCards:self]; 812 [_mainCardSet clearGestureRecognizerTargetAndDelegateFromCards:self];
809 [_otrCardSet clearGestureRecognizerTargetAndDelegateFromCards:self]; 813 [_otrCardSet clearGestureRecognizerTargetAndDelegateFromCards:self];
810 // Card sets shouldn't have any other references, but nil the observer just 814 // Card sets shouldn't have any other references, but nil the observer just
811 // in case one somehow does end up with another ref. 815 // in case one somehow does end up with another ref.
812 [_mainCardSet setObserver:nil]; 816 [_mainCardSet setObserver:nil];
813 [_otrCardSet setObserver:nil]; 817 [_otrCardSet setObserver:nil];
814 [self cleanUpViewsAndNotifications]; 818 [self cleanUpViewsAndNotifications];
815 base::mac::ReleaseProperties(self);
816 [super dealloc]; 819 [super dealloc];
817 } 820 }
818 821
819 // Overridden to always return NO, ensuring that the status bar shows in 822 // Overridden to always return NO, ensuring that the status bar shows in
820 // landscape on iOS8. 823 // landscape on iOS8.
821 - (BOOL)prefersStatusBarHidden { 824 - (BOOL)prefersStatusBarHidden {
822 return NO; 825 return NO;
823 } 826 }
824 827
825 // Called when in the foreground and the OS needs more memory. Release as much 828 // Called when in the foreground and the OS needs more memory. Release as much
(...skipping 2674 matching lines...) Expand 10 before | Expand all | Expand 10 after
3500 3503
3501 @end 3504 @end
3502 3505
3503 @implementation StackViewController (Testing) 3506 @implementation StackViewController (Testing)
3504 3507
3505 - (UIScrollView*)scrollView { 3508 - (UIScrollView*)scrollView {
3506 return _scrollView.get(); 3509 return _scrollView.get();
3507 } 3510 }
3508 3511
3509 @end 3512 @end
OLDNEW
« no previous file with comments | « ios/chrome/browser/ui/stack_view/card_view.mm ('k') | ios/chrome/browser/ui/tabs/tab_strip_controller.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698