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

Side by Side Diff: remoting/ios/ui/pin_entry_view_controller.mm

Issue 475333004: Remove old Chromoting iOS client (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 4 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
(Empty)
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #if !defined(__has_feature) || !__has_feature(objc_arc)
6 #error "This file requires ARC support."
7 #endif
8
9 #import "remoting/ios/ui/pin_entry_view_controller.h"
10
11 #import "remoting/ios/utility.h"
12
13 @implementation PinEntryViewController
14
15 @synthesize delegate = _delegate;
16 @synthesize shouldPrompt = _shouldPrompt;
17 @synthesize pairingSupported = _pairingSupported;
18
19 // Override UIViewController
20 - (id)initWithNibName:(NSString*)nibNameOrNil bundle:(NSBundle*)nibBundleOrNil {
21 // NibName is the * part of your *.xib file
22
23 if ([Utility isPad]) {
24 self = [super initWithNibName:@"pin_entry_view_controller_ipad" bundle:nil];
25 } else {
26 self =
27 [super initWithNibName:@"pin_entry_view_controller_iphone" bundle:nil];
28 }
29 if (self) {
30 // Custom initialization
31 }
32 return self;
33 }
34
35 // Override UIViewController
36 // Controls are not created immediately, properties must be set before the form
37 // is displayed
38 - (void)viewWillAppear:(BOOL)animated {
39 _host.text = _hostName;
40
41 [_switchAskAgain setOn:!_shouldPrompt];
42
43 // TODO (aboone) The switch is being hidden in all cases, this functionality
44 // is not scheduled for QA yet.
45 // if (!_pairingSupported) {
46 _switchAskAgain.hidden = YES;
47 _shouldSavePin.hidden = YES;
48 _switchAskAgain.enabled = NO;
49 //}
50 [_hostPin becomeFirstResponder];
51 }
52
53 // @protocol UITextFieldDelegate, called when the 'enter' key is pressed
54 - (BOOL)textFieldShouldReturn:(UITextField*)textField {
55 [textField resignFirstResponder];
56 if (textField == _hostPin)
57 [self buttonConnectClicked:self];
58 return YES;
59 }
60
61 - (IBAction)buttonCancelClicked:(id)sender {
62 [_delegate cancelledConnectToHostWithPin:self];
63 }
64
65 - (IBAction)buttonConnectClicked:(id)sender {
66 [_delegate connectToHostWithPin:self
67 hostPin:_hostPin.text
68 shouldPrompt:!_switchAskAgain.isOn];
69 }
70
71 @end
OLDNEW
« no previous file with comments | « remoting/ios/ui/pin_entry_view_controller.h ('k') | remoting/ios/ui/pin_entry_view_controller_ipad.xib » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698