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" | |
|
stuartmorgan
2015/05/21 13:37:59
Blank line above this one.
Elly Fong-Jones
2015/05/21 15:42:49
Done.
| |
| 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]; | |
|
stuartmorgan
2015/05/21 13:37:59
s/google/loadButton/
Elly Fong-Jones
2015/05/21 15:42:49
Done.
| |
| 16 [google setTitle:@"chromium.org" forState:UIControlStateNormal]; | |
| 17 [google setFrame:CGRectMake(5, 0, 95, 50)]; | |
| 18 [google addTarget:self | |
| 19 action:@selector(loadChromium) | |
| 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 loadChromium]; | |
| 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)loadChromium { | |
| 41 [_webView loadRequest:[NSURLRequest requestWithURL: | |
| 42 [NSURL URLWithString:@"https://www.chromium.org"]]]; | |
| 43 } | |
| 44 | |
| 45 @end | |
| OLD | NEW |