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

Unified Diff: ios/chrome/browser/autofill/form_input_accessory_view_controller.mm

Issue 1310813002: Fix for iPads running iOS 9 to no longer crash on pw generation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 4 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/chrome/browser/autofill/form_input_accessory_view_controller.mm
diff --git a/ios/chrome/browser/autofill/form_input_accessory_view_controller.mm b/ios/chrome/browser/autofill/form_input_accessory_view_controller.mm
index 8bb148f937fc6e473b4e68215a8899bbc62f100a..e628cc9d6b6a0800894cc490fd01e7a57f370e49 100644
--- a/ios/chrome/browser/autofill/form_input_accessory_view_controller.mm
+++ b/ios/chrome/browser/autofill/form_input_accessory_view_controller.mm
@@ -290,17 +290,25 @@ bool ComputeFramesOfKeyboardParts(UIView* inputAccessoryView,
// so we attach the custom view directly to the keyboard view instead.
[_customAccessoryView removeFromSuperview];
- // If the keyboard isn't visible or no suggestions have been triggered yet,
- // don't show the custom view.
- int numSuggestions =
- [[static_cast<FormSuggestionView*>(view) suggestions] count];
+ // If the keyboard isn't visible don't show the custom view.
if (CGRectIntersection([UIScreen mainScreen].bounds, _keyboardFrame)
.size.height == 0 ||
- CGRectEqualToRect(_keyboardFrame, CGRectZero) ||
- (!_suggestionsHaveBeenShown && numSuggestions == 0)) {
+ CGRectEqualToRect(_keyboardFrame, CGRectZero)) {
_customAccessoryView.reset();
return;
}
+
+ // If this is a form suggestion view and no suggestions have been triggered
+ // yet, don't show the custom view.
+ FormSuggestionView* formSuggestionView =
+ base::mac::ObjCCastStrict<FormSuggestionView>(view);
+ if (formSuggestionView) {
+ int numSuggestions = [[formSuggestionView suggestions] count];
+ if (!_suggestionsHaveBeenShown && numSuggestions == 0) {
+ _customAccessoryView.reset();
+ return;
+ }
+ }
_suggestionsHaveBeenShown = YES;
CGFloat height = autofill::kInputAccessoryHeight;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698