Chromium Code Reviews| Index: ios/clean/chrome/browser/ui/recent_tabs/recent_tabs_coordinator.mm |
| diff --git a/ios/clean/chrome/browser/ui/recent_tabs/recent_tabs_coordinator.mm b/ios/clean/chrome/browser/ui/recent_tabs/recent_tabs_coordinator.mm |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..d02cfc3e2da31347f3c8ef536a50f7c067fa2117 |
| --- /dev/null |
| +++ b/ios/clean/chrome/browser/ui/recent_tabs/recent_tabs_coordinator.mm |
| @@ -0,0 +1,47 @@ |
| +// Copyright 2017 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#import "ios/clean/chrome/browser/ui/recent_tabs/recent_tabs_coordinator.h" |
| + |
| +#import "ios/chrome/browser/ui/ntp/recent_tabs/recent_tabs_panel_controller.h" |
| +#import "ios/chrome/browser/ui/ntp/recent_tabs/recent_tabs_panel_view_controller.h" |
| +#include "ios/chrome/browser/ui/ui_util.h" |
| +#import "ios/shared/chrome/browser/coordinator_context/coordinator_context.h" |
| +#import "ios/shared/chrome/browser/ui/browser_list/browser.h" |
| +#import "ios/shared/chrome/browser/ui/coordinators/browser_coordinator+internal.h" |
| + |
| +#if !defined(__has_feature) || !__has_feature(objc_arc) |
| +#error "This file requires ARC support." |
| +#endif |
| + |
| +@interface OpenTabsCoordinator () |
| +@property(nonatomic, strong) UIViewController* viewController; |
| +@property(nonatomic, strong) RecentTabsPanelController* wrapperController; |
| +@end |
| + |
| +@implementation OpenTabsCoordinator |
| +@synthesize viewController = _viewController; |
| +@synthesize wrapperController = _wrapperController; |
| + |
| +- (void)start { |
| + // HACK: Re-using old view controllers for now. |
| + if (!IsIPadIdiom()) { |
| + self.viewController = [RecentTabsPanelViewController |
| + controllerToPresentForBrowserState:self.browser->browser_state() |
| + loader:nil]; |
| + self.viewController.modalPresentationStyle = UIModalPresentationFormSheet; |
| + self.viewController.modalPresentationCapturesStatusBarAppearance = YES; |
| + [self.context.baseViewController presentViewController:self.viewController |
|
marq (ping after 24h)
2017/04/07 12:25:01
We've gotten rid of context; move this to the pare
justincohen
2017/04/07 15:27:30
Done.
|
| + animated:self.context.animated |
| + completion:nil]; |
| + } else { |
| + self.wrapperController = [[RecentTabsPanelController alloc] |
| + initWithLoader:nil |
| + browserState:self.browser->browser_state()]; |
| + self.viewController = [self.wrapperController viewController]; |
| + } |
| + [super start]; |
| +} |
| + |
| +@end |