summaryrefslogtreecommitdiffstats
path: root/ios
diff options
context:
space:
mode:
authordconnelly <dconnelly@chromium.org>2015-04-20 01:50:28 -0700
committerCommit bot <commit-bot@chromium.org>2015-04-20 08:51:37 +0000
commitd2dd476b17586f5e9e1332bed33d9c0c48a482a8 (patch)
tree5ebc238b1b00ddce9fbd64fa46e408b55ceeb306 /ios
parent0e4084ddffe25cf2a0dfa106458f10de0588b805 (diff)
downloadchromium_src-d2dd476b17586f5e9e1332bed33d9c0c48a482a8.zip
chromium_src-d2dd476b17586f5e9e1332bed33d9c0c48a482a8.tar.gz
chromium_src-d2dd476b17586f5e9e1332bed33d9c0c48a482a8.tar.bz2
Rename some ios autofill things.
BUG=none Review URL: https://codereview.chromium.org/1095493003 Cr-Commit-Position: refs/heads/master@{#325806}
Diffstat (limited to 'ios')
-rw-r--r--ios/chrome/browser/autofill/form_input_accessory_view_controller.h22
-rw-r--r--ios/chrome/browser/autofill/form_input_accessory_view_controller.mm10
-rw-r--r--ios/chrome/browser/autofill/form_suggestion_controller.mm37
3 files changed, 36 insertions, 33 deletions
diff --git a/ios/chrome/browser/autofill/form_input_accessory_view_controller.h b/ios/chrome/browser/autofill/form_input_accessory_view_controller.h
index 1ecb8ef..ad31dae 100644
--- a/ios/chrome/browser/autofill/form_input_accessory_view_controller.h
+++ b/ios/chrome/browser/autofill/form_input_accessory_view_controller.h
@@ -42,22 +42,23 @@ typedef void (^AccessoryViewReadyCompletion)(
// Determines asynchronously if this provider has a view available for the
// specified form/field and invokes |completionHandler| with the answer.
-- (void)checkIfAccessoryViewAvailableForFormNamed:(const std::string&)formName
- fieldName:(const std::string&)fieldName
- webState:(web::WebState*)webState
- completionHandler:
- (AccessoryViewAvailableCompletion)
- completionHandler;
+- (void)
+ checkIfAccessoryViewIsAvailableForFormNamed:(const std::string&)formName
+ fieldName:(const std::string&)fieldName
+ webState:(web::WebState*)webState
+ completionHandler:
+ (AccessoryViewAvailableCompletion)
+ completionHandler;
// Asynchronously retrieves an accessory view from this provider for the
-// specified form/field and returns it via |completionHandler|.
+// specified form/field and returns it via |accessoryViewUpdateBlock|.
- (void)retrieveAccessoryViewForFormNamed:(const std::string&)formName
fieldName:(const std::string&)fieldName
value:(const std::string&)value
type:(const std::string&)type
webState:(web::WebState*)webState
- completionHandler:
- (AccessoryViewReadyCompletion)completionHandler;
+ accessoryViewUpdateBlock:
+ (AccessoryViewReadyCompletion)accessoryViewUpdateBlock;
// Notifies this provider that the accessory view is going away.
- (void)inputAccessoryViewControllerDidReset:
@@ -65,8 +66,7 @@ typedef void (^AccessoryViewReadyCompletion)(
// Notifies this provider that the accessory view frame is changing. If the
// view provided by this provider needs to change, the updated view should be
-// returned using the completion received in
-// |retrieveAccessoryViewForForm:field:value:type:webState:completionHandler:|.
+// set using |accessoryViewUpdateBlock|.
- (void)resizeAccessoryView;
@end
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 97cf164..c05d591 100644
--- a/ios/chrome/browser/autofill/form_input_accessory_view_controller.mm
+++ b/ios/chrome/browser/autofill/form_input_accessory_view_controller.mm
@@ -433,10 +433,10 @@ bool ComputeFramesOfKeyboardParts(UIView* inputAccessoryView,
return;
id<FormInputAccessoryViewProvider> provider =
strongSelf.get()->_providers[i];
- [provider checkIfAccessoryViewAvailableForFormNamed:strongFormName
- fieldName:strongFieldName
- webState:webState
- completionHandler:completion];
+ [provider checkIfAccessoryViewIsAvailableForFormNamed:strongFormName
+ fieldName:strongFieldName
+ webState:webState
+ completionHandler:completion];
},
base::scoped_policy::RETAIN);
[findProviderBlocks addObject:block];
@@ -476,7 +476,7 @@ bool ComputeFramesOfKeyboardParts(UIView* inputAccessoryView,
value:strongValue
type:strongType
webState:webState
- completionHandler:readyCompletion];
+ accessoryViewUpdateBlock:readyCompletion];
};
// Run all the blocks in |findProviderBlocks| until one invokes its
diff --git a/ios/chrome/browser/autofill/form_suggestion_controller.mm b/ios/chrome/browser/autofill/form_suggestion_controller.mm
index d8a0a52..89f5fbc 100644
--- a/ios/chrome/browser/autofill/form_suggestion_controller.mm
+++ b/ios/chrome/browser/autofill/form_suggestion_controller.mm
@@ -52,7 +52,8 @@ AutofillSuggestionState::AutofillSuggestionState(const std::string& form_name,
base::WeakNSProtocol<id<FormInputAccessoryViewDelegate>> _delegate;
// Callback to update the accessory view.
- base::mac::ScopedBlock<AccessoryViewReadyCompletion> completionHandler_;
+ base::mac::ScopedBlock<AccessoryViewReadyCompletion>
+ accessoryViewUpdateBlock_;
// Autofill suggestion state.
scoped_ptr<AutofillSuggestionState> _suggestionState;
@@ -261,17 +262,18 @@ AutofillSuggestionState::AutofillSuggestionState(const std::string& form_name,
- (void)updateKeyboard:(AutofillSuggestionState*)suggestionState {
if (!_suggestionState) {
- if (completionHandler_)
- completionHandler_.get()(nil, self);
+ if (accessoryViewUpdateBlock_)
+ accessoryViewUpdateBlock_.get()(nil, self);
} else {
[self updateKeyboardWithSuggestions:_suggestionState->suggestions];
}
}
- (void)updateKeyboardWithSuggestions:(NSArray*)suggestions {
- if (completionHandler_)
- completionHandler_.get()([self suggestionViewWithSuggestions:suggestions],
- self);
+ if (accessoryViewUpdateBlock_) {
+ accessoryViewUpdateBlock_.get()(
+ [self suggestionViewWithSuggestions:suggestions], self);
+ }
}
- (UIView*)suggestionViewWithSuggestions:(NSArray*)suggestions {
@@ -312,12 +314,13 @@ AutofillSuggestionState::AutofillSuggestionState(const std::string& form_name,
_delegate.reset(delegate);
}
-- (void)checkIfAccessoryViewAvailableForFormNamed:(const std::string&)formName
- fieldName:(const std::string&)fieldName
- webState:(web::WebState*)webState
- completionHandler:
- (AccessoryViewAvailableCompletion)
- completionHandler {
+- (void)
+ checkIfAccessoryViewIsAvailableForFormNamed:(const std::string&)formName
+ fieldName:(const std::string&)fieldName
+ webState:(web::WebState*)webState
+ completionHandler:
+ (AccessoryViewAvailableCompletion)
+ completionHandler {
[self processPage:webState];
completionHandler(YES);
}
@@ -327,12 +330,12 @@ AutofillSuggestionState::AutofillSuggestionState(const std::string& form_name,
value:(const std::string&)value
type:(const std::string&)type
webState:(web::WebState*)webState
- completionHandler:
- (AccessoryViewReadyCompletion)completionHandler {
+ accessoryViewUpdateBlock:
+ (AccessoryViewReadyCompletion)accessoryViewUpdateBlock {
_suggestionState.reset(
new AutofillSuggestionState(formName, fieldName, value));
- completionHandler([self suggestionViewWithSuggestions:@[]], self);
- completionHandler_.reset([completionHandler copy]);
+ accessoryViewUpdateBlock([self suggestionViewWithSuggestions:@[]], self);
+ accessoryViewUpdateBlock_.reset([accessoryViewUpdateBlock copy]);
[self retrieveSuggestionsForFormNamed:formName
fieldName:fieldName
type:type
@@ -341,7 +344,7 @@ AutofillSuggestionState::AutofillSuggestionState(const std::string& form_name,
- (void)inputAccessoryViewControllerDidReset:
(FormInputAccessoryViewController*)controller {
- completionHandler_.reset();
+ accessoryViewUpdateBlock_.reset();
[self resetSuggestionState];
}