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

Side by Side Diff: remoting/ios/app/remoting_view_controller.mm

Issue 2937733003: [CRD iOS] Branching internal and external implementations (Closed)
Patch Set: add comment 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
OLDNEW
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_resource_factory.h"
19 #import "remoting/ios/app/remoting_settings_view_controller.h" 20 #import "remoting/ios/app/remoting_settings_view_controller.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
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
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(didSelectSettings)]; 76 action:@selector(didSelectSettings)];
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"]
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
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)didSelectSettings { 254 - (void)didSelectSettings {
254 RemotingSettingsViewController* settingsViewController = 255 [RemotingResourceFactory.defaultFactory presentMenuOnController:self];
255 [[RemotingSettingsViewController alloc] init];
256 [self presentViewController:settingsViewController
257 animated:YES
258 completion:nil];
259 } 256 }
260 257
261 - (void)presentStatus { 258 - (void)presentStatus {
262 MDCSnackbarMessage* message = [[MDCSnackbarMessage alloc] init]; 259 MDCSnackbarMessage* message = [[MDCSnackbarMessage alloc] init];
263 if (_isAuthenticated) { 260 if (_isAuthenticated) {
264 message.text = [NSString 261 message.text = [NSString
265 stringWithFormat:@"Currently signed in as %@.", 262 stringWithFormat:@"Currently signed in as %@.",
266 _remotingService.authentication.user.userEmail]; 263 _remotingService.authentication.user.userEmail];
267 [MDCSnackbarManager showMessage:message]; 264 [MDCSnackbarManager showMessage:message];
268 } 265 }
269 } 266 }
270 267
271 @end 268 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698