Chromium Code Reviews| OLD | NEW |
|---|---|
| (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 #import "crnet_consumer_view_controller.h" | |
| 6 #import "CrNet.h" | |
| 7 | |
| 8 @implementation CrNetConsumerViewController { | |
| 9 UIWebView* _webView; | |
| 10 } | |
| 11 | |
| 12 - (void)viewDidLoad { | |
| 13 self.view.backgroundColor = [UIColor whiteColor]; | |
| 14 | |
| 15 UIButton* google = [UIButton buttonWithType:UIButtonTypeSystem]; | |
| 16 [google setTitle:@"google.com" forState:UIControlStateNormal]; | |
| 17 [google setFrame:CGRectMake(5, 0, 95, 50)]; | |
| 18 [google addTarget:self | |
| 19 action:@selector(loadGoogle) | |
| 20 forControlEvents:UIControlEventTouchUpInside]; | |
| 21 [self.view addSubview:google]; | |
| 22 | |
| 23 _webView = [[UIWebView alloc] | |
| 24 initWithFrame:CGRectMake(0, | |
| 25 52, | |
| 26 self.view.bounds.size.width, | |
| 27 self.view.bounds.size.height - 52)]; | |
| 28 [self.view addSubview:_webView]; | |
| 29 _webView.autoresizingMask = UIViewAutoresizingFlexibleWidth | | |
| 30 UIViewAutoresizingFlexibleHeight; | |
| 31 | |
| 32 [self loadGoogle]; | |
| 33 } | |
| 34 | |
| 35 // Disable the status bar to sidestep all the iOS7 status bar issues. | |
| 36 - (BOOL)prefersStatusBarHidden { | |
| 37 return YES; | |
| 38 } | |
| 39 | |
| 40 - (void)loadGoogle { | |
| 41 [_webView loadRequest:[NSURLRequest requestWithURL: | |
| 42 [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.
| |
| 43 | |
|
stuartmorgan
2015/05/19 17:39:36
Remove the blank line.
Elly Fong-Jones
2015/05/20 22:02:26
Done.
| |
| 44 } | |
| 45 | |
| 46 @end | |
| OLD | NEW |