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

Unified Diff: ios/crnet/crnet_consumer/crnet_consumer_view_controller.m

Issue 1125293004: ios: add CrNet (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix last nits Created 5 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 | « ios/crnet/crnet_consumer/crnet_consumer_view_controller.h ('k') | ios/crnet/crnet_consumer/main.m » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..bdcd4ef1f6e2f93d9ac6b117996b2c4119158d8c
--- /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* button = [UIButton buttonWithType:UIButtonTypeSystem];
+ [button setTitle:@"chromium.org" forState:UIControlStateNormal];
+ [button setFrame:CGRectMake(5, 0, 95, 50)];
+ [button addTarget:self
+ action:@selector(loadChromium)
+ forControlEvents:UIControlEventTouchUpInside];
+ [self.view addSubview:button];
+
+ _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 loadChromium];
+}
+
+// Disable the status bar to sidestep all the iOS7 status bar issues.
+- (BOOL)prefersStatusBarHidden {
+ return YES;
+}
+
+- (void)loadChromium {
+ [_webView loadRequest:[NSURLRequest requestWithURL:
+ [NSURL URLWithString:@"https://www.chromium.org"]]];
+}
+
+@end
« no previous file with comments | « ios/crnet/crnet_consumer/crnet_consumer_view_controller.h ('k') | ios/crnet/crnet_consumer/main.m » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698