Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(260)

Unified Diff: ios/clean/chrome/browser/ui/bookmarks/bookmarks_coordinator.mm

Issue 2785893003: [ios clean] Add placeholder for NTP bookmarks, chrome home and open tabs. (Closed)
Patch Set: Address various comments Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..11825893c8929183f9fff323665943a4b998f833
--- /dev/null
+++ b/ios/clean/chrome/browser/ui/bookmarks/bookmarks_coordinator.mm
@@ -0,0 +1,49 @@
+// 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;
+@property(nonatomic, strong)
+ BookmarkHomeTabletNTPController* wrapperViewController;
lpromero 2017/04/06 13:01:04 This class is not a view controller. Consider rena
justincohen 2017/04/06 18:25:09 Done, here and everywhere.
+@end
+
+@implementation BookmarksCoordinator
+@synthesize viewController = _viewController;
+@synthesize wrapperViewController = _wrapperViewController;
+
+- (void)start {
+ // HACK: Re-using old view controllers for now.
+ if (!IsIPadIdiom()) {
+ self.viewController = [[BookmarkHomeHandsetViewController alloc]
+ initWithLoader:nil
+ browserState:self.browser->browser_state()];
+ self.viewController.modalPresentationStyle = UIModalPresentationFormSheet;
+ } else {
+ BookmarkControllerFactory* factory =
+ [[BookmarkControllerFactory alloc] init];
+ self.wrapperViewController = [factory
+ bookmarkPanelControllerForBrowserState:self.browser->browser_state()
+ loader:nil
+ colorCache:nil];
+ self.viewController = [[UIViewController alloc] init];
+ self.viewController.view = [self.wrapperViewController view];
rohitrao (ping after 24h) 2017/04/06 13:08:13 Is it ok to assign to |view| like this, or should
marq (ping after 24h) 2017/04/06 14:30:13 |view| is a public writable property, so implicitl
justincohen 2017/04/06 18:25:09 This is a temporary solution that will go away..
justincohen 2017/04/06 18:25:09 I think this is OK for now.
+ }
+ [super start];
+}
+
+@end

Powered by Google App Engine
This is Rietveld 408576698