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

Side by Side Diff: ios/clean/chrome/browser/ui/tab_strip/tab_strip_view_controller.mm

Issue 2786893002: [ios] Dispatcher for tab_strip and tab_grid. (Closed)
Patch Set: Update showcase. 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
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 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/clean/chrome/browser/ui/tab_strip/tab_strip_view_controller.h" 5 #import "ios/clean/chrome/browser/ui/tab_strip/tab_strip_view_controller.h"
6 6
7 #import "ios/clean/chrome/browser/ui/commands/tab_strip_commands.h"
8
7 #if !defined(__has_feature) || !__has_feature(objc_arc) 9 #if !defined(__has_feature) || !__has_feature(objc_arc)
8 #error "This file requires ARC support." 10 #error "This file requires ARC support."
9 #endif 11 #endif
10 12
11 namespace { 13 namespace {
12 CGFloat kItemLength = 100.0f; 14 CGFloat kItemLength = 100.0f;
13 CGFloat kSpacing = 10.0f; 15 CGFloat kSpacing = 10.0f;
14 } 16 }
15 17
16 @implementation TabStripViewController 18 @implementation TabStripViewController
19 @synthesize dispatcher = _dispatcher;
17 20
18 - (UICollectionViewLayout*)collectionViewLayout { 21 - (UICollectionViewLayout*)collectionViewLayout {
19 UICollectionViewFlowLayout* layout = 22 UICollectionViewFlowLayout* layout =
20 [[UICollectionViewFlowLayout alloc] init]; 23 [[UICollectionViewFlowLayout alloc] init];
21 layout.itemSize = CGSizeMake(kItemLength, kItemLength); 24 layout.itemSize = CGSizeMake(kItemLength, kItemLength);
22 layout.minimumInteritemSpacing = kSpacing; 25 layout.minimumInteritemSpacing = kSpacing;
23 layout.sectionInset = 26 layout.sectionInset =
24 UIEdgeInsetsMake(kSpacing, kSpacing, kSpacing, kSpacing); 27 UIEdgeInsetsMake(kSpacing, kSpacing, kSpacing, kSpacing);
25 layout.scrollDirection = UICollectionViewScrollDirectionHorizontal; 28 layout.scrollDirection = UICollectionViewScrollDirectionHorizontal;
26 return layout; 29 return layout;
27 } 30 }
28 31
32 - (void)showTabAtIndex:(int)index {
33 [self.dispatcher showTabStripTabAtIndex:index];
34 }
35
36 - (void)closeTabAtIndex:(int)index {
37 [self.dispatcher closeTabStripTabAtIndex:index];
38 }
39
29 @end 40 @end
OLDNEW
« no previous file with comments | « ios/clean/chrome/browser/ui/tab_strip/tab_strip_view_controller.h ('k') | ios/showcase/tab_grid/sc_tab_grid_coordinator.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698