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

Unified Diff: remoting/client/ios/app/host_view_controller.mm

Issue 2871993003: Moving the iOS directory to be remoting top level. (Closed)
Patch Set: //remoting/ios was the old landing target for the internal iOS application. Fix. Created 3 years, 7 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/client/ios/app/host_view_controller.h ('k') | remoting/client/ios/app/main.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/client/ios/app/host_view_controller.mm
diff --git a/remoting/client/ios/app/host_view_controller.mm b/remoting/client/ios/app/host_view_controller.mm
deleted file mode 100644
index 5612581491ffce2761746784f93677c6ce784d20..0000000000000000000000000000000000000000
--- a/remoting/client/ios/app/host_view_controller.mm
+++ /dev/null
@@ -1,118 +0,0 @@
-// Copyright 2017 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#if !defined(__has_feature) || !__has_feature(objc_arc)
-#error "This file requires ARC support."
-#endif
-
-#import "remoting/client/ios/app/host_view_controller.h"
-
-#include <memory>
-
-#import <GLKit/GLKit.h>
-
-#import "ios/third_party/material_components_ios/src/components/Buttons/src/MaterialButtons.h"
-#import "remoting/client/ios/client_gestures.h"
-#import "remoting/client/ios/session/remoting_client.h"
-
-#include "remoting/client/gesture_interpreter.h"
-
-static const CGFloat kFabInset = 15.f;
-
-@interface HostViewController () {
- RemotingClient* _client;
- MDCFloatingButton* _floatingButton;
-
- ClientGestures* _clientGestures;
-}
-@end
-
-@implementation HostViewController
-
-- (id)initWithClient:(RemotingClient*)client {
- self = [super init];
- if (self) {
- _client = client;
- }
- return self;
-}
-
-#pragma mark - UIViewController
-
-- (void)loadView {
- self.view = [[GLKView alloc] initWithFrame:CGRectZero];
-}
-
-- (void)viewDidLoad {
- [super viewDidLoad];
- _floatingButton =
- [MDCFloatingButton floatingButtonWithShape:MDCFloatingButtonShapeMini];
- [_floatingButton setTitle:@"+" forState:UIControlStateNormal];
- [_floatingButton addTarget:self
- action:@selector(didTap:)
- forControlEvents:UIControlEventTouchUpInside];
-
- UIImage* settingsImage = [UIImage imageNamed:@"Settings"];
- [_floatingButton setImage:settingsImage forState:UIControlStateNormal];
- [_floatingButton sizeToFit];
- [self.view addSubview:_floatingButton];
-}
-
-- (void)viewDidUnload {
- [super viewDidUnload];
- // TODO(nicholss): There needs to be a hook to tell the client we are done.
-}
-
-- (BOOL)prefersStatusBarHidden {
- return YES;
-}
-
-- (void)viewDidAppear:(BOOL)animated {
- [super viewDidAppear:animated];
- GLKView* glView = (GLKView*)self.view;
- glView.context = [_client.displayHandler GetEAGLContext];
- [_client.displayHandler onSurfaceCreated:glView];
-
- // viewDidLayoutSubviews may be called before viewDidAppear, in which case
- // the surface is not ready and onSurfaceChanged will be no-op.
- // Call onSurfaceChanged here to cover that case.
- [_client surfaceChanged:self.view.frame];
-}
-
-- (void)viewWillAppear:(BOOL)animated {
- [super viewWillAppear:animated];
-
- _clientGestures =
- [[ClientGestures alloc] initWithView:self.view client:_client];
-}
-
-- (void)viewWillDisappear:(BOOL)animated {
- [super viewWillDisappear:animated];
-
- _clientGestures = nil;
-}
-
-- (void)viewDidLayoutSubviews {
- [super viewDidLayoutSubviews];
-
- [_client surfaceChanged:self.view.frame];
-
- CGSize btnSize = _floatingButton.frame.size;
- _floatingButton.frame =
- CGRectMake(self.view.frame.size.width - btnSize.width - kFabInset,
- self.view.frame.size.height - btnSize.height - kFabInset,
- btnSize.width, btnSize.height);
-}
-
-#pragma mark - Private
-
-- (void)didTap:(id)sender {
- // TODO(nicholss): The FAB is being used to close the window at the moment
- // just as a demo as the integration continues. This will not be the case
- // in the final app.
- [_client disconnectFromHost];
- [self dismissViewControllerAnimated:YES completion:nil];
-}
-
-@end
« no previous file with comments | « remoting/client/ios/app/host_view_controller.h ('k') | remoting/client/ios/app/main.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698