Commit 1c43744b authored by Javier Ernesto Flores Robles's avatar Javier Ernesto Flores Robles Committed by Commit Bot

[iOS][MF] Rename ManualFillContentDelegate to ManualFillContentInjector

Bug: 1000660
Change-Id: I11175c2e13f9751bacf095011d1a4c792c284afa
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1784723Reviewed-by: default avatarYi Su <mrsuyi@chromium.org>
Commit-Queue: Javier Ernesto Flores Robles <javierrobles@chromium.org>
Cr-Commit-Position: refs/heads/master@{#693872}
parent e0ba92a4
......@@ -99,7 +99,7 @@ source_set("manual_fill_ui") {
"manual_fill_cell_button.mm",
"manual_fill_cell_utils.h",
"manual_fill_cell_utils.mm",
"manual_fill_content_delegate.h",
"manual_fill_content_injector.h",
"manual_fill_password_cell.h",
"manual_fill_password_cell.mm",
"password_consumer.h",
......
......@@ -74,7 +74,7 @@ initWithBaseViewController:(UIViewController*)viewController
_addressMediator =
[[ManualFillAddressMediator alloc] initWithProfiles:profiles];
_addressMediator.navigationDelegate = self;
_addressMediator.contentDelegate = self.manualFillInjectionHandler;
_addressMediator.contentInjector = self.manualFillInjectionHandler;
_addressMediator.consumer = _addressViewController;
}
return self;
......
......@@ -12,7 +12,7 @@ namespace autofill {
class AutofillProfile;
} // namespace autofill
@protocol ManualFillContentDelegate;
@protocol ManualFillContentInjector;
@protocol ManualFillAddressConsumer;
@protocol AddressListDelegate;
......@@ -28,7 +28,7 @@ extern NSString* const ManageAddressAccessibilityIdentifier;
@property(nonatomic, weak) id<ManualFillAddressConsumer> consumer;
// The delegate in charge of using the content selected by the user.
@property(nonatomic, weak) id<ManualFillContentDelegate> contentDelegate;
@property(nonatomic, weak) id<ManualFillContentInjector> contentInjector;
// The delegate in charge of navigation.
@property(nonatomic, weak) id<AddressListDelegate> navigationDelegate;
......
......@@ -14,7 +14,7 @@
#import "ios/chrome/browser/ui/autofill/manual_fill/address_form.h"
#import "ios/chrome/browser/ui/autofill/manual_fill/address_list_delegate.h"
#import "ios/chrome/browser/ui/autofill/manual_fill/manual_fill_address_cell.h"
#import "ios/chrome/browser/ui/autofill/manual_fill/manual_fill_content_delegate.h"
#import "ios/chrome/browser/ui/autofill/manual_fill/manual_fill_content_injector.h"
#import "ios/chrome/browser/ui/list_model/list_model.h"
#import "ios/chrome/browser/ui/table_view/table_view_model.h"
#include "ios/chrome/grit/ios_strings.h"
......@@ -77,7 +77,7 @@ NSString* const ManageAddressAccessibilityIdentifier =
for (ManualFillAddress* address in self.addresses) {
auto item =
[[ManualFillAddressItem alloc] initWithAddress:address
delegate:self.contentDelegate];
contentInjector:self.contentInjector];
[items addObject:item];
}
......
......@@ -76,7 +76,7 @@ NSString* const kPasswordDoneButtonAccessibilityIdentifier =
[_passwordMediator fetchPasswordsForURL:GURL::EmptyGURL()];
_passwordMediator.actionSectionEnabled = NO;
_passwordMediator.consumer = _passwordViewController;
_passwordMediator.contentDelegate = injectionHandler;
_passwordMediator.contentInjector = injectionHandler;
_passwordMediator.navigator = navigator;
_passwordViewController.imageDataSource = _passwordMediator;
......
......@@ -77,7 +77,7 @@ initWithBaseViewController:(UIViewController*)viewController
_cardMediator = [[ManualFillCardMediator alloc] initWithCards:cards];
_cardMediator.navigationDelegate = self;
_cardMediator.contentDelegate = self.manualFillInjectionHandler;
_cardMediator.contentInjector = self.manualFillInjectionHandler;
_cardMediator.consumer = _cardViewController;
_cardRequester = [[ManualFillFullCardRequester alloc]
......
......@@ -14,7 +14,7 @@ namespace autofill {
class CreditCard;
} // namespace autofill
@protocol ManualFillContentDelegate;
@protocol ManualFillContentInjector;
@protocol ManualFillCardConsumer;
@protocol CardListDelegate;
......@@ -32,7 +32,7 @@ extern NSString* const ManageCardsAccessibilityIdentifier;
@property(nonatomic, weak) id<ManualFillCardConsumer> consumer;
// The delegate in charge of using the content selected by the user.
@property(nonatomic, weak) id<ManualFillContentDelegate> contentDelegate;
@property(nonatomic, weak) id<ManualFillContentInjector> contentInjector;
// The delegate in charge of navigation.
@property(nonatomic, weak) id<CardListDelegate> navigationDelegate;
......
......@@ -18,7 +18,7 @@
#import "ios/chrome/browser/ui/autofill/manual_fill/credit_card_form.h"
#import "ios/chrome/browser/ui/autofill/manual_fill/full_card_request_result_delegate_bridge.h"
#import "ios/chrome/browser/ui/autofill/manual_fill/manual_fill_card_cell.h"
#import "ios/chrome/browser/ui/autofill/manual_fill/manual_fill_content_delegate.h"
#import "ios/chrome/browser/ui/autofill/manual_fill/manual_fill_content_injector.h"
#import "ios/chrome/browser/ui/list_model/list_model.h"
#import "ios/chrome/browser/ui/settings/autofill/features.h"
#import "ios/chrome/browser/ui/table_view/table_view_model.h"
......@@ -101,7 +101,7 @@ NSString* const ManageCardsAccessibilityIdentifier =
[[ManualFillCreditCard alloc] initWithCreditCard:*card];
auto item =
[[ManualFillCardItem alloc] initWithCreditCard:manualFillCreditCard
contentDelegate:self.contentDelegate
contentInjector:self.contentInjector
navigationDelegate:self.navigationDelegate];
[items addObject:item];
}
......@@ -153,7 +153,7 @@ NSString* const ManageCardsAccessibilityIdentifier =
[[ManualFillCreditCard alloc] initWithCreditCard:card];
// Don't replace the locked card with the unlocked one, so the user will
// have to unlock it again, if needed.
[self.contentDelegate userDidPickContent:manualFillCreditCard.number
[self.contentInjector userDidPickContent:manualFillCreditCard.number
passwordField:NO
requiresHTTPS:YES];
}
......
......@@ -12,14 +12,14 @@
// TODO(crbug.com/845472): rename, see
// https://crrev.com/c/1317853/7/ios/chrome/browser/ui/autofill/manual_fill/manual_fill_address_cell.h#17.
@protocol ManualFillContentDelegate;
@protocol ManualFillContentInjector;
// Wrapper to show address cells in a ChromeTableViewController.
@interface ManualFillAddressItem : TableViewItem
// Inits an address with a |profile| and the |delegate| for user selection.
- (instancetype)initWithAddress:(ManualFillAddress*)address
delegate:(id<ManualFillContentDelegate>)delegate
contentInjector:(id<ManualFillContentInjector>)contentInjector
NS_DESIGNATED_INITIALIZER;
- (instancetype)initWithType:(NSInteger)type NS_UNAVAILABLE;
......@@ -32,7 +32,7 @@
// Updates the cell with address and the |delegate| to be notified.
- (void)setUpWithAddress:(ManualFillAddress*)profile
delegate:(id<ManualFillContentDelegate>)delegate;
contentInjector:(id<ManualFillContentInjector>)contentInjector;
@end
......
......@@ -6,7 +6,7 @@
#include "base/metrics/user_metrics.h"
#import "ios/chrome/browser/ui/autofill/manual_fill/manual_fill_cell_utils.h"
#import "ios/chrome/browser/ui/autofill/manual_fill/manual_fill_content_delegate.h"
#import "ios/chrome/browser/ui/autofill/manual_fill/manual_fill_content_injector.h"
#import "ios/chrome/browser/ui/list_model/list_model.h"
#import "ios/chrome/common/colors/semantic_color_names.h"
#import "ios/chrome/common/ui_util/constraints_ui_util.h"
......@@ -18,7 +18,8 @@
@interface ManualFillAddressItem ()
// The content delegate for this item.
@property(nonatomic, weak, readonly) id<ManualFillContentDelegate> delegate;
@property(nonatomic, weak, readonly) id<ManualFillContentInjector>
contentInjector;
// The address/profile for this item.
@property(nonatomic, readonly) ManualFillAddress* address;
......@@ -28,10 +29,10 @@
@implementation ManualFillAddressItem
- (instancetype)initWithAddress:(ManualFillAddress*)address
delegate:(id<ManualFillContentDelegate>)delegate {
contentInjector:(id<ManualFillContentInjector>)contentInjector {
self = [super initWithType:kItemTypeEnumZero];
if (self) {
_delegate = delegate;
_contentInjector = contentInjector;
_address = address;
self.cellClass = [ManualFillAddressCell class];
}
......@@ -41,7 +42,7 @@
- (void)configureCell:(ManualFillAddressCell*)cell
withStyler:(ChromeTableViewStyler*)styler {
[super configureCell:cell withStyler:styler];
[cell setUpWithAddress:self.address delegate:self.delegate];
[cell setUpWithAddress:self.address contentInjector:self.contentInjector];
}
@end
......@@ -95,7 +96,7 @@
@property(nonatomic, strong) UIButton* emailAddressButton;
// The content delegate for this item.
@property(nonatomic, weak) id<ManualFillContentDelegate> delegate;
@property(nonatomic, weak) id<ManualFillContentInjector> contentInjector;
@end
......@@ -121,15 +122,15 @@
[self.countryButton setTitle:@"" forState:UIControlStateNormal];
[self.phoneNumberButton setTitle:@"" forState:UIControlStateNormal];
[self.emailAddressButton setTitle:@"" forState:UIControlStateNormal];
self.delegate = nil;
self.contentInjector = nil;
}
- (void)setUpWithAddress:(ManualFillAddress*)address
delegate:(id<ManualFillContentDelegate>)delegate {
contentInjector:(id<ManualFillContentInjector>)contentInjector {
if (self.contentView.subviews.count == 0) {
[self createViewHierarchy];
}
self.delegate = delegate;
self.contentInjector = contentInjector;
NSMutableArray<UIView*>* verticalLeadViews = [[NSMutableArray alloc] init];
UIView* guide = self.grayLine;
......@@ -471,9 +472,9 @@
DCHECK(metricsAction);
base::RecordAction(base::UserMetricsAction(metricsAction));
[self.delegate userDidPickContent:sender.titleLabel.text
passwordField:NO
requiresHTTPS:NO];
[self.contentInjector userDidPickContent:sender.titleLabel.text
passwordField:NO
requiresHTTPS:NO];
}
@end
......@@ -11,14 +11,14 @@
#import "ios/chrome/browser/ui/table_view/cells/table_view_item.h"
@protocol CardListDelegate;
@protocol ManualFillContentDelegate;
@protocol ManualFillContentInjector;
// Wrapper to show card cells in a ChromeTableViewController.
@interface ManualFillCardItem : TableViewItem
- (instancetype)initWithCreditCard:(ManualFillCreditCard*)card
contentDelegate:
(id<ManualFillContentDelegate>)contentDelegate
contentInjector:
(id<ManualFillContentInjector>)contentInjector
navigationDelegate:(id<CardListDelegate>)navigationDelegate
NS_DESIGNATED_INITIALIZER;
......@@ -32,7 +32,7 @@
// Updates the cell with credit card and the |delegate| to be notified.
- (void)setUpWithCreditCard:(ManualFillCreditCard*)card
contentDelegate:(id<ManualFillContentDelegate>)contentDelegate
contentInjector:(id<ManualFillContentInjector>)contentInjector
navigationDelegate:(id<CardListDelegate>)navigationDelegate;
@end
......
......@@ -10,7 +10,7 @@
#import "ios/chrome/browser/ui/autofill/manual_fill/card_list_delegate.h"
#import "ios/chrome/browser/ui/autofill/manual_fill/credit_card.h"
#import "ios/chrome/browser/ui/autofill/manual_fill/manual_fill_cell_utils.h"
#import "ios/chrome/browser/ui/autofill/manual_fill/manual_fill_content_delegate.h"
#import "ios/chrome/browser/ui/autofill/manual_fill/manual_fill_content_injector.h"
#import "ios/chrome/browser/ui/list_model/list_model.h"
#import "ios/chrome/browser/ui/util/uikit_ui_util.h"
#import "ios/chrome/common/colors/semantic_color_names.h"
......@@ -25,8 +25,8 @@
@interface ManualFillCardItem ()
// The content delegate for this item.
@property(nonatomic, weak, readonly) id<ManualFillContentDelegate>
contentDelegate;
@property(nonatomic, weak, readonly) id<ManualFillContentInjector>
contentInjector;
// The navigation delegate for this item.
@property(nonatomic, weak, readonly) id<CardListDelegate> navigationDelegate;
......@@ -39,12 +39,12 @@
@implementation ManualFillCardItem
- (instancetype)initWithCreditCard:(ManualFillCreditCard*)card
contentDelegate:
(id<ManualFillContentDelegate>)contentDelegate
contentInjector:
(id<ManualFillContentInjector>)contentInjector
navigationDelegate:(id<CardListDelegate>)navigationDelegate {
self = [super initWithType:kItemTypeEnumZero];
if (self) {
_contentDelegate = contentDelegate;
_contentInjector = contentInjector;
_navigationDelegate = navigationDelegate;
_card = card;
self.cellClass = [ManualFillCardCell class];
......@@ -56,7 +56,7 @@
withStyler:(ChromeTableViewStyler*)styler {
[super configureCell:cell withStyler:styler];
[cell setUpWithCreditCard:self.card
contentDelegate:self.contentDelegate
contentInjector:self.contentInjector
navigationDelegate:self.navigationDelegate];
}
......@@ -87,7 +87,7 @@
@property(nonatomic, strong) UIButton* expirationYearButton;
// The content delegate for this item.
@property(nonatomic, weak) id<ManualFillContentDelegate> contentDelegate;
@property(nonatomic, weak) id<ManualFillContentInjector> contentInjector;
// The navigation delegate for this item.
@property(nonatomic, weak) id<CardListDelegate> navigationDelegate;
......@@ -116,14 +116,14 @@
self.cardNumberButton.hidden = NO;
self.cardholderButton.hidden = NO;
self.contentDelegate = nil;
self.contentInjector = nil;
self.navigationDelegate = nil;
self.cardIcon.image = nil;
self.card = nil;
}
- (void)setUpWithCreditCard:(ManualFillCreditCard*)card
contentDelegate:(id<ManualFillContentDelegate>)contentDelegate
contentInjector:(id<ManualFillContentInjector>)contentInjector
navigationDelegate:(id<CardListDelegate>)navigationDelegate {
if (!self.dynamicConstraints) {
self.dynamicConstraints = [[NSMutableArray alloc] init];
......@@ -132,7 +132,7 @@
if (self.contentView.subviews.count == 0) {
[self createViewHierarchy];
}
self.contentDelegate = contentDelegate;
self.contentInjector = contentInjector;
self.navigationDelegate = navigationDelegate;
self.card = card;
......@@ -262,7 +262,7 @@
- (void)userDidTapCardNumber:(UIButton*)sender {
NSString* number = self.card.number;
if (![self.contentDelegate canUserInjectInPasswordField:NO
if (![self.contentInjector canUserInjectInPasswordField:NO
requiresHTTPS:YES]) {
return;
}
......@@ -271,7 +271,7 @@
if (!number.length) {
[self.navigationDelegate requestFullCreditCard:self.card];
} else {
[self.contentDelegate userDidPickContent:number
[self.contentInjector userDidPickContent:number
passwordField:NO
requiresHTTPS:YES];
}
......@@ -289,7 +289,7 @@
DCHECK(metricsAction);
base::RecordAction(base::UserMetricsAction(metricsAction));
[self.contentDelegate userDidPickContent:sender.titleLabel.text
[self.contentInjector userDidPickContent:sender.titleLabel.text
passwordField:NO
requiresHTTPS:NO];
}
......
......@@ -2,14 +2,14 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef IOS_CHROME_BROWSER_UI_AUTOFILL_MANUAL_FILL_MANUAL_FILL_CONTENT_DELEGATE_H_
#define IOS_CHROME_BROWSER_UI_AUTOFILL_MANUAL_FILL_MANUAL_FILL_CONTENT_DELEGATE_H_
#ifndef IOS_CHROME_BROWSER_UI_AUTOFILL_MANUAL_FILL_MANUAL_FILL_CONTENT_INJECTOR_H_
#define IOS_CHROME_BROWSER_UI_AUTOFILL_MANUAL_FILL_MANUAL_FILL_CONTENT_INJECTOR_H_
#import <Foundation/Foundation.h>
// Protocol to send Manual Fill user selections to be filled in the active web
// state.
@protocol ManualFillContentDelegate<NSObject>
@protocol ManualFillContentInjector <NSObject>
// Must be called before |userDidPickContent| to validate if a value type can be
// injected, if either flag is true. If not, an alert is given to the user and
......@@ -35,4 +35,4 @@
@end
#endif // IOS_CHROME_BROWSER_UI_AUTOFILL_MANUAL_FILL_MANUAL_FILL_CONTENT_DELEGATE_H_
#endif // IOS_CHROME_BROWSER_UI_AUTOFILL_MANUAL_FILL_MANUAL_FILL_CONTENT_INJECTOR_H_
......@@ -7,7 +7,7 @@
#import <UIKit/UIKit.h>
#import "ios/chrome/browser/ui/autofill/manual_fill/manual_fill_content_delegate.h"
#import "ios/chrome/browser/ui/autofill/manual_fill/manual_fill_content_injector.h"
@protocol AutofillSecurityAlertPresenter<NSObject>
......@@ -22,7 +22,7 @@
class WebStateList;
// Handler with the common logic for injecting data from manual fill.
@interface ManualFillInjectionHandler : NSObject<ManualFillContentDelegate>
@interface ManualFillInjectionHandler : NSObject <ManualFillContentInjector>
// Returns a handler using the |WebStateList| to inject JS to the active web
// state and |securityAlertPresenter| to present alerts.
......
......@@ -93,7 +93,7 @@ const int64_t kJavaScriptExecutionTimeoutInSeconds = 1;
return self;
}
#pragma mark - ManualFillContentDelegate
#pragma mark - ManualFillContentInjector
- (BOOL)canUserInjectInPasswordField:(BOOL)passwordField
requiresHTTPS:(BOOL)requiresHTTPS {
......
......@@ -12,7 +12,7 @@
@class FaviconAttributes;
@class FaviconView;
class GURL;
@protocol ManualFillContentDelegate;
@protocol ManualFillContentInjector;
@class ManualFillCredential;
// Wrapper to show password cells in a ChromeTableViewController.
......@@ -31,7 +31,8 @@ class GURL;
- (instancetype)initWithCredential:(ManualFillCredential*)credential
isConnectedToPreviousItem:(BOOL)isConnectedToPreviousItem
isConnectedToNextItem:(BOOL)isConnectedToNextItem
delegate:(id<ManualFillContentDelegate>)delegate
contentInjector:
(id<ManualFillContentInjector>)contentInjector
NS_DESIGNATED_INITIALIZER;
- (instancetype)initWithType:(NSInteger)type NS_UNAVAILABLE;
......@@ -50,7 +51,7 @@ class GURL;
- (void)setUpWithCredential:(ManualFillCredential*)credential
isConnectedToPreviousCell:(BOOL)isConnectedToPreviousCell
isConnectedToNextCell:(BOOL)isConnectedToNextCell
delegate:(id<ManualFillContentDelegate>)delegate;
contentInjector:(id<ManualFillContentInjector>)contentInjector;
// Configures the cell for the passed favicon attributes.
- (void)configureWithFaviconAttributes:(FaviconAttributes*)attributes;
......
......@@ -9,7 +9,7 @@
#import "ios/chrome/browser/favicon/favicon_loader.h"
#import "ios/chrome/browser/ui/autofill/manual_fill/credential.h"
#import "ios/chrome/browser/ui/autofill/manual_fill/manual_fill_cell_utils.h"
#import "ios/chrome/browser/ui/autofill/manual_fill/manual_fill_content_delegate.h"
#import "ios/chrome/browser/ui/autofill/manual_fill/manual_fill_content_injector.h"
#import "ios/chrome/browser/ui/list_model/list_model.h"
#import "ios/chrome/common/colors/semantic_color_names.h"
#import "ios/chrome/common/favicon/favicon_view.h"
......@@ -36,7 +36,8 @@
@property(nonatomic, assign) BOOL isConnectedToNextItem;
// The delegate for this item.
@property(nonatomic, weak, readonly) id<ManualFillContentDelegate> delegate;
@property(nonatomic, weak, readonly) id<ManualFillContentInjector>
contentInjector;
@end
......@@ -45,13 +46,14 @@
- (instancetype)initWithCredential:(ManualFillCredential*)credential
isConnectedToPreviousItem:(BOOL)isConnectedToPreviousItem
isConnectedToNextItem:(BOOL)isConnectedToNextItem
delegate:(id<ManualFillContentDelegate>)delegate {
contentInjector:
(id<ManualFillContentInjector>)contentInjector {
self = [super initWithType:kItemTypeEnumZero];
if (self) {
_credential = credential;
_isConnectedToPreviousItem = isConnectedToPreviousItem;
_isConnectedToNextItem = isConnectedToNextItem;
_delegate = delegate;
_contentInjector = contentInjector;
self.cellClass = [ManualFillPasswordCell class];
}
return self;
......@@ -63,7 +65,7 @@
[cell setUpWithCredential:self.credential
isConnectedToPreviousCell:self.isConnectedToPreviousItem
isConnectedToNextCell:self.isConnectedToNextItem
delegate:self.delegate];
contentInjector:self.contentInjector];
}
- (const GURL&)faviconURL {
......@@ -115,7 +117,7 @@ static const CGFloat NoMultiplier = 1.0;
@property(nonatomic, strong) UIView* grayLine;
// The delegate in charge of processing the user actions in this cell.
@property(nonatomic, weak) id<ManualFillContentDelegate> delegate;
@property(nonatomic, weak) id<ManualFillContentInjector> contentInjector;
@end
......@@ -151,11 +153,11 @@ static const CGFloat NoMultiplier = 1.0;
- (void)setUpWithCredential:(ManualFillCredential*)credential
isConnectedToPreviousCell:(BOOL)isConnectedToPreviousCell
isConnectedToNextCell:(BOOL)isConnectedToNextCell
delegate:(id<ManualFillContentDelegate>)delegate {
contentInjector:(id<ManualFillContentInjector>)contentInjector {
if (self.contentView.subviews.count == 0) {
[self createViewHierarchy];
}
self.delegate = delegate;
self.contentInjector = contentInjector;
self.credential = credential;
NSMutableArray<UIView*>* verticalLeadViews = [[NSMutableArray alloc] init];
......@@ -309,20 +311,21 @@ static const CGFloat NoMultiplier = 1.0;
- (void)userDidTapUsernameButton:(UIButton*)button {
base::RecordAction(
base::UserMetricsAction("ManualFallback_Password_SelectUsername"));
[self.delegate userDidPickContent:self.credential.username
passwordField:NO
requiresHTTPS:NO];
[self.contentInjector userDidPickContent:self.credential.username
passwordField:NO
requiresHTTPS:NO];
}
- (void)userDidTapPasswordButton:(UIButton*)button {
if (![self.delegate canUserInjectInPasswordField:YES requiresHTTPS:YES]) {
if (![self.contentInjector canUserInjectInPasswordField:YES
requiresHTTPS:YES]) {
return;
}
base::RecordAction(
base::UserMetricsAction("ManualFallback_Password_SelectPassword"));
[self.delegate userDidPickContent:self.credential.password
passwordField:YES
requiresHTTPS:YES];
[self.contentInjector userDidPickContent:self.credential.password
passwordField:YES
requiresHTTPS:YES];
}
@end
......@@ -68,7 +68,7 @@
_passwordMediator.actionSectionEnabled = YES;
_passwordMediator.consumer = _passwordViewController;
_passwordMediator.navigator = self;
_passwordMediator.contentDelegate = injectionHandler;
_passwordMediator.contentInjector = injectionHandler;
_passwordViewController.imageDataSource = _passwordMediator;
}
......
......@@ -10,7 +10,7 @@
#include "base/memory/ref_counted.h"
#import "ios/chrome/browser/ui/table_view/table_view_favicon_data_source.h"
@protocol ManualFillContentDelegate;
@protocol ManualFillContentInjector;
@protocol ManualFillPasswordConsumer;
@protocol PasswordListNavigator;
......@@ -39,7 +39,7 @@ extern NSString* const SuggestPasswordAccessibilityIdentifier;
// methods with the current data.
@property(nonatomic, weak) id<ManualFillPasswordConsumer> consumer;
// The delegate in charge of using the content selected by the user.
@property(nonatomic, weak) id<ManualFillContentDelegate> contentDelegate;
@property(nonatomic, weak) id<ManualFillContentInjector> contentInjector;
// The object in charge of navigation.
@property(nonatomic, weak) id<PasswordListNavigator> navigator;
// If YES actions will be post to the consumer. Set this value before
......
......@@ -15,7 +15,7 @@
#import "ios/chrome/browser/ui/autofill/manual_fill/action_cell.h"
#import "ios/chrome/browser/ui/autofill/manual_fill/credential.h"
#import "ios/chrome/browser/ui/autofill/manual_fill/credential_password_form.h"
#import "ios/chrome/browser/ui/autofill/manual_fill/manual_fill_content_delegate.h"
#import "ios/chrome/browser/ui/autofill/manual_fill/manual_fill_content_injector.h"
#import "ios/chrome/browser/ui/autofill/manual_fill/manual_fill_password_cell.h"
#import "ios/chrome/browser/ui/autofill/manual_fill/password_consumer.h"
#import "ios/chrome/browser/ui/autofill/manual_fill/password_list_navigator.h"
......@@ -59,7 +59,7 @@ BOOL AreCredentialsAtIndexesConnected(
isEqualToString:credentials[secondIndex].host];
}
@interface ManualFillPasswordMediator () <ManualFillContentDelegate,
@interface ManualFillPasswordMediator () <ManualFillContentInjector,
PasswordFetcherDelegate> {
// The interface for getting and manipulating a user's saved passwords.
scoped_refptr<password_manager::PasswordStore> _passwordStore;
......@@ -182,7 +182,7 @@ BOOL AreCredentialsAtIndexesConnected(
initWithCredential:credential
isConnectedToPreviousItem:isConnectedToPreviousItem
isConnectedToNextItem:isConnectedToNextItem
delegate:self];
contentInjector:self];
[items addObject:item];
}
return items;
......@@ -237,11 +237,11 @@ BOOL AreCredentialsAtIndexesConnected(
[self postDataToConsumer];
}
#pragma mark - ManualFillContentDelegate
#pragma mark - ManualFillContentInjector
- (BOOL)canUserInjectInPasswordField:(BOOL)passwordField
requiresHTTPS:(BOOL)requiresHTTPS {
return [self.contentDelegate canUserInjectInPasswordField:passwordField
return [self.contentInjector canUserInjectInPasswordField:passwordField
requiresHTTPS:requiresHTTPS];
}
......@@ -249,7 +249,7 @@ BOOL AreCredentialsAtIndexesConnected(
passwordField:(BOOL)passwordField
requiresHTTPS:(BOOL)requiresHTTPS {
[self.navigator dismissPresentedViewController];
[self.contentDelegate userDidPickContent:content
[self.contentInjector userDidPickContent:content
passwordField:passwordField
requiresHTTPS:requiresHTTPS];
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment