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

Unified Diff: remoting/ios/app/app_view_controller_chromium.mm

Issue 2937733003: [CRD iOS] Branching internal and external implementations (Closed)
Patch Set: Fix presenting check Created 3 years, 6 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
« no previous file with comments | « remoting/ios/app/app_view_controller.h ('k') | remoting/ios/app/remoting_view_controller.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/ios/app/app_view_controller_chromium.mm
diff --git a/remoting/ios/app/app_view_controller_chromium.mm b/remoting/ios/app/app_view_controller_chromium.mm
new file mode 100644
index 0000000000000000000000000000000000000000..fb91461f63e9be05bda0ab2a8c9be467f834e5de
--- /dev/null
+++ b/remoting/ios/app/app_view_controller_chromium.mm
@@ -0,0 +1,69 @@
+// 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.
+
+#if !defined(__has_feature) || !__has_feature(objc_arc)
+#error "This file requires ARC support."
+#endif
+
+#import "remoting/ios/app/app_view_controller.h"
+
+#include "base/logging.h"
+
+#import "remoting/ios/app/remoting_menu_view_controller.h"
+
+// The Chromium implementation for the AppViewController. It simply shows the
+// menu modally.
+@interface AppViewController () {
+ UIViewController* _mainViewController;
+
+ RemotingMenuViewController* _menuController; // nullable
+}
+@end
+
+@implementation AppViewController
+
+- (instancetype)initWithMainViewController:
+ (UIViewController*)mainViewController {
+ if (self = [super init]) {
+ _mainViewController = mainViewController;
+ }
+ return self;
+}
+
+- (void)viewDidLoad {
+ [self addChildViewController:_mainViewController];
+ [self.view addSubview:_mainViewController.view];
+ [_mainViewController didMoveToParentViewController:self];
+}
+
+#pragma mark - AppController
+- (void)showMenuAnimated:(BOOL)animated {
+ if (_menuController != nil && [_menuController isBeingPresented]) {
+ return;
+ }
+ _menuController = [[RemotingMenuViewController alloc] init];
+ [self presentViewController:_menuController animated:animated completion:nil];
+}
+
+- (void)hideMenuAnimated:(BOOL)animated {
+ if (_menuController == nil || ![_menuController isBeingPresented]) {
+ return;
+ }
+ [_menuController dismissViewControllerAnimated:animated completion:nil];
+ _menuController = nil;
+}
+
+- (void)presentSignInFlow {
+ [self showMenuAnimated:YES];
+}
+
+- (UIViewController*)childViewControllerForStatusBarStyle {
+ return _mainViewController;
+}
+
+- (UIViewController*)childViewControllerForStatusBarHidden {
+ return _mainViewController;
+}
+
+@end
« no previous file with comments | « remoting/ios/app/app_view_controller.h ('k') | remoting/ios/app/remoting_view_controller.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698