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

Unified Diff: remoting/ios/app/remoting_view_controller.mm

Issue 2917253002: [CRD iOS] Create RemotingClient in ClientConnectionViewController (Closed)
Patch Set: resolve feedback 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « remoting/ios/app/client_connection_view_controller.mm ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/ios/app/remoting_view_controller.mm
diff --git a/remoting/ios/app/remoting_view_controller.mm b/remoting/ios/app/remoting_view_controller.mm
index 443311a2225a3e80384744511864df6b2733203f..4e2f444697c5ef311957ced549d572f6db77b72f 100644
--- a/remoting/ios/app/remoting_view_controller.mm
+++ b/remoting/ios/app/remoting_view_controller.mm
@@ -20,7 +20,6 @@
#import "remoting/ios/domain/client_session_details.h"
#import "remoting/ios/facade/remoting_authentication.h"
#import "remoting/ios/facade/remoting_service.h"
-#import "remoting/ios/session/remoting_client.h"
#include "base/strings/sys_string_conversions.h"
#include "remoting/base/oauth_token_getter.h"
@@ -29,7 +28,6 @@
static CGFloat kHostInset = 5.f;
@interface RemotingViewController ()<HostCollectionViewControllerDelegate,
- ClientConnectionViewControllerDelegate,
UIViewControllerAnimatedTransitioning,
UIViewControllerTransitioningDelegate> {
bool _isAuthenticated;
@@ -37,7 +35,6 @@ static CGFloat kHostInset = 5.f;
MDCAppBar* _appBar;
HostCollectionViewController* _collectionViewController;
RemotingService* _remotingService;
- RemotingClient* _client;
}
@end
@@ -85,12 +82,6 @@ static CGFloat kHostInset = 5.f;
target:self
action:@selector(didSelectRefresh)];
self.navigationItem.rightBarButtonItem = refreshButton;
-
- [[NSNotificationCenter defaultCenter]
- addObserver:self
- selector:@selector(hostSessionStatusChanged:)
- name:kHostSessionStatusChanged
- object:nil];
}
return self;
}
@@ -183,22 +174,6 @@ static CGFloat kHostInset = 5.f;
[_collectionViewController.collectionView reloadData];
}
-#pragma mark - ClientConnectionViewControllerDelegate
-
-- (void)clientConnected {
- HostViewController* hostViewController =
- [[HostViewController alloc] initWithClient:_client];
- _client = nil;
- [self presentViewController:hostViewController animated:YES completion:nil];
-}
-
-- (NSString*)getConnectingHostName {
- if (_client) {
- return _client.hostInfo.hostName;
- }
- return nil;
-}
-
#pragma mark - HostCollectionViewControllerDelegate
- (void)didSelectCell:(HostCollectionViewCell*)cell
@@ -210,23 +185,8 @@ static CGFloat kHostInset = 5.f;
return;
}
- _client = [[RemotingClient alloc] init];
-
- [_remotingService.authentication
- callbackWithAccessToken:base::BindBlockArc(^(
- remoting::OAuthTokenGetter::Status status,
- const std::string& user_email,
- const std::string& access_token) {
- // TODO(nicholss): Check status.
- HostInfo* hostInfo = cell.hostInfo;
- [_client connectToHost:hostInfo
- username:base::SysUTF8ToNSString(user_email)
- accessToken:base::SysUTF8ToNSString(access_token)];
- })];
-
ClientConnectionViewController* clientConnectionViewController =
- [[ClientConnectionViewController alloc] init];
- clientConnectionViewController.delegate = self;
+ [[ClientConnectionViewController alloc] initWithHostInfo:cell.hostInfo];
[self presentViewController:clientConnectionViewController
animated:YES
completion:nil];
@@ -269,10 +229,6 @@ animationControllerForDismissedController:(UIViewController*)dismissed {
#pragma mark - Private
-- (void)hostSessionStatusChanged:(NSNotification*)notification {
- NSLog(@"hostSessionStatusChanged: %@", [notification userInfo]);
-}
-
- (void)closeViewController {
[self dismissViewControllerAnimated:true completion:nil];
}
« no previous file with comments | « remoting/ios/app/client_connection_view_controller.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698