Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #import "ios/chrome/browser/autofill/form_input_accessory_view.h" | 5 #import "ios/chrome/browser/autofill/form_input_accessory_view.h" |
| 6 | 6 |
| 7 #import <QuartzCore/QuartzCore.h> | 7 #import <QuartzCore/QuartzCore.h> |
| 8 | 8 |
| 9 #include "base/i18n/rtl.h" | 9 #include "base/i18n/rtl.h" |
| 10 #include "base/ios/weak_nsobject.h" | 10 #include "base/ios/weak_nsobject.h" |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 111 if (self) { | 111 if (self) { |
| 112 _delegate.reset(delegate); | 112 _delegate.reset(delegate); |
| 113 _customView.reset([customView retain]); | 113 _customView.reset([customView retain]); |
| 114 [self initializeViewWithCustomView:_customView | 114 [self initializeViewWithCustomView:_customView |
| 115 leftFrame:leftFrame | 115 leftFrame:leftFrame |
| 116 rightFrame:rightFrame]; | 116 rightFrame:rightFrame]; |
| 117 } | 117 } |
| 118 return self; | 118 return self; |
| 119 } | 119 } |
| 120 | 120 |
| 121 - (instancetype)initWithFrame:(CGRect)frame customView:(UIView*)customView { | |
| 122 self = [super initWithFrame:frame]; | |
| 123 if (self) { | |
| 124 _customView.reset([customView retain]); | |
|
justincohen
2015/08/19 20:34:19
Why do we retain this at all
Justin Donnelly
2015/08/20 16:38:01
Don't know. My quick guess would be that something
| |
| 125 customView.frame = | |
| 126 CGRectMake(0, 0, CGRectGetWidth(frame), CGRectGetHeight(frame)); | |
| 127 [self addSubview:customView]; | |
| 128 | |
| 129 [[self class] addBackgroundImageInView:self | |
| 130 withImageName:@"autofill_keyboard_background"]; | |
| 131 } | |
| 132 return self; | |
| 133 } | |
| 134 | |
| 121 #pragma mark - | 135 #pragma mark - |
| 122 #pragma mark UIInputViewAudioFeedback | 136 #pragma mark UIInputViewAudioFeedback |
| 123 | 137 |
| 124 - (BOOL)enableInputClicksWhenVisible { | 138 - (BOOL)enableInputClicksWhenVisible { |
| 125 return YES; | 139 return YES; |
| 126 } | 140 } |
| 127 | 141 |
| 128 #pragma mark - | 142 #pragma mark - |
| 129 #pragma mark Private Methods | 143 #pragma mark Private Methods |
| 130 | 144 |
| (...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 362 UIImage* image = | 376 UIImage* image = |
| 363 StretchableImageFromUIImage([UIImage imageNamed:imageName], 0, 0); | 377 StretchableImageFromUIImage([UIImage imageNamed:imageName], 0, 0); |
| 364 base::scoped_nsobject<UIImageView> imageView( | 378 base::scoped_nsobject<UIImageView> imageView( |
| 365 [[UIImageView alloc] initWithImage:image]); | 379 [[UIImageView alloc] initWithImage:image]); |
| 366 [imageView setFrame:CGRectMake(originX, originY, width, | 380 [imageView setFrame:CGRectMake(originX, originY, width, |
| 367 CGRectGetHeight(view.bounds) - originY)]; | 381 CGRectGetHeight(view.bounds) - originY)]; |
| 368 [view addSubview:imageView]; | 382 [view addSubview:imageView]; |
| 369 } | 383 } |
| 370 | 384 |
| 371 @end | 385 @end |
| OLD | NEW |