OLD | NEW |
(Empty) | |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #import "ios/clean/chrome/browser/ui/bookmarks/bookmarks_coordinator.h" |
| 6 |
| 7 #import "ios/chrome/browser/ui/bookmarks/bookmark_controller_factory.h" |
| 8 #import "ios/chrome/browser/ui/bookmarks/bookmark_home_handset_view_controller.h
" |
| 9 #import "ios/chrome/browser/ui/bookmarks/bookmark_home_tablet_ntp_controller.h" |
| 10 #include "ios/chrome/browser/ui/ui_util.h" |
| 11 #import "ios/shared/chrome/browser/ui/browser_list/browser.h" |
| 12 #import "ios/shared/chrome/browser/ui/coordinators/browser_coordinator+internal.
h" |
| 13 |
| 14 #if !defined(__has_feature) || !__has_feature(objc_arc) |
| 15 #error "This file requires ARC support." |
| 16 #endif |
| 17 |
| 18 @interface BookmarksCoordinator () |
| 19 @property(nonatomic, strong) UIViewController* viewController; |
| 20 @property(nonatomic, strong) BookmarkHomeTabletNTPController* wrapperController; |
| 21 @end |
| 22 |
| 23 @implementation BookmarksCoordinator |
| 24 @synthesize viewController = _viewController; |
| 25 @synthesize wrapperController = _wrapperController; |
| 26 |
| 27 - (void)start { |
| 28 // HACK: Re-using old view controllers for now. |
| 29 if (!IsIPadIdiom()) { |
| 30 self.viewController = [[BookmarkHomeHandsetViewController alloc] |
| 31 initWithLoader:nil |
| 32 browserState:self.browser->browser_state()]; |
| 33 self.viewController.modalPresentationStyle = UIModalPresentationFormSheet; |
| 34 } else { |
| 35 BookmarkControllerFactory* factory = |
| 36 [[BookmarkControllerFactory alloc] init]; |
| 37 self.wrapperController = [factory |
| 38 bookmarkPanelControllerForBrowserState:self.browser->browser_state() |
| 39 loader:nil |
| 40 colorCache:nil]; |
| 41 self.viewController = [[UIViewController alloc] init]; |
| 42 self.viewController.view = [self.wrapperController view]; |
| 43 } |
| 44 [super start]; |
| 45 } |
| 46 |
| 47 @end |
OLD | NEW |