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