Chromium Code Reviews| 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_controller.h" | 5 #import "ios/chrome/browser/ui/tabs/tab_strip_controller.h" |
| 6 #import "ios/chrome/browser/ui/tabs/tab_strip_controller_private.h" | 6 #import "ios/chrome/browser/ui/tabs/tab_strip_controller_private.h" |
| 7 | 7 |
| 8 #include <cmath> | 8 #include <cmath> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 115 } | 115 } |
| 116 | 116 |
| 117 @interface TabStripController ()<TabModelObserver, | 117 @interface TabStripController ()<TabModelObserver, |
| 118 TabStripViewLayoutDelegate, | 118 TabStripViewLayoutDelegate, |
| 119 UIGestureRecognizerDelegate, | 119 UIGestureRecognizerDelegate, |
| 120 UIScrollViewDelegate> { | 120 UIScrollViewDelegate> { |
| 121 base::scoped_nsobject<TabModel> _tabModel; | 121 base::scoped_nsobject<TabModel> _tabModel; |
| 122 UIView* _view; | 122 UIView* _view; |
| 123 TabStripView* _tabStripView; | 123 TabStripView* _tabStripView; |
| 124 UIButton* _buttonNewTab; | 124 UIButton* _buttonNewTab; |
| 125 // TODO(crbug.com/687132): Remove toggle button. | |
| 125 UIButton* _modeToggleButton; // weak, nil if not visible. | 126 UIButton* _modeToggleButton; // weak, nil if not visible. |
| 126 UIButton* _tabSwitcherToggleButton; // weak, nil if not visible. | 127 UIButton* _tabSwitcherToggleButton; // weak, nil if not visible. |
| 127 | 128 |
| 128 // Background view of the toggle button. Only visible while in compact layout. | 129 // Background view of the toggle button. Only visible while in compact layout. |
| 129 base::scoped_nsobject<UIImageView> _toggleButtonBackgroundView; | 130 base::scoped_nsobject<UIImageView> _toggleButtonBackgroundView; |
| 130 | 131 |
| 131 TabStrip::Style _style; | 132 TabStrip::Style _style; |
| 132 base::WeakNSProtocol<id<FullScreenControllerDelegate>> _fullscreenDelegate; | 133 base::WeakNSProtocol<id<FullScreenControllerDelegate>> _fullscreenDelegate; |
| 133 | 134 |
| 134 // Array of TabViews. There is a one-to-one correspondence between this array | 135 // Array of TabViews. There is a one-to-one correspondence between this array |
| (...skipping 949 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1084 _modeToggleButton = [UIButton buttonWithType:UIButtonTypeCustom]; | 1085 _modeToggleButton = [UIButton buttonWithType:UIButtonTypeCustom]; |
| 1085 _modeToggleButton.frame = buttonFrame; | 1086 _modeToggleButton.frame = buttonFrame; |
| 1086 [_modeToggleButton setImageEdgeInsets:UIEdgeInsetsMake(7, 5, 7, 5)]; | 1087 [_modeToggleButton setImageEdgeInsets:UIEdgeInsetsMake(7, 5, 7, 5)]; |
| 1087 _modeToggleButton.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin; | 1088 _modeToggleButton.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin; |
| 1088 _modeToggleButton.backgroundColor = [UIColor clearColor]; | 1089 _modeToggleButton.backgroundColor = [UIColor clearColor]; |
| 1089 [_modeToggleButton setImage:toggleIcon forState:UIControlStateNormal]; | 1090 [_modeToggleButton setImage:toggleIcon forState:UIControlStateNormal]; |
| 1090 // Set target/action to bubble up with command id as tag. | 1091 // Set target/action to bubble up with command id as tag. |
| 1091 [_modeToggleButton addTarget:nil | 1092 [_modeToggleButton addTarget:nil |
| 1092 action:@selector(chromeExecuteCommand:) | 1093 action:@selector(chromeExecuteCommand:) |
| 1093 forControlEvents:UIControlEventTouchUpInside]; | 1094 forControlEvents:UIControlEventTouchUpInside]; |
| 1094 [_modeToggleButton setTag:IDC_SWITCH_BROWSER_MODES]; | |
|
rohitrao (ping after 24h)
2017/02/01 18:34:34
Can this constant can be deleted from ios/chrome/b
jif
2017/02/03 12:55:51
It's still used in the tab_strip_controller, so I'
| |
| 1095 [_modeToggleButton addTarget:self | 1095 [_modeToggleButton addTarget:self |
| 1096 action:@selector(recordUserMetrics:) | 1096 action:@selector(recordUserMetrics:) |
| 1097 forControlEvents:UIControlEventTouchUpInside]; | 1097 forControlEvents:UIControlEventTouchUpInside]; |
| 1098 | 1098 |
| 1099 SetA11yLabelAndUiAutomationName(_modeToggleButton, | 1099 SetA11yLabelAndUiAutomationName(_modeToggleButton, |
| 1100 toggleIdsAccessibilityLabel, | 1100 toggleIdsAccessibilityLabel, |
| 1101 toggleEnglishUiAutomationName); | 1101 toggleEnglishUiAutomationName); |
| 1102 [_view addSubview:_modeToggleButton]; | 1102 [_view addSubview:_modeToggleButton]; |
| 1103 // Shrink the scroll view. | 1103 // Shrink the scroll view. |
| 1104 [self updateScrollViewFrameForToggleButton]; | 1104 [self updateScrollViewFrameForToggleButton]; |
| (...skipping 617 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1722 | 1722 |
| 1723 @implementation TabStripController (Testing) | 1723 @implementation TabStripController (Testing) |
| 1724 | 1724 |
| 1725 - (TabView*)existingTabViewForTab:(Tab*)tab { | 1725 - (TabView*)existingTabViewForTab:(Tab*)tab { |
| 1726 NSUInteger tabIndex = [_tabModel indexOfTab:tab]; | 1726 NSUInteger tabIndex = [_tabModel indexOfTab:tab]; |
| 1727 NSUInteger tabViewIndex = [self indexForModelIndex:tabIndex]; | 1727 NSUInteger tabViewIndex = [self indexForModelIndex:tabIndex]; |
| 1728 return [_tabArray objectAtIndex:tabViewIndex]; | 1728 return [_tabArray objectAtIndex:tabViewIndex]; |
| 1729 } | 1729 } |
| 1730 | 1730 |
| 1731 @end | 1731 @end |
| OLD | NEW |