Chromium Code Reviews| Index: ios/clean/chrome/browser/ui/bookmarks/bookmarks_coordinator.mm |
| diff --git a/ios/clean/chrome/browser/ui/bookmarks/bookmarks_coordinator.mm b/ios/clean/chrome/browser/ui/bookmarks/bookmarks_coordinator.mm |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..723c24b5b9384297340bf9c943917198568099b6 |
| --- /dev/null |
| +++ b/ios/clean/chrome/browser/ui/bookmarks/bookmarks_coordinator.mm |
| @@ -0,0 +1,52 @@ |
| +// 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/bookmarks/bookmarks_coordinator.h" |
| + |
| +#import "ios/chrome/browser/ui/bookmarks/bookmark_controller_factory.h" |
| +#import "ios/chrome/browser/ui/bookmarks/bookmark_home_handset_view_controller.h" |
| +#import "ios/chrome/browser/ui/bookmarks/bookmark_home_tablet_ntp_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 BookmarksCoordinator () |
| +@property(nonatomic, strong) UIViewController* viewController; |
|
marq (ping after 24h)
2017/04/05 12:22:48
The base class already has this as a property. Nor
justincohen
2017/04/05 19:28:23
The base class is read only?
|
| +@property(nonatomic, strong) |
| + BookmarkHomeTabletNTPController* wrapperViewController; |
|
marq (ping after 24h)
2017/04/05 12:22:48
Comment for this property.
justincohen
2017/04/05 19:28:23
Done.
|
| +@end |
| + |
| +@implementation BookmarksCoordinator |
| +@synthesize viewController = _viewController; |
| +@synthesize wrapperViewController = _wrapperViewController; |
| + |
| +- (void)start { |
| + // PLACEHOLDER: Re-using old view controllers for now. |
|
marq (ping after 24h)
2017/04/05 12:22:48
More of a HACK:
(placeholder is a throw-away impl
justincohen
2017/04/05 19:28:23
Done.
|
| + if (!IsIPadIdiom()) { |
| + self.viewController = [[BookmarkHomeHandsetViewController alloc] |
| + initWithLoader:nil |
| + browserState:self.browser->browser_state()]; |
| + self.viewController.modalPresentationStyle = UIModalPresentationFormSheet; |
| + [self.context.baseViewController presentViewController:self.viewController |
|
marq (ping after 24h)
2017/04/05 12:22:48
I think our preferred technique is for the parent
justincohen
2017/04/05 19:28:23
Done.
|
| + animated:self.context.animated |
| + completion:nil]; |
| + } else { |
| + BookmarkControllerFactory* factory = |
| + [[BookmarkControllerFactory alloc] init]; |
| + self.wrapperViewController = [factory |
| + bookmarkPanelControllerForBrowserState:self.browser->browser_state() |
| + loader:nil |
| + colorCache:nil]; |
| + self.viewController = [[UIViewController alloc] init]; |
|
marq (ping after 24h)
2017/04/05 12:22:47
Does this ever get presented or added anywhere?
justincohen
2017/04/05 19:28:23
Yes, it gets added in the NTP iPad scroll view.
|
| + self.viewController.view = [self.wrapperViewController view]; |
| + } |
| + [super start]; |
| +} |
| + |
| +@end |