Chromium Code Reviews| 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 |
| 11 #import "base/mac/bind_objc_block.h" | 11 #import "base/mac/bind_objc_block.h" |
| 12 #import "ios/third_party/material_components_ios/src/components/AnimationTiming/ src/MaterialAnimationTiming.h" | 12 #import "ios/third_party/material_components_ios/src/components/AnimationTiming/ src/MaterialAnimationTiming.h" |
| 13 #import "ios/third_party/material_components_ios/src/components/AppBar/src/Mater ialAppBar.h" | 13 #import "ios/third_party/material_components_ios/src/components/AppBar/src/Mater ialAppBar.h" |
| 14 #import "ios/third_party/material_components_ios/src/components/Dialogs/src/Mate rialDialogs.h" | 14 #import "ios/third_party/material_components_ios/src/components/Dialogs/src/Mate rialDialogs.h" |
| 15 #import "ios/third_party/material_components_ios/src/components/Snackbar/src/Mat erialSnackbar.h" | 15 #import "ios/third_party/material_components_ios/src/components/Snackbar/src/Mat erialSnackbar.h" |
| 16 #import "remoting/ios/app/client_connection_view_controller.h" | 16 #import "remoting/ios/app/client_connection_view_controller.h" |
| 17 #import "remoting/ios/app/host_collection_view_controller.h" | 17 #import "remoting/ios/app/host_collection_view_controller.h" |
| 18 #import "remoting/ios/app/host_view_controller.h" | 18 #import "remoting/ios/app/host_view_controller.h" |
| 19 #import "remoting/ios/app/remoting_menu_view_controller.h" | 19 #import "remoting/ios/app/remoting_menu_view_controller.h" |
| 20 #import "remoting/ios/app/remoting_resource_factory.h" | |
| 20 #import "remoting/ios/app/remoting_theme.h" | 21 #import "remoting/ios/app/remoting_theme.h" |
| 21 #import "remoting/ios/domain/client_session_details.h" | 22 #import "remoting/ios/domain/client_session_details.h" |
| 22 #import "remoting/ios/facade/remoting_authentication.h" | 23 #import "remoting/ios/facade/remoting_authentication.h" |
| 23 #import "remoting/ios/facade/remoting_service.h" | 24 #import "remoting/ios/facade/remoting_service.h" |
| 24 | 25 |
| 25 #include "base/strings/sys_string_conversions.h" | 26 #include "base/strings/sys_string_conversions.h" |
| 26 #include "remoting/base/oauth_token_getter.h" | 27 #include "remoting/base/oauth_token_getter.h" |
| 27 #include "remoting/client/connect_to_host_info.h" | 28 #include "remoting/client/connect_to_host_info.h" |
| 28 | 29 |
| 29 static CGFloat kHostInset = 5.f; | 30 static CGFloat kHostInset = 5.f; |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 69 self.navigationItem.title = @"Chrome Remote Desktop"; | 70 self.navigationItem.title = @"Chrome Remote Desktop"; |
| 70 | 71 |
| 71 UIBarButtonItem* menuButton = | 72 UIBarButtonItem* menuButton = |
| 72 [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"ic_menu"] | 73 [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"ic_menu"] |
| 73 style:UIBarButtonItemStyleDone | 74 style:UIBarButtonItemStyleDone |
| 74 target:self | 75 target:self |
| 75 action:@selector(didSelectMenu)]; | 76 action:@selector(didSelectMenu)]; |
| 76 self.navigationItem.leftBarButtonItem = menuButton; | 77 self.navigationItem.leftBarButtonItem = menuButton; |
| 77 | 78 |
| 78 UIBarButtonItem* refreshButton = [[UIBarButtonItem alloc] | 79 UIBarButtonItem* refreshButton = [[UIBarButtonItem alloc] |
| 79 initWithImage:[UIImage imageNamed:@"ic_refresh"] | 80 initWithImage:[UIImage imageNamed:@"remoting_refresh"] |
|
nicholss
2017/06/14 15:37:59
why are you renaming this asset?
| |
| 80 style:UIBarButtonItemStyleDone | 81 style:UIBarButtonItemStyleDone |
| 81 target:self | 82 target:self |
| 82 action:@selector(didSelectRefresh)]; | 83 action:@selector(didSelectRefresh)]; |
| 83 self.navigationItem.rightBarButtonItem = refreshButton; | 84 self.navigationItem.rightBarButtonItem = refreshButton; |
| 84 | 85 |
| 85 _appBar.headerViewController.headerView.backgroundColor = | 86 _appBar.headerViewController.headerView.backgroundColor = |
| 86 RemotingTheme.hostListBackgroundColor; | 87 RemotingTheme.hostListBackgroundColor; |
| 87 _appBar.navigationBar.backgroundColor = | 88 _appBar.navigationBar.backgroundColor = |
| 88 RemotingTheme.hostListBackgroundColor; | 89 RemotingTheme.hostListBackgroundColor; |
| 89 MDCNavigationBarTextColorAccessibilityMutator* mutator = | 90 MDCNavigationBarTextColorAccessibilityMutator* mutator = |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 244 [self dismissViewControllerAnimated:true completion:nil]; | 245 [self dismissViewControllerAnimated:true completion:nil]; |
| 245 } | 246 } |
| 246 | 247 |
| 247 - (void)didSelectRefresh { | 248 - (void)didSelectRefresh { |
| 248 // TODO(nicholss): Might want to rate limit this. Maybe remoting service | 249 // TODO(nicholss): Might want to rate limit this. Maybe remoting service |
| 249 // controls that. | 250 // controls that. |
| 250 [_remotingService requestHostListFetch]; | 251 [_remotingService requestHostListFetch]; |
| 251 } | 252 } |
| 252 | 253 |
| 253 - (void)didSelectMenu { | 254 - (void)didSelectMenu { |
| 254 RemotingMenuViewController* menuViewController = | 255 [RemotingResourceFactory.defaultFactory presentMenuOnController:self]; |
| 255 [[RemotingMenuViewController alloc] init]; | |
| 256 [self presentViewController:menuViewController animated:YES completion:nil]; | |
| 257 } | 256 } |
| 258 | 257 |
| 259 - (void)presentStatus { | 258 - (void)presentStatus { |
| 260 MDCSnackbarMessage* message = [[MDCSnackbarMessage alloc] init]; | 259 MDCSnackbarMessage* message = [[MDCSnackbarMessage alloc] init]; |
| 261 if (_isAuthenticated) { | 260 if (_isAuthenticated) { |
| 262 message.text = [NSString | 261 message.text = [NSString |
| 263 stringWithFormat:@"Currently signed in as %@.", | 262 stringWithFormat:@"Currently signed in as %@.", |
| 264 _remotingService.authentication.user.userEmail]; | 263 _remotingService.authentication.user.userEmail]; |
| 265 [MDCSnackbarManager showMessage:message]; | 264 [MDCSnackbarManager showMessage:message]; |
| 266 } | 265 } |
| 267 } | 266 } |
| 268 | 267 |
| 269 @end | 268 @end |
| OLD | NEW |