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

Side by Side Diff: remoting/ios/app/app_delegate.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_delegate.h ('k') | remoting/ios/app/app_view_controller.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #if !defined(__has_feature) || !__has_feature(objc_arc) 5 #if !defined(__has_feature) || !__has_feature(objc_arc)
6 #error "This file requires ARC support." 6 #error "This file requires ARC support."
7 #endif 7 #endif
8 8
9 #import "remoting/ios/app/app_delegate.h" 9 #import "remoting/ios/app/app_delegate.h"
10 10
11 #include "base/logging.h" 11 #include "base/logging.h"
12 #include "ui/base/l10n/l10n_util.h" 12 #include "ui/base/l10n/l10n_util.h"
13 #include "ui/base/resource/resource_bundle.h" 13 #include "ui/base/resource/resource_bundle.h"
14 14
15 #import "remoting/ios/app/app_view_controller.h"
15 #import "remoting/ios/app/remoting_view_controller.h" 16 #import "remoting/ios/app/remoting_view_controller.h"
16 #import "remoting/ios/facade/remoting_authentication.h" 17 #import "remoting/ios/facade/remoting_authentication.h"
17 #import "remoting/ios/facade/remoting_service.h" 18 #import "remoting/ios/facade/remoting_service.h"
18 19
20 @interface AppDelegate () {
21 AppViewController* _appViewController;
22 }
23 @end
24
19 @implementation AppDelegate 25 @implementation AppDelegate
20 26
21 @synthesize window = _window; 27 @synthesize window = _window;
22 28
23 - (BOOL)application:(UIApplication*)application 29 - (BOOL)application:(UIApplication*)application
24 willFinishLaunchingWithOptions:(NSDictionary*)launchOptions { 30 willFinishLaunchingWithOptions:(NSDictionary*)launchOptions {
25 self.window = 31 self.window =
26 [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; 32 [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
27 self.window.backgroundColor = [UIColor whiteColor]; 33 self.window.backgroundColor = [UIColor whiteColor];
28 return YES; 34 return YES;
(...skipping 17 matching lines...) Expand all
46 } 52 }
47 NSString* authorizationCode = [components objectForKey:@"code"]; 53 NSString* authorizationCode = [components objectForKey:@"code"];
48 54
49 [[RemotingService SharedInstance].authentication 55 [[RemotingService SharedInstance].authentication
50 authenticateWithAuthorizationCode:authorizationCode]; 56 authenticateWithAuthorizationCode:authorizationCode];
51 57
52 [self launchRemotingViewController]; 58 [self launchRemotingViewController];
53 return YES; 59 return YES;
54 } 60 }
55 61
62 #pragma mark - Public
63 - (void)showMenuAnimated:(BOOL)animated {
64 DCHECK(_appViewController != nil);
65 [_appViewController showMenuAnimated:animated];
66 }
67
68 - (void)hideMenuAnimated:(BOOL)animated {
69 DCHECK(_appViewController != nil);
70 [_appViewController hideMenuAnimated:animated];
71 }
72
73 - (void)presentSignInFlow {
74 DCHECK(_appViewController != nil);
75 [_appViewController presentSignInFlow];
76 }
77
78 #pragma mark - Properties
79
80 + (AppDelegate*)instance {
81 return (AppDelegate*)UIApplication.sharedApplication.delegate;
82 }
83
84 #pragma mark - Private
85
56 - (void)launchRemotingViewController { 86 - (void)launchRemotingViewController {
57 RemotingViewController* vc = [[RemotingViewController alloc] init]; 87 RemotingViewController* vc = [[RemotingViewController alloc] init];
58 UINavigationController* navController = 88 UINavigationController* navController =
59 [[UINavigationController alloc] initWithRootViewController:vc]; 89 [[UINavigationController alloc] initWithRootViewController:vc];
60 navController.navigationBarHidden = true; 90 navController.navigationBarHidden = true;
61 self.window.rootViewController = navController; 91
92 _appViewController =
93 [[AppViewController alloc] initWithMainViewController:navController];
94 self.window.rootViewController = _appViewController;
62 [self.window makeKeyAndVisible]; 95 [self.window makeKeyAndVisible];
63 } 96 }
64 97
65 @end 98 @end
OLDNEW
« no previous file with comments | « remoting/ios/app/app_delegate.h ('k') | remoting/ios/app/app_view_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698