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

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

Issue 1305433003: Make Autofill work again on iPads running iOS 9. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Don't show view until suggestions available, unlisten when switching tabs, DCHECK keyboard view 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
Index: ios/chrome/browser/autofill/form_suggestion_controller.mm
diff --git a/ios/chrome/browser/autofill/form_suggestion_controller.mm b/ios/chrome/browser/autofill/form_suggestion_controller.mm
index 317f6af71713c98c5a46827a50af26a8e8f25866..632b66f3b3001dc30e87fd75fa0d5453c749f796 100644
--- a/ios/chrome/browser/autofill/form_suggestion_controller.mm
+++ b/ios/chrome/browser/autofill/form_suggestion_controller.mm
@@ -4,6 +4,7 @@
#import "ios/chrome/browser/autofill/form_suggestion_controller.h"
+#include "base/ios/ios_util.h"
#include "base/ios/weak_nsobject.h"
#include "base/mac/foundation_util.h"
#include "base/mac/scoped_block.h"
@@ -18,6 +19,7 @@
#import "ios/chrome/browser/autofill/form_suggestion_provider.h"
#import "ios/chrome/browser/autofill/form_suggestion_view.h"
#import "ios/chrome/browser/passwords/password_generation_utils.h"
+#include "ios/chrome/browser/ui/ui_util.h"
#include "ios/web/public/url_scheme_util.h"
#import "ios/web/public/web_state/crw_web_view_proxy.h"
#import "ios/web/public/web_state/js/crw_js_injection_receiver.h"
@@ -262,11 +264,11 @@ AutofillSuggestionState::AutofillSuggestionState(const std::string& form_name,
}
- (void)updateKeyboard:(AutofillSuggestionState*)suggestionState {
- if (!_suggestionState) {
+ if (!suggestionState) {
if (accessoryViewUpdateBlock_)
accessoryViewUpdateBlock_.get()(nil, self);
} else {
- [self updateKeyboardWithSuggestions:_suggestionState->suggestions];
+ [self updateKeyboardWithSuggestions:suggestionState->suggestions];
}
}
@@ -278,8 +280,14 @@ AutofillSuggestionState::AutofillSuggestionState(const std::string& form_name,
}
- (UIView*)suggestionViewWithSuggestions:(NSArray*)suggestions {
+ CGRect frame = [_webViewProxy getKeyboardAccessory].frame;
+ // Force the desired height on iPads running iOS 9 or later where the height
+ // of the inputAccessoryView is 0.
+ if (base::ios::IsRunningOnIOS9OrLater() && IsIPadIdiom()) {
+ frame.size.height = autofill::kInputAccessoryHeight;
+ }
base::scoped_nsobject<FormSuggestionView> view([[FormSuggestionView alloc]
- initWithFrame:[_webViewProxy getKeyboardAccessory].frame
+ initWithFrame:frame
client:self
suggestions:suggestions]);
return view.autorelease();

Powered by Google App Engine
This is Rietveld 408576698