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/tabs/tab_strip_view.h" | 5 #import "ios/chrome/browser/ui/tabs/tab_strip_view.h" |
6 | 6 |
| 7 #if !defined(__has_feature) || !__has_feature(objc_arc) |
| 8 #error "This file requires ARC support." |
| 9 #endif |
| 10 |
7 @implementation TabStripView | 11 @implementation TabStripView |
8 | 12 |
9 @synthesize layoutDelegate = layoutDelegate_; | 13 @synthesize layoutDelegate = layoutDelegate_; |
10 | 14 |
11 - (instancetype)initWithFrame:(CGRect)frame { | 15 - (instancetype)initWithFrame:(CGRect)frame { |
12 if ((self = [super initWithFrame:frame])) { | 16 if ((self = [super initWithFrame:frame])) { |
13 self.showsHorizontalScrollIndicator = NO; | 17 self.showsHorizontalScrollIndicator = NO; |
14 self.showsVerticalScrollIndicator = NO; | 18 self.showsVerticalScrollIndicator = NO; |
15 } | 19 } |
16 return self; | 20 return self; |
17 } | 21 } |
18 | 22 |
19 - (BOOL)touchesShouldCancelInContentView:(UIView*)view { | 23 - (BOOL)touchesShouldCancelInContentView:(UIView*)view { |
20 // The default implementation returns YES for all views except for UIControls. | 24 // The default implementation returns YES for all views except for UIControls. |
21 // Override to return YES for UIControls as well. | 25 // Override to return YES for UIControls as well. |
22 return YES; | 26 return YES; |
23 } | 27 } |
24 | 28 |
25 - (void)layoutSubviews { | 29 - (void)layoutSubviews { |
26 [layoutDelegate_ layoutTabStripSubviews]; | 30 [layoutDelegate_ layoutTabStripSubviews]; |
27 } | 31 } |
28 | 32 |
29 - (void)traitCollectionDidChange:(UITraitCollection*)previousTraitCollection { | 33 - (void)traitCollectionDidChange:(UITraitCollection*)previousTraitCollection { |
30 [super traitCollectionDidChange:previousTraitCollection]; | 34 [super traitCollectionDidChange:previousTraitCollection]; |
31 [layoutDelegate_ traitCollectionDidChange:previousTraitCollection]; | 35 [layoutDelegate_ traitCollectionDidChange:previousTraitCollection]; |
32 } | 36 } |
33 | 37 |
34 @end | 38 @end |
OLD | NEW |