Commit f28594e3 authored by Gauthier Ambard's avatar Gauthier Ambard Committed by Commit Bot

[iOS] Rename TabGrid transition classes to Legacy

This CL renames the classes that are only used when the BVC is being
presented by the TabGrid to Legacy to prepare for the BVC to be
contained.

Bug: 1038034
Change-Id: Ib0ead44eea36646840057709b237381fa70ca561
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2050371
Commit-Queue: Gauthier Ambard <gambard@chromium.org>
Reviewed-by: default avatarMark Cogan <marq@chromium.org>
Cr-Commit-Position: refs/heads/master@{#740333}
parent c58a3126
......@@ -63,6 +63,8 @@ source_set("tab_grid_ui_constants") {
source_set("tab_grid_ui") {
sources = [
"legacy_tab_grid_transition_handler.h",
"legacy_tab_grid_transition_handler.mm",
"tab_grid_bottom_toolbar.h",
"tab_grid_bottom_toolbar.mm",
"tab_grid_empty_state_view.h",
......@@ -74,8 +76,6 @@ source_set("tab_grid_ui") {
"tab_grid_paging.h",
"tab_grid_top_toolbar.h",
"tab_grid_top_toolbar.mm",
"tab_grid_transition_handler.h",
"tab_grid_transition_handler.mm",
"tab_grid_view_controller.h",
"tab_grid_view_controller.mm",
]
......
......@@ -2,18 +2,18 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef IOS_CHROME_BROWSER_UI_TAB_GRID_TAB_GRID_TRANSITION_HANDLER_H_
#define IOS_CHROME_BROWSER_UI_TAB_GRID_TAB_GRID_TRANSITION_HANDLER_H_
#ifndef IOS_CHROME_BROWSER_UI_TAB_GRID_LEGACY_TAB_GRID_TRANSITION_HANDLER_H_
#define IOS_CHROME_BROWSER_UI_TAB_GRID_LEGACY_TAB_GRID_TRANSITION_HANDLER_H_
#import <UIKit/UIKit.h>
@protocol GridTransitionAnimationLayoutProviding;
@interface TabGridTransitionHandler
: NSObject<UIViewControllerTransitioningDelegate>
@interface LegacyTabGridTransitionHandler
: NSObject <UIViewControllerTransitioningDelegate>
@property(nonatomic, weak) id<GridTransitionAnimationLayoutProviding> provider;
@end
#endif // IOS_CHROME_BROWSER_UI_TAB_GRID_TAB_GRID_TRANSITION_HANDLER_H_
#endif // IOS_CHROME_BROWSER_UI_TAB_GRID_LEGACY_TAB_GRID_TRANSITION_HANDLER_H_
......@@ -2,28 +2,28 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#import "ios/chrome/browser/ui/tab_grid/tab_grid_transition_handler.h"
#import "ios/chrome/browser/ui/tab_grid/legacy_tab_grid_transition_handler.h"
#import "ios/chrome/browser/ui/tab_grid/transitions/grid_to_visible_tab_animator.h"
#import "ios/chrome/browser/ui/tab_grid/transitions/grid_transition_animation_layout_providing.h"
#import "ios/chrome/browser/ui/tab_grid/transitions/legacy_grid_to_visible_tab_animator.h"
#import "ios/chrome/browser/ui/tab_grid/transitions/legacy_tab_to_grid_animator.h"
#import "ios/chrome/browser/ui/tab_grid/transitions/reduced_motion_animator.h"
#import "ios/chrome/browser/ui/tab_grid/transitions/tab_to_grid_animator.h"
#if !defined(__has_feature) || !__has_feature(objc_arc)
#error "This file requires ARC support."
#endif
@implementation TabGridTransitionHandler
@implementation LegacyTabGridTransitionHandler
#pragma mark - UIViewControllerTransitioningDelegate
- (id<UIViewControllerAnimatedTransitioning>)
animationControllerForPresentedController:(UIViewController*)presented
presentingController:(UIViewController*)presenting
sourceController:(UIViewController*)source {
animationControllerForPresentedController:(UIViewController*)presented
presentingController:(UIViewController*)presenting
sourceController:(UIViewController*)source {
if (!UIAccessibilityIsReduceMotionEnabled() &&
self.provider.selectedCellVisible) {
return [[GridToVisibleTabAnimator alloc]
return [[LegacyGridToVisibleTabAnimator alloc]
initWithAnimationLayoutProvider:self.provider];
}
ReducedMotionAnimator* simpleAnimator = [[ReducedMotionAnimator alloc] init];
......@@ -32,9 +32,9 @@ animationControllerForPresentedController:(UIViewController*)presented
}
- (id<UIViewControllerAnimatedTransitioning>)
animationControllerForDismissedController:(UIViewController*)dismissed {
animationControllerForDismissedController:(UIViewController*)dismissed {
if (!UIAccessibilityIsReduceMotionEnabled()) {
return [[TabToGridAnimator alloc]
return [[LegacyTabToGridAnimator alloc]
initWithAnimationLayoutProvider:self.provider];
}
ReducedMotionAnimator* simpleAnimator = [[ReducedMotionAnimator alloc] init];
......
......@@ -21,10 +21,10 @@
#import "ios/chrome/browser/ui/recent_tabs/recent_tabs_mediator.h"
#import "ios/chrome/browser/ui/recent_tabs/recent_tabs_presentation_delegate.h"
#import "ios/chrome/browser/ui/recent_tabs/recent_tabs_table_view_controller.h"
#import "ios/chrome/browser/ui/tab_grid/legacy_tab_grid_transition_handler.h"
#import "ios/chrome/browser/ui/tab_grid/tab_grid_adaptor.h"
#import "ios/chrome/browser/ui/tab_grid/tab_grid_mediator.h"
#import "ios/chrome/browser/ui/tab_grid/tab_grid_paging.h"
#import "ios/chrome/browser/ui/tab_grid/tab_grid_transition_handler.h"
#import "ios/chrome/browser/ui/tab_grid/tab_grid_view_controller.h"
#include "ios/chrome/browser/ui/ui_feature_flags.h"
#import "ios/chrome/browser/url_loading/url_loading_params.h"
......@@ -51,7 +51,7 @@
// controller will present this.
@property(nonatomic, strong) BVCContainerViewController* bvcContainer;
// Transitioning delegate for the view controller.
@property(nonatomic, strong) TabGridTransitionHandler* transitionHandler;
@property(nonatomic, strong) LegacyTabGridTransitionHandler* transitionHandler;
// Mediator for regular Tabs.
@property(nonatomic, strong) TabGridMediator* regularTabsMediator;
// Mediator for incognito Tabs.
......@@ -144,7 +144,7 @@
[[TabGridViewController alloc] init];
baseViewController.dispatcher =
static_cast<id<ApplicationCommands>>(self.dispatcher);
self.transitionHandler = [[TabGridTransitionHandler alloc] init];
self.transitionHandler = [[LegacyTabGridTransitionHandler alloc] init];
self.transitionHandler.provider = baseViewController;
baseViewController.modalPresentationStyle = UIModalPresentationCustom;
baseViewController.transitioningDelegate = self.transitionHandler;
......
......@@ -7,17 +7,17 @@ import("//ios/public/provider/chrome/browser/build_config.gni")
source_set("transitions") {
sources = [
"grid_to_tab_transition_view.h",
"grid_to_visible_tab_animator.h",
"grid_to_visible_tab_animator.mm",
"grid_transition_animation.h",
"grid_transition_animation.mm",
"grid_transition_animation_layout_providing.h",
"grid_transition_layout.h",
"grid_transition_layout.mm",
"legacy_grid_to_visible_tab_animator.h",
"legacy_grid_to_visible_tab_animator.mm",
"legacy_tab_to_grid_animator.h",
"legacy_tab_to_grid_animator.mm",
"reduced_motion_animator.h",
"reduced_motion_animator.mm",
"tab_to_grid_animator.h",
"tab_to_grid_animator.mm",
]
configs += [ "//build/config/compiler:enable_arc" ]
......
......@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef IOS_CHROME_BROWSER_UI_TAB_GRID_TRANSITIONS_GRID_TO_VISIBLE_TAB_ANIMATOR_H_
#define IOS_CHROME_BROWSER_UI_TAB_GRID_TRANSITIONS_GRID_TO_VISIBLE_TAB_ANIMATOR_H_
#ifndef IOS_CHROME_BROWSER_UI_TAB_GRID_TRANSITIONS_LEGACY_GRID_TO_VISIBLE_TAB_ANIMATOR_H_
#define IOS_CHROME_BROWSER_UI_TAB_GRID_TRANSITIONS_LEGACY_GRID_TO_VISIBLE_TAB_ANIMATOR_H_
#import <UIKit/UIKit.h>
......@@ -11,8 +11,8 @@
// Animator object for transitioning from a collection view of square-ish items
// (the "grid") into a fullscreen view controller (the "tab").
@interface GridToVisibleTabAnimator
: NSObject<UIViewControllerAnimatedTransitioning>
@interface LegacyGridToVisibleTabAnimator
: NSObject <UIViewControllerAnimatedTransitioning>
// Initialize an animator object with |animationLayoutProvider| to provide
// layout information for the transition.
......@@ -21,4 +21,4 @@
@end
#endif // IOS_CHROME_BROWSER_UI_TAB_GRID_TRANSITIONS_GRID_TO_VISIBLE_TAB_ANIMATOR_H_
#endif // IOS_CHROME_BROWSER_UI_TAB_GRID_TRANSITIONS_LEGACY_GRID_TO_VISIBLE_TAB_ANIMATOR_H_
......@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#import "ios/chrome/browser/ui/tab_grid/transitions/grid_to_visible_tab_animator.h"
#import "ios/chrome/browser/ui/tab_grid/transitions/legacy_grid_to_visible_tab_animator.h"
#include "ios/chrome/browser/crash_report/breakpad_helper.h"
#import "ios/chrome/browser/ui/tab_grid/transitions/grid_transition_animation.h"
......@@ -16,7 +16,7 @@
#error "This file requires ARC support."
#endif
@interface GridToVisibleTabAnimator ()
@interface LegacyGridToVisibleTabAnimator ()
@property(nonatomic, weak) id<GridTransitionAnimationLayoutProviding>
animationLayoutProvider;
// Animation object for this transition.
......@@ -26,7 +26,7 @@
transitionContext;
@end
@implementation GridToVisibleTabAnimator
@implementation LegacyGridToVisibleTabAnimator
- (instancetype)initWithAnimationLayoutProvider:
(id<GridTransitionAnimationLayoutProviding>)animationLayoutProvider {
......@@ -80,9 +80,9 @@
// view.
// TODO(crbug.com/860234) Clean up this arrangement.
UIView* viewWithNamedGuides = presentedView.subviews[0];
CGRect finalRect =
[NamedGuide guideWithName:kContentAreaGuide view:viewWithNamedGuides]
.layoutFrame;
CGRect finalRect = [NamedGuide guideWithName:kContentAreaGuide
view:viewWithNamedGuides]
.layoutFrame;
[layout.activeItem populateWithSnapshotsFromView:viewWithNamedGuides
middleRect:finalRect];
......@@ -125,7 +125,7 @@
- (void)gridTransitionAnimationDidFinish:(BOOL)finished {
// Clean up the animation. First the active cell, then the animation itself.
// These views will not be re-used, so there's no need to reparent the
// These views will not be re-used, so there's no need to reparent the
// active cell view.
[self.animation.activeCell removeFromSuperview];
[self.animation removeFromSuperview];
......
......@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef IOS_CHROME_BROWSER_UI_TAB_GRID_TRANSITIONS_TAB_TO_GRID_ANIMATOR_H_
#define IOS_CHROME_BROWSER_UI_TAB_GRID_TRANSITIONS_TAB_TO_GRID_ANIMATOR_H_
#ifndef IOS_CHROME_BROWSER_UI_TAB_GRID_TRANSITIONS_LEGACY_TAB_TO_GRID_ANIMATOR_H_
#define IOS_CHROME_BROWSER_UI_TAB_GRID_TRANSITIONS_LEGACY_TAB_TO_GRID_ANIMATOR_H_
#import <UIKit/UIKit.h>
......@@ -11,7 +11,8 @@
// Animator object for transitioning from a fullscreen view controller (the
// "tab") into a collection view of square-ish items (the "grid").
@interface TabToGridAnimator : NSObject<UIViewControllerAnimatedTransitioning>
@interface LegacyTabToGridAnimator
: NSObject <UIViewControllerAnimatedTransitioning>
// Initialize an animator object with |animationLayoutProvider| to provide
// layout information for the transition.
......@@ -20,4 +21,4 @@
@end
#endif // IOS_CHROME_BROWSER_UI_TAB_GRID_TRANSITIONS_TAB_TO_GRID_ANIMATOR_H_
#endif // IOS_CHROME_BROWSER_UI_TAB_GRID_TRANSITIONS_LEGACY_TAB_TO_GRID_ANIMATOR_H_
......@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#import "ios/chrome/browser/ui/tab_grid/transitions/tab_to_grid_animator.h"
#import "ios/chrome/browser/ui/tab_grid/transitions/legacy_tab_to_grid_animator.h"
#import "ios/chrome/browser/ui/tab_grid/transitions/grid_transition_animation.h"
#import "ios/chrome/browser/ui/tab_grid/transitions/grid_transition_animation_layout_providing.h"
......@@ -15,7 +15,7 @@
#error "This file requires ARC support."
#endif
@interface TabToGridAnimator ()
@interface LegacyTabToGridAnimator ()
@property(nonatomic, weak) id<GridTransitionAnimationLayoutProviding>
animationLayoutProvider;
// Animation object for this transition.
......@@ -25,7 +25,7 @@
transitionContext;
@end
@implementation TabToGridAnimator
@implementation LegacyTabToGridAnimator
- (instancetype)initWithAnimationLayoutProvider:
(id<GridTransitionAnimationLayoutProviding>)animationLayoutProvider {
......@@ -86,9 +86,9 @@
// view.
// TODO(crbug.com/860234) Clean up this arrangement.
UIView* viewWithNamedGuides = dismissingView.subviews[0];
CGRect initialRect =
[NamedGuide guideWithName:kContentAreaGuide view:viewWithNamedGuides]
.layoutFrame;
CGRect initialRect = [NamedGuide guideWithName:kContentAreaGuide
view:viewWithNamedGuides]
.layoutFrame;
[layout.activeItem populateWithSnapshotsFromView:viewWithNamedGuides
middleRect:initialRect];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment