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

Side by Side Diff: ios/chrome/browser/ui/tab_switcher/tab_switcher_controller.mm

Issue 2780253003: Release TabBarTransitionContext when no longer required (Closed)
Patch Set: Created 3 years, 8 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/tab_switcher/tab_switcher_controller.h" 5 #import "ios/chrome/browser/ui/tab_switcher/tab_switcher_controller.h"
6 6
7 #include "base/ios/block_types.h" 7 #include "base/ios/block_types.h"
8 #include "base/ios/weak_nsobject.h" 8 #include "base/ios/weak_nsobject.h"
9 #include "base/mac/scoped_nsobject.h" 9 #include "base/mac/scoped_nsobject.h"
10 #include "base/metrics/user_metrics.h" 10 #include "base/metrics/user_metrics.h"
(...skipping 664 matching lines...) Expand 10 before | Expand all | Expand 10 after
675 [toolbarShadowImageView setImage:NativeImage(IDR_IOS_TOOLBAR_SHADOW)]; 675 [toolbarShadowImageView setImage:NativeImage(IDR_IOS_TOOLBAR_SHADOW)];
676 [placeholderView addSubview:toolbarShadowImageView]; 676 [placeholderView addSubview:toolbarShadowImageView];
677 677
678 [self.view addSubview:placeholderView]; 678 [self.view addSubview:placeholderView];
679 679
680 [selectedCell setHidden:YES]; 680 [selectedCell setHidden:YES];
681 toolbarScreenshotImageView.alpha = 681 toolbarScreenshotImageView.alpha =
682 (transitionType == TransitionType::TRANSITION_DISMISS) ? 0 : 1.0; 682 (transitionType == TransitionType::TRANSITION_DISMISS) ? 0 : 1.0;
683 683
684 base::WeakNSObject<TabSwitcherController> weakSelf(self); 684 base::WeakNSObject<TabSwitcherController> weakSelf(self);
685 void (^completionBlock)(BOOL) = ^(BOOL) { 685 void (^completionBlock)(BOOL) = ^(BOOL finished) {
686 base::scoped_nsobject<TabSwitcherController> strongSelf([weakSelf retain]); 686 base::scoped_nsobject<TabSwitcherController> strongSelf([weakSelf retain]);
687 687
688 [tabStripPlaceholderView removeFromSuperview]; 688 [tabStripPlaceholderView removeFromSuperview];
689 [toolbarScreenshotImageView removeFromSuperview]; 689 [toolbarScreenshotImageView removeFromSuperview];
690 [selectedCell setHidden:NO]; 690 [selectedCell setHidden:NO];
691 [placeholderView removeFromSuperview]; 691 [placeholderView removeFromSuperview];
692 692
693 if (transitionType == TransitionType::TRANSITION_DISMISS) 693 if (transitionType == TransitionType::TRANSITION_DISMISS) {
694 [strongSelf restoreWindowBackgroundColor]; 694 [strongSelf restoreWindowBackgroundColor];
695 if (finished) {
696 [strongSelf setTransitionContext:nil];
697 }
698 }
695 [[[strongSelf delegate] tabSwitcherTransitionToolbarOwner] 699 [[[strongSelf delegate] tabSwitcherTransitionToolbarOwner]
696 reparentToolbarController]; 700 reparentToolbarController];
697 [[strongSelf view] setUserInteractionEnabled:YES]; 701 [[strongSelf view] setUserInteractionEnabled:YES];
698 completion(); 702 completion();
699 }; 703 };
700 704
701 ProceduralBlock animationBlock = ^{ 705 ProceduralBlock animationBlock = ^{
702 toolbarScreenshotImageView.alpha = 706 toolbarScreenshotImageView.alpha =
703 transitionType == TransitionType::TRANSITION_DISMISS ? 1.0 : 0; 707 transitionType == TransitionType::TRANSITION_DISMISS ? 1.0 : 0;
704 tabStripPlaceholderView.frame = tabStripFinalFrame; 708 tabStripPlaceholderView.frame = tabStripFinalFrame;
(...skipping 531 matching lines...) Expand 10 before | Expand all | Expand 10 after
1236 base::UserMetricsAction("MobileTabSwitcherCloseNonIncognitoTab")); 1240 base::UserMetricsAction("MobileTabSwitcherCloseNonIncognitoTab"));
1237 } 1241 }
1238 } 1242 }
1239 1243
1240 - (void)tabSwitcherPanelControllerDidUpdateOverlayViewVisibility: 1244 - (void)tabSwitcherPanelControllerDidUpdateOverlayViewVisibility:
1241 (TabSwitcherPanelController*)tabSwitcherPanelController { 1245 (TabSwitcherPanelController*)tabSwitcherPanelController {
1242 [_tabSwitcherView updateOverlayButtonState]; 1246 [_tabSwitcherView updateOverlayButtonState];
1243 } 1247 }
1244 1248
1245 @end 1249 @end
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698