| OLD | NEW |
| 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/side_swipe/card_side_swipe_view.h" | 5 #import "ios/chrome/browser/ui/side_swipe/card_side_swipe_view.h" |
| 6 | 6 |
| 7 #include <cmath> | 7 #include <cmath> |
| 8 | 8 |
| 9 #include "base/ios/device_util.h" | 9 #include "base/ios/device_util.h" |
| 10 #include "base/metrics/user_metrics.h" | 10 #include "base/metrics/user_metrics.h" |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 160 InstallBackgroundInView(background); | 160 InstallBackgroundInView(background); |
| 161 | 161 |
| 162 rightCard_.reset( | 162 rightCard_.reset( |
| 163 [[SwipeView alloc] initWithFrame:CGRectZero topMargin:topMargin]); | 163 [[SwipeView alloc] initWithFrame:CGRectZero topMargin:topMargin]); |
| 164 leftCard_.reset( | 164 leftCard_.reset( |
| 165 [[SwipeView alloc] initWithFrame:CGRectZero topMargin:topMargin]); | 165 [[SwipeView alloc] initWithFrame:CGRectZero topMargin:topMargin]); |
| 166 [rightCard_ setTranslatesAutoresizingMaskIntoConstraints:NO]; | 166 [rightCard_ setTranslatesAutoresizingMaskIntoConstraints:NO]; |
| 167 [leftCard_ setTranslatesAutoresizingMaskIntoConstraints:NO]; | 167 [leftCard_ setTranslatesAutoresizingMaskIntoConstraints:NO]; |
| 168 [self addSubview:rightCard_]; | 168 [self addSubview:rightCard_]; |
| 169 [self addSubview:leftCard_]; | 169 [self addSubview:leftCard_]; |
| 170 AddSameSizeConstraint(rightCard_, self); | 170 AddSameConstraints(rightCard_, self); |
| 171 AddSameSizeConstraint(leftCard_, self); | 171 AddSameConstraints(leftCard_, self); |
| 172 } | 172 } |
| 173 return self; | 173 return self; |
| 174 } | 174 } |
| 175 | 175 |
| 176 - (CGRect)cardFrame { | 176 - (CGRect)cardFrame { |
| 177 return self.bounds; | 177 return self.bounds; |
| 178 } | 178 } |
| 179 | 179 |
| 180 // Set up left and right card views depending on current tab and swipe | 180 // Set up left and right card views depending on current tab and swipe |
| 181 // direction. | 181 // direction. |
| (...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 389 completion:^(BOOL finished) { | 389 completion:^(BOOL finished) { |
| 390 [leftCard_ setImage:nil]; | 390 [leftCard_ setImage:nil]; |
| 391 [rightCard_ setImage:nil]; | 391 [rightCard_ setImage:nil]; |
| 392 [leftCard_ setToolbarImage:nil isNewTabPage:NO]; | 392 [leftCard_ setToolbarImage:nil isNewTabPage:NO]; |
| 393 [rightCard_ setToolbarImage:nil isNewTabPage:NO]; | 393 [rightCard_ setToolbarImage:nil isNewTabPage:NO]; |
| 394 [delegate_ sideSwipeViewDismissAnimationDidEnd:self]; | 394 [delegate_ sideSwipeViewDismissAnimationDidEnd:self]; |
| 395 }]; | 395 }]; |
| 396 } | 396 } |
| 397 | 397 |
| 398 @end | 398 @end |
| OLD | NEW |