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

Unified Diff: ios/showcase/strip/sc_strip_coordinator.mm

Issue 2594023002: Simple strip container that can reveal/hide tab strip. (Closed)
Patch Set: Update import. Created 4 years 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
« no previous file with comments | « ios/showcase/strip/sc_strip_coordinator.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/showcase/strip/sc_strip_coordinator.mm
diff --git a/ios/showcase/strip/sc_strip_coordinator.mm b/ios/showcase/strip/sc_strip_coordinator.mm
new file mode 100644
index 0000000000000000000000000000000000000000..c0657d4b4099fd386865a6102cb8550742a18311
--- /dev/null
+++ b/ios/showcase/strip/sc_strip_coordinator.mm
@@ -0,0 +1,52 @@
+// Copyright 2016 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/showcase/strip/sc_strip_coordinator.h"
+
+#import "ios/chrome/browser/ui/actions/tab_strip_actions.h"
+#import "ios/chrome/browser/ui/strip/strip_container_view_controller.h"
+
+#if !defined(__has_feature) || !__has_feature(objc_arc)
+#error "This file requires ARC support."
+#endif
+
+@interface SCStripCoordinator ()
+@property(nonatomic, strong) StripContainerViewController* viewController;
+@end
+
+@implementation SCStripCoordinator
+@synthesize baseViewController = _baseViewController;
+@synthesize viewController = _viewController;
+
+- (void)start {
+ UIViewController* blackViewController = [[UIViewController alloc] init];
+ blackViewController.view.backgroundColor = [UIColor blackColor];
+
+ UIViewController* greenViewController =
+ [self viewControllerWithButtonTitle:@"toggleStrip"
+ action:@selector(toggleTabStrip:)];
+ greenViewController.view.backgroundColor = [UIColor greenColor];
+
+ self.viewController = [[StripContainerViewController alloc] init];
+ self.viewController.title = @"Tab strip container";
+ self.viewController.stripViewController = blackViewController;
+ self.viewController.contentViewController = greenViewController;
+ self.baseViewController.navigationBar.translucent = NO;
+ [self.baseViewController pushViewController:self.viewController animated:YES];
+}
+
+- (UIViewController*)viewControllerWithButtonTitle:(NSString*)title
+ action:(SEL)action {
+ UIViewController* viewController = [[UIViewController alloc] init];
+ UIButton* button = [UIButton buttonWithType:UIButtonTypeRoundedRect];
+ [button setFrame:CGRectMake(10, 10, 80, 50)];
+ [button setTitle:title forState:UIControlStateNormal];
+ [viewController.view addSubview:button];
+ [button addTarget:nil
+ action:action
+ forControlEvents:UIControlEventTouchUpInside];
+ return viewController;
+}
+
+@end
« no previous file with comments | « ios/showcase/strip/sc_strip_coordinator.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698