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

Unified Diff: ios/web/shell/view_controller.mm

Issue 2080123003: Remove ios web shell MainView.xib. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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/web/shell/view_controller.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/web/shell/view_controller.mm
diff --git a/ios/web/shell/view_controller.mm b/ios/web/shell/view_controller.mm
index a03c23b29ef19e5104adf16d5c551c36f09197fa..b85e23e4e51f15704cd31ed88751e68983273d2d 100644
--- a/ios/web/shell/view_controller.mm
+++ b/ios/web/shell/view_controller.mm
@@ -35,7 +35,8 @@ using web::NavigationManager;
@interface ViewController ()<CRWWebStateDelegate,
CRWWebStateObserver,
- UITextFieldDelegate> {
+ UITextFieldDelegate,
+ UIToolbarDelegate> {
web::BrowserState* _browserState;
std::unique_ptr<web::WebState> _webState;
std::unique_ptr<web::WebStateObserverBridge> _webStateObserver;
@@ -54,7 +55,7 @@ using web::NavigationManager;
@synthesize toolbarView = _toolbarView;
- (instancetype)initWithBrowserState:(web::BrowserState*)browserState {
- self = [super initWithNibName:@"MainView" bundle:nil];
+ self = [super initWithNibName:nil bundle:nil];
if (self) {
_propertyReleaser_ViewController.Init(self, [ViewController class]);
_browserState = browserState;
@@ -71,6 +72,27 @@ using web::NavigationManager;
- (void)viewDidLoad {
[super viewDidLoad];
+ CGRect bounds = self.view.bounds;
+
+ // Set up the toolbar.
+ _toolbarView = [[UIToolbar alloc] init];
+ _toolbarView.barTintColor =
+ [UIColor colorWithRed:0.337 green:0.467 blue:0.988 alpha:1.0];
+ _toolbarView.frame = CGRectMake(0, 20, CGRectGetWidth(bounds), 44);
+ _toolbarView.autoresizingMask =
+ UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleBottomMargin;
+ _toolbarView.delegate = self;
+ [self.view addSubview:_toolbarView];
+
+ // Set up the container view.
+ _containerView = [[UIView alloc] init];
+ _containerView.frame =
+ CGRectMake(0, 64, CGRectGetWidth(bounds), CGRectGetHeight(bounds) - 64);
+ _containerView.backgroundColor = [UIColor lightGrayColor];
+ _containerView.autoresizingMask =
+ UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
+ [self.view addSubview:_containerView];
+
// Set up the toolbar buttons.
UIButton* back = [UIButton buttonWithType:UIButtonTypeCustom];
[back setImage:[UIImage imageNamed:@"toolbar_back"]
« no previous file with comments | « ios/web/shell/view_controller.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698