| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 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 | 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/remoting_view_controller.h" | 9 #import "remoting/ios/app/remoting_view_controller.h" |
| 10 | 10 |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 if (self) { | 61 if (self) { |
| 62 _remotingService = [RemotingService SharedInstance]; | 62 _remotingService = [RemotingService SharedInstance]; |
| 63 | 63 |
| 64 _collectionViewController = collectionVC; | 64 _collectionViewController = collectionVC; |
| 65 _collectionViewController.flexHeaderContainerViewController = self; | 65 _collectionViewController.flexHeaderContainerViewController = self; |
| 66 _collectionViewController.delegate = self; | 66 _collectionViewController.delegate = self; |
| 67 | 67 |
| 68 _appBar = [[MDCAppBar alloc] init]; | 68 _appBar = [[MDCAppBar alloc] init]; |
| 69 [self addChildViewController:_appBar.headerViewController]; | 69 [self addChildViewController:_appBar.headerViewController]; |
| 70 | 70 |
| 71 _appBar.headerViewController.headerView.backgroundColor = | 71 self.navigationItem.title = @"Chrome Remote Desktop"; |
| 72 kChromotingBlueBackground; | |
| 73 _appBar.navigationBar.tintColor = [UIColor whiteColor]; | |
| 74 | 72 |
| 75 UIBarButtonItem* menuButton = | 73 UIBarButtonItem* menuButton = |
| 76 [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"Settings"] | 74 [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"ic_menu"] |
| 77 style:UIBarButtonItemStyleDone | 75 style:UIBarButtonItemStyleDone |
| 78 target:self | 76 target:self |
| 79 action:@selector(didSelectSettings)]; | 77 action:@selector(didSelectSettings)]; |
| 80 self.navigationItem.leftBarButtonItem = menuButton; | 78 self.navigationItem.leftBarButtonItem = menuButton; |
| 81 | 79 |
| 82 UIBarButtonItem* refreshButton = | 80 UIBarButtonItem* refreshButton = [[UIBarButtonItem alloc] |
| 83 [[UIBarButtonItem alloc] initWithTitle:@"Refresh" | 81 initWithImage:[UIImage imageNamed:@"ic_refresh"] |
| 84 style:UIBarButtonItemStyleDone | 82 style:UIBarButtonItemStyleDone |
| 85 target:self | 83 target:self |
| 86 action:@selector(didSelectRefresh)]; | 84 action:@selector(didSelectRefresh)]; |
| 87 self.navigationItem.rightBarButtonItem = refreshButton; | 85 self.navigationItem.rightBarButtonItem = refreshButton; |
| 86 |
| 87 _appBar.headerViewController.headerView.backgroundColor = |
| 88 kChromotingBlueBackground; |
| 89 _appBar.navigationBar.backgroundColor = kChromotingBlueBackground; |
| 90 MDCNavigationBarTextColorAccessibilityMutator* mutator = |
| 91 [[MDCNavigationBarTextColorAccessibilityMutator alloc] init]; |
| 92 [mutator mutate:_appBar.navigationBar]; |
| 88 } | 93 } |
| 89 return self; | 94 return self; |
| 90 } | 95 } |
| 91 | 96 |
| 92 #pragma mark - UIViewController | 97 #pragma mark - UIViewController |
| 93 | 98 |
| 94 - (void)viewDidLoad { | 99 - (void)viewDidLoad { |
| 95 [super viewDidLoad]; | 100 [super viewDidLoad]; |
| 96 | 101 |
| 97 UIImage* image = [UIImage imageNamed:@"Background"]; | 102 UIImage* image = [UIImage imageNamed:@"Background"]; |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 257 MDCSnackbarMessage* message = [[MDCSnackbarMessage alloc] init]; | 262 MDCSnackbarMessage* message = [[MDCSnackbarMessage alloc] init]; |
| 258 if (_isAuthenticated) { | 263 if (_isAuthenticated) { |
| 259 message.text = [NSString | 264 message.text = [NSString |
| 260 stringWithFormat:@"Currently signed in as %@.", | 265 stringWithFormat:@"Currently signed in as %@.", |
| 261 _remotingService.authentication.user.userEmail]; | 266 _remotingService.authentication.user.userEmail]; |
| 262 [MDCSnackbarManager showMessage:message]; | 267 [MDCSnackbarManager showMessage:message]; |
| 263 } | 268 } |
| 264 } | 269 } |
| 265 | 270 |
| 266 @end | 271 @end |
| OLD | NEW |