Chromium Code Reviews| Index: ios/clean/chrome/browser/ui/tab/tab_coordinator.mm |
| diff --git a/ios/clean/chrome/browser/ui/tab/tab_coordinator.mm b/ios/clean/chrome/browser/ui/tab/tab_coordinator.mm |
| index f3fa64965c2fabeb23e1592f95f3bf0fe2c2ffcb..3e26b6a82a89558bff0669512e211077225f4763 100644 |
| --- a/ios/clean/chrome/browser/ui/tab/tab_coordinator.mm |
| +++ b/ios/clean/chrome/browser/ui/tab/tab_coordinator.mm |
| @@ -27,12 +27,6 @@ |
| #error "This file requires ARC support." |
| #endif |
| -namespace { |
| -// Placeholder "experiment" flag. Change this to YES to have the toolbar at the |
| -// bottom. |
| -const BOOL kUseBottomToolbar = NO; |
| -} // namespace |
| - |
| @interface TabCoordinator ()<CRWWebStateObserver, |
| TabCommands, |
| UIViewControllerTransitioningDelegate> |
| @@ -99,6 +93,9 @@ const BOOL kUseBottomToolbar = NO; |
| - (void)stop { |
| [super stop]; |
| + for (BrowserCoordinator* child in self.children) { |
| + [self removeChildCoordinator:child]; |
|
lpromero
2017/04/21 08:08:34
This is necessary to balance the addChildCoordinat
marq (ping after 24h)
2017/04/21 08:26:32
This goes away with crrev.com/2832473003, right?
lpromero
2017/04/21 09:00:26
In tests, this coordinator is never removed (becau
lpromero
2017/04/26 17:59:19
Kindly ping
lpromero
2017/05/03 09:15:39
Ping :)
|
| + } |
| _webStateObserver.reset(); |
| [self.browser->dispatcher() stopDispatchingToTarget:self]; |
| } |
| @@ -133,11 +130,18 @@ const BOOL kUseBottomToolbar = NO; |
| #pragma mark - Experiment support |
| -// Create and return a new view controller for use as a tab container; |
| +- (BOOL)usesBottomToolbar { |
| + NSUserDefaults* defaults = [NSUserDefaults standardUserDefaults]; |
| + NSString* bottomToolbarPreference = |
| + [defaults stringForKey:@"EnableBottomToolbar"]; |
| + return [bottomToolbarPreference isEqualToString:@"Enabled"]; |
| +} |
| + |
| +// Creates and returns a new view controller for use as a tab container; |
| // experimental configurations determine which subclass of |
| // TabContainerViewController to return. |
| - (TabContainerViewController*)newTabContainer { |
| - if (kUseBottomToolbar) { |
| + if ([self usesBottomToolbar]) { |
| return [[BottomToolbarTabViewController alloc] init]; |
| } |
| return [[TopToolbarTabViewController alloc] init]; |