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

Unified Diff: ios/chrome/browser/ui/stack_view/card_stack_layout_manager.mm

Issue 2944443003: [ObjC ARC] Converts ios/chrome/browser/ui/stack_view:stack_view to ARC. (Closed)
Patch Set: Created 3 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: ios/chrome/browser/ui/stack_view/card_stack_layout_manager.mm
diff --git a/ios/chrome/browser/ui/stack_view/card_stack_layout_manager.mm b/ios/chrome/browser/ui/stack_view/card_stack_layout_manager.mm
index cb84a71508bccad891fa04d33e11d4065b279637..decc4986f08a2fefc75c69a46f1cadeb053e5001 100644
--- a/ios/chrome/browser/ui/stack_view/card_stack_layout_manager.mm
+++ b/ios/chrome/browser/ui/stack_view/card_stack_layout_manager.mm
@@ -9,9 +9,15 @@
#include "base/logging.h"
#include "ios/chrome/browser/ui/rtl_geometry.h"
+#import "ios/chrome/browser/ui/stack_view/card_view.h"
#import "ios/chrome/browser/ui/stack_view/stack_card.h"
+#import "ios/chrome/browser/ui/stack_view/title_label.h"
#import "ios/chrome/browser/ui/ui_util.h"
+#if !defined(__has_feature) || !__has_feature(objc_arc)
+#error "This file requires ARC support."
+#endif
+
namespace {
// The maximum number of cards that should be staggered at a collapse point.
@@ -34,7 +40,14 @@ const CGFloat kScrollAwayFromNeighborAmount = 200;
} // namespace
-@interface CardStackLayoutManager ()
+@interface CardStackLayoutManager () {
+ NSMutableArray* cards_;
+ // YES if the previous call to one of {|scrollCardAtIndex|,
+ // |handleMultitouchWithFirstDelta|} was to the former method; NO otherwise.
+ BOOL treatOverExtensionAsScroll_;
+ NSUInteger previousFirstPinchCardIndex_;
+ NSUInteger previousSecondPinchCardIndex_;
+}
// Exposes |kMinStackStaggerAmount| for tests.
- (CGFloat)minStackStaggerAmount;
@@ -194,7 +207,7 @@ const CGFloat kScrollAwayFromNeighborAmount = 200;
- (id)init {
if ((self = [super init])) {
- cards_.reset([[NSMutableArray alloc] init]);
+ cards_ = [[NSMutableArray alloc] init];
layoutIsVertical_ = YES;
lastStartStackCardIndex_ = -1;
firstEndStackCardIndex_ = -1;
@@ -247,7 +260,7 @@ const CGFloat kScrollAwayFromNeighborAmount = 200;
NSUInteger i = 0;
CGFloat previousFirstCardOffset = 0;
CGFloat newFirstCardOffset = 0;
- for (StackCard* card in cards_.get()) {
+ for (StackCard* card in cards_) {
CGFloat offset = [self cardOffsetOnLayoutAxis:card];
card.size = cardSize_;
CGFloat newOffset = offset;
@@ -289,7 +302,7 @@ const CGFloat kScrollAwayFromNeighborAmount = 200;
- (void)setLayoutAxisPosition:(CGFloat)position {
layoutAxisPosition_ = position;
- for (StackCard* card in cards_.get()) {
+ for (StackCard* card in cards_) {
LayoutRect layout = card.layout;
if (layoutIsVertical_)
layout.position.leading = position - 0.5 * layout.size.width;
@@ -1128,7 +1141,7 @@ const CGFloat kScrollAwayFromNeighborAmount = 200;
}
- (void)setSynchronizeCardViews:(BOOL)synchronizeViews {
- for (StackCard* card in cards_.get()) {
+ for (StackCard* card in cards_) {
card.synchronizeView = synchronizeViews;
}
}

Powered by Google App Engine
This is Rietveld 408576698