Chromium Code Reviews| Index: ios/crnet/crnet_consumer/crnet_consumer_view_controller.m |
| diff --git a/ios/crnet/crnet_consumer/crnet_consumer_view_controller.m b/ios/crnet/crnet_consumer/crnet_consumer_view_controller.m |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..bcc31aa0e42c05b907558987f771ab1920e2a036 |
| --- /dev/null |
| +++ b/ios/crnet/crnet_consumer/crnet_consumer_view_controller.m |
| @@ -0,0 +1,46 @@ |
| +// Copyright 2014 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. |
| + |
| +#import "crnet_consumer_view_controller.h" |
| +#import "CrNet.h" |
| + |
| +@implementation CrNetConsumerViewController { |
| + UIWebView* _webView; |
| +} |
| + |
| +- (void)viewDidLoad { |
| + self.view.backgroundColor = [UIColor whiteColor]; |
| + |
| + UIButton* google = [UIButton buttonWithType:UIButtonTypeSystem]; |
| + [google setTitle:@"google.com" forState:UIControlStateNormal]; |
| + [google setFrame:CGRectMake(5, 0, 95, 50)]; |
| + [google addTarget:self |
| + action:@selector(loadGoogle) |
| + forControlEvents:UIControlEventTouchUpInside]; |
| + [self.view addSubview:google]; |
| + |
| + _webView = [[UIWebView alloc] |
| + initWithFrame:CGRectMake(0, |
| + 52, |
| + self.view.bounds.size.width, |
| + self.view.bounds.size.height - 52)]; |
| + [self.view addSubview:_webView]; |
| + _webView.autoresizingMask = UIViewAutoresizingFlexibleWidth | |
| + UIViewAutoresizingFlexibleHeight; |
| + |
| + [self loadGoogle]; |
| +} |
| + |
| +// Disable the status bar to sidestep all the iOS7 status bar issues. |
| +- (BOOL)prefersStatusBarHidden { |
| + return YES; |
| +} |
| + |
| +- (void)loadGoogle { |
| + [_webView loadRequest:[NSURLRequest requestWithURL: |
| + [NSURL URLWithString:@"https://www.google.com"]]]; |
|
stuartmorgan
2015/05/19 17:39:36
Fix indentation; should just be 4 relative to the
Elly Fong-Jones
2015/05/20 22:02:26
Done.
|
| + |
|
stuartmorgan
2015/05/19 17:39:36
Remove the blank line.
Elly Fong-Jones
2015/05/20 22:02:26
Done.
|
| +} |
| + |
| +@end |