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

Side by Side 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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 #if !defined(__has_feature) || !__has_feature(objc_arc)
6 #error "This file requires ARC support."
7 #endif
8
9 #import "remoting/ios/app/app_view_controller.h"
10
11 #include "base/logging.h"
12
13 #import "remoting/ios/app/remoting_menu_view_controller.h"
14
15 // The Chromium implementation for the AppViewController. It simply shows the
16 // menu modally.
17 @interface AppViewController () {
18 UIViewController* _mainViewController;
19
20 RemotingMenuViewController* _menuController; // nullable
21 }
22 @end
23
24 @implementation AppViewController
25
26 - (instancetype)initWithMainViewController:
27 (UIViewController*)mainViewController {
28 if (self = [super init]) {
29 _mainViewController = mainViewController;
30 }
31 return self;
32 }
33
34 - (void)viewDidLoad {
35 [self addChildViewController:_mainViewController];
36 [self.view addSubview:_mainViewController.view];
37 [_mainViewController didMoveToParentViewController:self];
38 }
39
40 #pragma mark - AppController
41 - (void)showMenuAnimated:(BOOL)animated {
42 if (_menuController != nil && [_menuController isBeingPresented]) {
43 return;
44 }
45 _menuController = [[RemotingMenuViewController alloc] init];
46 [self presentViewController:_menuController animated:animated completion:nil];
47 }
48
49 - (void)hideMenuAnimated:(BOOL)animated {
50 if (_menuController == nil || ![_menuController isBeingPresented]) {
51 return;
52 }
53 [_menuController dismissViewControllerAnimated:animated completion:nil];
54 _menuController = nil;
55 }
56
57 - (void)presentSignInFlow {
58 [self showMenuAnimated:YES];
59 }
60
61 - (UIViewController*)childViewControllerForStatusBarStyle {
62 return _mainViewController;
63 }
64
65 - (UIViewController*)childViewControllerForStatusBarHidden {
66 return _mainViewController;
67 }
68
69 @end
OLDNEW
« 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