Commit cb1a0b86 authored by Roberto Moura's avatar Roberto Moura Committed by Commit Bot

Rename TabSwitcherLayout -> FlowLayout.

Bug: 1127604
Change-Id: I48460b30fc37119e31f595359e31803d13475f7d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2461736Reviewed-by: default avataredchin <edchin@chromium.org>
Commit-Queue: edchin <edchin@chromium.org>
Auto-Submit: Roberto Moura <mouraroberto@google.com>
Cr-Commit-Position: refs/heads/master@{#815683}
parent 91c40da4
......@@ -14,6 +14,8 @@ source_set("grid_ui_constants") {
source_set("grid_ui") {
sources = [
"flow_layout.h",
"flow_layout.mm",
"grid_cell.h",
"grid_cell.mm",
"grid_commands.h",
......@@ -30,8 +32,6 @@ source_set("grid_ui") {
"grid_view_controller.mm",
"horizontal_layout.h",
"horizontal_layout.mm",
"tab_switcher_layout.h",
"tab_switcher_layout.mm",
]
configs += [ "//build/config/compiler:enable_arc" ]
......
......@@ -2,19 +2,19 @@
// 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_GRID_TAB_SWITCHER_LAYOUT_H_
#define IOS_CHROME_BROWSER_UI_TAB_GRID_GRID_TAB_SWITCHER_LAYOUT_H_
#ifndef IOS_CHROME_BROWSER_UI_TAB_GRID_GRID_FLOW_LAYOUT_H_
#define IOS_CHROME_BROWSER_UI_TAB_GRID_GRID_FLOW_LAYOUT_H_
#import <UIKit/UIKit.h>
// Collection view flow layout that displays items in a grid or horizontally.
// Items are square-ish. Item sizes adapt to the size classes they are shown in.
// Item deletions are animated.
@interface TabSwitcherLayout : UICollectionViewFlowLayout
@interface FlowLayout : UICollectionViewFlowLayout
// Whether to animate item insertions and deletions.
@property(nonatomic, assign) BOOL animatesItemUpdates;
@end
#endif // IOS_CHROME_BROWSER_UI_TAB_GRID_GRID_TAB_SWITCHER_LAYOUT_H_
#endif // IOS_CHROME_BROWSER_UI_TAB_GRID_GRID_FLOW_LAYOUT_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/grid/tab_switcher_layout.h"
#import "ios/chrome/browser/ui/tab_grid/grid/flow_layout.h"
#import "ios/chrome/browser/ui/tab_grid/grid/grid_constants.h"
......@@ -10,12 +10,12 @@
#error "This file requires ARC support."
#endif
@interface TabSwitcherLayout ()
@interface FlowLayout ()
@property(nonatomic, strong) NSArray<NSIndexPath*>* indexPathsOfDeletingItems;
@property(nonatomic, strong) NSArray<NSIndexPath*>* indexPathsOfInsertingItems;
@end
@implementation TabSwitcherLayout
@implementation FlowLayout
- (instancetype)init {
if (self = [super init]) {
......
......@@ -5,10 +5,10 @@
#ifndef IOS_CHROME_BROWSER_UI_TAB_GRID_GRID_GRID_LAYOUT_H_
#define IOS_CHROME_BROWSER_UI_TAB_GRID_GRID_GRID_LAYOUT_H_
#import "ios/chrome/browser/ui/tab_grid/grid/tab_switcher_layout.h"
#import "ios/chrome/browser/ui/tab_grid/grid/flow_layout.h"
// A specialization of TabSwitcherLayout that displays items in a grid.
@interface GridLayout : TabSwitcherLayout
// A specialization of FlowLayout that displays items in a grid.
@interface GridLayout : FlowLayout
@end
// A specialization of GridLayout that shows the UI in its "reordering" state,
......
......@@ -74,7 +74,7 @@ NSIndexPath* CreateIndexPath(NSInteger index) {
// Animator to show or hide the empty state.
@property(nonatomic, strong) UIViewPropertyAnimator* emptyStateAnimator;
// The default layout for the tab switcher.
@property(nonatomic, strong) TabSwitcherLayout* defaultLayout;
@property(nonatomic, strong) FlowLayout* defaultLayout;
// The layout for the tab grid.
@property(nonatomic, strong) GridLayout* gridLayout;
// The layout for the thumb strip.
......@@ -697,7 +697,7 @@ NSIndexPath* CreateIndexPath(NSInteger index) {
- (void)willTransitionToLayout:(LayoutSwitcherState)nextState
completion:
(void (^)(BOOL completed, BOOL finished))completion {
TabSwitcherLayout* nextLayout;
FlowLayout* nextLayout;
switch (nextState) {
case LayoutSwitcherState::Horizontal:
nextLayout = self.horizontalLayout;
......
......@@ -5,10 +5,10 @@
#ifndef IOS_CHROME_BROWSER_UI_TAB_GRID_GRID_HORIZONTAL_LAYOUT_H_
#define IOS_CHROME_BROWSER_UI_TAB_GRID_GRID_HORIZONTAL_LAYOUT_H_
#import "ios/chrome/browser/ui/tab_grid/grid/tab_switcher_layout.h"
#import "ios/chrome/browser/ui/tab_grid/grid/flow_layout.h"
// A specialization of TabSwitcherLayout that displays items horizontally.
@interface HorizontalLayout : TabSwitcherLayout
// A specialization of FlowLayout that displays items horizontally.
@interface HorizontalLayout : FlowLayout
@end
#endif // IOS_CHROME_BROWSER_UI_TAB_GRID_GRID_HORIZONTAL_LAYOUT_H_
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