Commit 830919ba authored by Scott Wu's avatar Scott Wu Committed by Commit Bot

Rename PasswordControllerHelper to PasswordFormHelper

Bug: 865114
Cq-Include-Trybots: luci.chromium.try:ios-simulator-cronet;luci.chromium.try:ios-simulator-full-configs
Change-Id: If08aa34d7c17e9f5a6dabb818669012275443587
Reviewed-on: https://chromium-review.googlesource.com/c/1278670
Commit-Queue: Scott Wu <scottwu@chromium.org>
Reviewed-by: default avatarHiroshi Ichikawa <ichikawa@chromium.org>
Reviewed-by: default avatarVadym Doroshenko <dvadym@chromium.org>
Cr-Commit-Position: refs/heads/master@{#599167}
parent e2dd9b16
......@@ -23,8 +23,8 @@ component("ios") {
"account_select_fill_data.h",
"js_password_manager.h",
"js_password_manager.mm",
"password_controller_helper.h",
"password_controller_helper.mm",
"password_form_helper.h",
"password_form_helper.mm",
"password_suggestion_helper.h",
"password_suggestion_helper.mm",
]
......@@ -50,7 +50,7 @@ source_set("unit_tests") {
testonly = true
sources = [
"account_select_fill_data_unittest.cc",
"password_controller_helper_unittest.mm",
"password_form_helper_unittest.mm",
]
deps = [
":ios",
......
......@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef COMPONENTS_PASSWORD_MANAGER_IOS_PASSWORD_CONTROLLER_HELPER_H_
#define COMPONENTS_PASSWORD_MANAGER_IOS_PASSWORD_CONTROLLER_HELPER_H_
#ifndef COMPONENTS_PASSWORD_MANAGER_IOS_PASSWORD_FORM_HELPER_H_
#define COMPONENTS_PASSWORD_MANAGER_IOS_PASSWORD_FORM_HELPER_H_
#import <Foundation/Foundation.h>
......@@ -14,7 +14,7 @@
NS_ASSUME_NONNULL_BEGIN
@class JsPasswordManager;
@class PasswordControllerHelper;
@class PasswordFormHelper;
namespace autofill {
struct PasswordForm;
......@@ -33,18 +33,17 @@ namespace web {
class WebState;
} // namespace web
// A protocol implemented by a delegate of PasswordControllerHelper.
@protocol PasswordControllerHelperDelegate
// A protocol implemented by a delegate of PasswordFormHelper.
@protocol PasswordFormHelperDelegate
// Called when the password form is submitted.
- (void)helper:(PasswordControllerHelper*)helper
didSubmitForm:(const autofill::PasswordForm&)form
inMainFrame:(BOOL)inMainFrame;
- (void)formHelper:(PasswordFormHelper*)formHelper
didSubmitForm:(const autofill::PasswordForm&)form
inMainFrame:(BOOL)inMainFrame;
@end
// Handles common logic of password controller for both ios/chrome and
// ios/web_view.
// TODO(crbug.com/865114): Rename to PasswordFormHelper.
@interface PasswordControllerHelper
// Handles common form processing logic of password controller for both
// ios/chrome and ios/web_view.
@interface PasswordFormHelper
: NSObject<FormActivityObserver, CRWWebStateObserver>
// The JsPasswordManager processing password form via javascript.
......@@ -82,8 +81,9 @@ class WebState;
// Creates a instance with the given WebState, observer and delegate.
- (instancetype)initWithWebState:(web::WebState*)webState
delegate:(nullable id<PasswordControllerHelperDelegate>)
delegate NS_DESIGNATED_INITIALIZER;
delegate:
(nullable id<PasswordFormHelperDelegate>)delegate
NS_DESIGNATED_INITIALIZER;
- (instancetype)init NS_UNAVAILABLE;
......@@ -91,4 +91,4 @@ class WebState;
NS_ASSUME_NONNULL_END
#endif // COMPONENTS_PASSWORD_MANAGER_IOS_PASSWORD_CONTROLLER_HELPER_H_
#endif // COMPONENTS_PASSWORD_MANAGER_IOS_PASSWORD_FORM_HELPER_H_
......@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#import "components/password_manager/ios/password_controller_helper.h"
#import "components/password_manager/ios/password_form_helper.h"
#include <stddef.h>
......@@ -48,9 +48,9 @@ namespace {
constexpr char kCommandPrefix[] = "passwordForm";
} // namespace
@interface PasswordControllerHelper ()
@interface PasswordFormHelper ()
@property(nonatomic, weak) id<PasswordControllerHelperDelegate> delegate;
@property(nonatomic, weak) id<PasswordFormHelperDelegate> delegate;
// Handler for injected JavaScript callbacks.
- (BOOL)handleScriptCommand:(const base::DictionaryValue&)JSONCommand;
......@@ -80,14 +80,14 @@ constexpr char kCommandPrefix[] = "passwordForm";
@end
// Category for test only.
@interface PasswordControllerHelper (Testing)
@interface PasswordFormHelper (Testing)
// Replaces JsPasswordManager for test.
- (void)setJsPasswordManager:(JsPasswordManager*)jsPasswordManager;
@end
@implementation PasswordControllerHelper {
@implementation PasswordFormHelper {
// The WebState this instance is observing. Will be null after
// -webStateDestroyed: has been called.
web::WebState* _webState;
......@@ -112,8 +112,7 @@ constexpr char kCommandPrefix[] = "passwordForm";
#pragma mark - Initialization
- (instancetype)initWithWebState:(web::WebState*)webState
delegate:
(id<PasswordControllerHelperDelegate>)delegate {
delegate:(id<PasswordFormHelperDelegate>)delegate {
self = [super init];
if (self) {
DCHECK(webState);
......@@ -127,7 +126,7 @@ constexpr char kCommandPrefix[] = "passwordForm";
_jsPasswordManager = [[JsPasswordManager alloc]
initWithReceiver:_webState->GetJSInjectionReceiver()];
__weak PasswordControllerHelper* weakSelf = self;
__weak PasswordFormHelper* weakSelf = self;
auto callback = base::BindRepeating(
^bool(const base::DictionaryValue& JSON, const GURL& originURL,
bool interacting, bool isMainFrame, web::WebFrame* senderFrame) {
......@@ -181,20 +180,20 @@ constexpr char kCommandPrefix[] = "passwordForm";
// origin.
return;
}
__weak PasswordControllerHelper* weakSelf = self;
__weak PasswordFormHelper* weakSelf = self;
// This code is racing against the new page loading and will not get the
// password form data if the page has changed. In most cases this code wins
// the race.
// TODO(crbug.com/418827): Fix this by passing in more data from the JS side.
id completionHandler = ^(BOOL found, const autofill::PasswordForm& form) {
PasswordControllerHelper* strongSelf = weakSelf;
id<PasswordControllerHelperDelegate> strongDelegate = strongSelf.delegate;
PasswordFormHelper* strongSelf = weakSelf;
id<PasswordFormHelperDelegate> strongDelegate = strongSelf.delegate;
if (!strongSelf || !strongSelf->_webState || !strongDelegate) {
return;
}
[strongDelegate helper:strongSelf
didSubmitForm:form
inMainFrame:formInMainFrame];
[strongDelegate formHelper:strongSelf
didSubmitForm:form
inMainFrame:formInMainFrame];
};
// TODO(crbug.com/418827): Use |formData| instead of extracting form again.
[self extractSubmittedPasswordForm:formName
......@@ -231,7 +230,7 @@ constexpr char kCommandPrefix[] = "passwordForm";
}
if (_webState && self.delegate) {
[self.delegate helper:self didSubmitForm:*form inMainFrame:YES];
[self.delegate formHelper:self didSubmitForm:*form inMainFrame:YES];
return YES;
}
......@@ -343,7 +342,7 @@ constexpr char kCommandPrefix[] = "passwordForm";
return;
}
__weak PasswordControllerHelper* weakSelf = self;
__weak PasswordFormHelper* weakSelf = self;
[self.jsPasswordManager findPasswordFormsWithCompletionHandler:^(
NSString* jsonString) {
std::vector<autofill::PasswordForm> forms;
......@@ -386,10 +385,10 @@ constexpr char kCommandPrefix[] = "passwordForm";
password:(NSString*)password
completionHandler:
(nullable void (^)(BOOL))completionHandler {
__weak PasswordControllerHelper* weakSelf = self;
__weak PasswordFormHelper* weakSelf = self;
[self findPasswordFormsWithCompletionHandler:^(
const std::vector<autofill::PasswordForm>& forms) {
PasswordControllerHelper* strongSelf = weakSelf;
PasswordFormHelper* strongSelf = weakSelf;
for (const auto& form : forms) {
autofill::PasswordFormFillData formData;
std::map<base::string16, const autofill::PasswordForm*> matches;
......
......@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#import "components/password_manager/ios/password_controller_helper.h"
#import "components/password_manager/ios/password_form_helper.h"
#include <stddef.h>
......@@ -16,7 +16,7 @@
#include "components/password_manager/core/browser/stub_password_manager_driver.h"
#include "components/password_manager/ios/account_select_fill_data.h"
#import "components/password_manager/ios/js_password_manager.h"
#import "components/password_manager/ios/password_controller_helper.h"
#import "components/password_manager/ios/password_form_helper.h"
#include "components/password_manager/ios/test_helpers.h"
#include "ios/web/public/test/fakes/test_web_client.h"
#import "ios/web/public/test/web_test_with_web_state.h"
......@@ -38,7 +38,7 @@ using password_manager::FillData;
using test_helpers::SetPasswordFormFillData;
using test_helpers::SetFillData;
@interface PasswordControllerHelper (Testing)
@interface PasswordFormHelper (Testing)
// Provides access to the method below for testing with mocks.
- (void)extractSubmittedPasswordForm:(const std::string&)formName
......@@ -126,17 +126,17 @@ class TestWebClientWithScript : public web::TestWebClient {
}
};
class PasswordControllerHelperTest : public web::WebTestWithWebState {
class PasswordFormHelperTest : public web::WebTestWithWebState {
public:
PasswordControllerHelperTest()
PasswordFormHelperTest()
: web::WebTestWithWebState(std::make_unique<TestWebClientWithScript>()) {}
~PasswordControllerHelperTest() override = default;
~PasswordFormHelperTest() override = default;
void SetUp() override {
WebTestWithWebState::SetUp();
helper_ = [[PasswordControllerHelper alloc] initWithWebState:web_state()
delegate:nil];
helper_ =
[[PasswordFormHelper alloc] initWithWebState:web_state() delegate:nil];
}
void TearDown() override {
......@@ -155,10 +155,10 @@ class PasswordControllerHelperTest : public web::WebTestWithWebState {
[NSString stringWithFormat:kGetFormIdScript, form_index]));
}
// PasswordControllerHelper for testing.
PasswordControllerHelper* helper_;
// PasswordFormHelper for testing.
PasswordFormHelper* helper_;
DISALLOW_COPY_AND_ASSIGN(PasswordControllerHelperTest);
DISALLOW_COPY_AND_ASSIGN(PasswordFormHelperTest);
};
struct GetSubmittedPasswordFormTestData {
......@@ -176,7 +176,7 @@ struct GetSubmittedPasswordFormTestData {
// Check that HTML forms are captured and converted correctly into
// PasswordForms on submission.
TEST_F(PasswordControllerHelperTest, GetSubmittedPasswordForm) {
TEST_F(PasswordFormHelperTest, GetSubmittedPasswordForm) {
// clang-format off
const GetSubmittedPasswordFormTestData test_data[] = {
// Two forms with no explicit names.
......@@ -267,7 +267,7 @@ struct FindPasswordFormTestData {
};
// Check that HTML forms are converted correctly into PasswordForms.
TEST_F(PasswordControllerHelperTest, FindPasswordFormsInView) {
TEST_F(PasswordFormHelperTest, FindPasswordFormsInView) {
// clang-format off
const FindPasswordFormTestData test_data[] = {
// Normal form: a username and a password element.
......@@ -500,7 +500,7 @@ struct FillPasswordFormTestData {
};
// Tests that filling password forms works correctly.
TEST_F(PasswordControllerHelperTest, FillPasswordForm) {
TEST_F(PasswordFormHelperTest, FillPasswordForm) {
LoadHtml(kHtmlWithMultiplePasswordForms);
const std::string base_url = BaseUrl();
......@@ -649,7 +649,7 @@ TEST_F(PasswordControllerHelperTest, FillPasswordForm) {
}
// Tests that filling password forms with fill data works correctly.
TEST_F(PasswordControllerHelperTest, FillPasswordFormWithFillData) {
TEST_F(PasswordFormHelperTest, FillPasswordFormWithFillData) {
LoadHtml(
@"<form><input id='u1' type='text' name='un1'>"
"<input id='p1' type='password' name='pw1'></form>");
......@@ -673,7 +673,7 @@ TEST_F(PasswordControllerHelperTest, FillPasswordFormWithFillData) {
// Tests that a form is found and the found form is filled in with the given
// username and password.
TEST_F(PasswordControllerHelperTest, FindAndFillOnePasswordForm) {
TEST_F(PasswordFormHelperTest, FindAndFillOnePasswordForm) {
LoadHtml(
@"<form><input id='u1' type='text' name='un1'>"
"<input id='p1' type='password' name='pw1'></form>");
......@@ -698,7 +698,7 @@ TEST_F(PasswordControllerHelperTest, FindAndFillOnePasswordForm) {
// Tests that multiple forms on the same page are found and filled.
// This test includes an mock injected failure on form filling to verify
// that completion handler is called with the proper values.
TEST_F(PasswordControllerHelperTest, FindAndFillMultiplePasswordForms) {
TEST_F(PasswordFormHelperTest, FindAndFillMultiplePasswordForms) {
// Fails the first call to fill password form.
MockJsPasswordManager* mockJsPasswordManager = [[MockJsPasswordManager alloc]
initWithReceiver:web_state()->GetJSInjectionReceiver()];
......
......@@ -72,7 +72,7 @@ retrieveSuggestionsWithFormName:(NSString*)formName
(SuggestionsAvailableCompletion)completion;
// Retrieves password form fill data for |username| for use in
// |PasswordControllerHelper|'s
// |PasswordFormHelper|'s
// -fillPasswordFormWithFillData:completionHandler:.
- (std::unique_ptr<password_manager::FillData>)getFillDataForUsername:
(NSString*)username;
......
......@@ -9,7 +9,7 @@
#include <memory>
#import "components/autofill/ios/browser/form_suggestion_provider.h"
#import "components/password_manager/ios/password_controller_helper.h"
#import "components/password_manager/ios/password_form_helper.h"
#import "ios/chrome/browser/passwords/ios_chrome_password_manager_client.h"
#import "ios/chrome/browser/passwords/ios_chrome_password_manager_driver.h"
#import "ios/web/public/web_state/web_state_observer_bridge.h"
......@@ -42,7 +42,7 @@ class PasswordManagerClient;
@interface PasswordController : NSObject<CRWWebStateObserver,
PasswordManagerClientDelegate,
PasswordManagerDriverDelegate,
PasswordControllerHelperDelegate>
PasswordFormHelperDelegate>
// An object that can provide suggestions from this PasswordController.
@property(nonatomic, readonly) id<FormSuggestionProvider> suggestionProvider;
......
......@@ -116,8 +116,8 @@ void LogSuggestionShown(PasswordSuggestionType type) {
@property(nonatomic, strong)
NotifyUserAutoSigninViewController* notifyAutoSigninViewController;
// Helper contains common password controller logic.
@property(nonatomic, readonly) PasswordControllerHelper* helper;
// Helper contains common password form processing logic.
@property(nonatomic, readonly) PasswordFormHelper* formHelper;
// Helper contains common password suggestion logic.
@property(nonatomic, readonly) PasswordSuggestionHelper* suggestionHelper;
......@@ -177,7 +177,7 @@ void LogSuggestionShown(PasswordSuggestionType type) {
@synthesize notifyAutoSigninViewController = _notifyAutoSigninViewController;
@synthesize helper = _helper;
@synthesize formHelper = _formHelper;
@synthesize suggestionHelper = _suggestionHelper;
......@@ -197,8 +197,8 @@ void LogSuggestionShown(PasswordSuggestionType type) {
_webStateObserverBridge =
std::make_unique<web::WebStateObserverBridge>(self);
_webState->AddObserver(_webStateObserverBridge.get());
_helper = [[PasswordControllerHelper alloc] initWithWebState:webState
delegate:self];
_formHelper =
[[PasswordFormHelper alloc] initWithWebState:webState delegate:self];
_suggestionHelper =
[[PasswordSuggestionHelper alloc] initWithDelegate:self];
if (passwordManagerClient)
......@@ -246,9 +246,9 @@ void LogSuggestionShown(PasswordSuggestionType type) {
- (void)findAndFillPasswordForms:(NSString*)username
password:(NSString*)password
completionHandler:(void (^)(BOOL))completionHandler {
[self.helper findAndFillPasswordFormsWithUserName:username
password:password
completionHandler:completionHandler];
[self.formHelper findAndFillPasswordFormsWithUserName:username
password:password
completionHandler:completionHandler];
}
#pragma mark - CRWWebStateObserver
......@@ -411,10 +411,10 @@ void LogSuggestionShown(PasswordSuggestionType type) {
if (!fillData)
completion();
[self.helper fillPasswordFormWithFillData:*fillData
completionHandler:^(BOOL success) {
completion();
}];
[self.formHelper fillPasswordFormWithFillData:*fillData
completionHandler:^(BOOL success) {
completion();
}];
}
#pragma mark - PasswordManagerClientDelegate
......@@ -430,7 +430,7 @@ void LogSuggestionShown(PasswordSuggestionType type) {
}
- (const GURL&)lastCommittedURL {
return self.helper.lastCommittedURL;
return self.formHelper.lastCommittedURL;
}
- (void)showSavePasswordInfoBar:
......@@ -490,18 +490,19 @@ void LogSuggestionShown(PasswordSuggestionType type) {
- (void)fillPasswordForm:(const autofill::PasswordFormFillData&)formData
completionHandler:(void (^)(BOOL))completionHandler {
[self.suggestionHelper processWithPasswordFormFillData:formData];
[self.helper fillPasswordForm:formData completionHandler:completionHandler];
[self.formHelper fillPasswordForm:formData
completionHandler:completionHandler];
}
- (void)onNoSavedCredentials {
[self.suggestionHelper processWithNoSavedCredentials];
}
#pragma mark - PasswordControllerHelperDelegate
#pragma mark - PasswordFormHelperDelegate
- (void)helper:(PasswordControllerHelper*)helper
didSubmitForm:(const PasswordForm&)form
inMainFrame:(BOOL)inMainFrame {
- (void)formHelper:(PasswordFormHelper*)formHelper
didSubmitForm:(const PasswordForm&)form
inMainFrame:(BOOL)inMainFrame {
if (inMainFrame) {
self.passwordManager->OnPasswordFormSubmitted(self.passwordManagerDriver,
form);
......@@ -559,8 +560,8 @@ void LogSuggestionShown(PasswordSuggestionType type) {
// Read all password forms from the page and send them to the password
// manager.
__weak PasswordController* weakSelf = self;
[self.helper findPasswordFormsWithCompletionHandler:^(
const std::vector<autofill::PasswordForm>& forms) {
[self.formHelper findPasswordFormsWithCompletionHandler:^(
const std::vector<autofill::PasswordForm>& forms) {
[weakSelf didFinishPasswordFormExtraction:forms];
}];
}
......
......@@ -23,7 +23,7 @@
#include "components/password_manager/core/browser/stub_password_manager_client.h"
#include "components/password_manager/core/common/password_manager_pref_names.h"
#import "components/password_manager/ios/js_password_manager.h"
#import "components/password_manager/ios/password_controller_helper.h"
#import "components/password_manager/ios/password_form_helper.h"
#include "components/password_manager/ios/test_helpers.h"
#include "components/prefs/pref_registry_simple.h"
#include "components/prefs/testing_pref_service.h"
......@@ -150,8 +150,8 @@ ACTION(InvokeEmptyConsumerWithForms) {
@interface PasswordController (
Testing)<CRWWebStateObserver, FormSuggestionProvider>
// Provides access to common helper logic for testing with mocks.
@property(readonly) PasswordControllerHelper* helper;
// Provides access to common form helper logic for testing with mocks.
@property(readonly) PasswordFormHelper* formHelper;
- (void)fillPasswordForm:(const PasswordFormFillData&)formData
completionHandler:(void (^)(BOOL))completionHandler;
......@@ -160,7 +160,7 @@ ACTION(InvokeEmptyConsumerWithForms) {
@end
@interface PasswordControllerHelper (Testing)
@interface PasswordFormHelper (Testing)
// Provides access to JavaScript Manager for testing with mocks.
@property(readonly) JsPasswordManager* jsPasswordManager;
......@@ -254,7 +254,7 @@ class PasswordControllerTest : public ChromeWebTest {
// |failure_count| reaches |target_failure_count|, stop the partial mock
// and let the original JavaScript manager execute.
void SetFillPasswordFormFailureCount(int target_failure_count) {
id original_manager = passwordController_.helper.jsPasswordManager;
id original_manager = passwordController_.formHelper.jsPasswordManager;
OCPartialMockObject* failing_manager =
[OCMockObject partialMockForObject:original_manager];
__block int failure_count = 0;
......@@ -388,11 +388,12 @@ TEST_F(PasswordControllerTest, FLAKY_FindPasswordFormsInView) {
LoadHtml(data.html_string);
__block std::vector<PasswordForm> forms;
__block BOOL block_was_called = NO;
[passwordController_.helper findPasswordFormsWithCompletionHandler:^(
const std::vector<PasswordForm>& result) {
block_was_called = YES;
forms = result;
}];
[passwordController_.formHelper
findPasswordFormsWithCompletionHandler:^(
const std::vector<PasswordForm>& result) {
block_was_called = YES;
forms = result;
}];
EXPECT_TRUE(
WaitUntilConditionOrTimeout(kWaitForJSCompletionTimeout, ^bool() {
return block_was_called;
......@@ -489,7 +490,7 @@ TEST_F(PasswordControllerTest, FLAKY_GetSubmittedPasswordForm) {
form.username_element);
}
};
[passwordController_.helper
[passwordController_.formHelper
extractSubmittedPasswordForm:FormName(data.number_of_forms_to_submit)
completionHandler:completion_handler];
EXPECT_TRUE(
......
......@@ -12,7 +12,7 @@
#include "components/autofill/ios/browser/autofill_util.h"
#import "components/password_manager/core/browser/form_parsing/ios_form_parser.h"
#include "components/password_manager/core/browser/password_manager.h"
#import "components/password_manager/ios/password_controller_helper.h"
#import "components/password_manager/ios/password_form_helper.h"
#import "ios/web/public/origin_util.h"
#include "ios/web/public/url_scheme_util.h"
#import "ios/web/public/web_state/web_state_observer_bridge.h"
......@@ -36,14 +36,14 @@ using password_manager::PasswordFormManagerForUI;
@interface CWVPasswordController ()<CRWWebStateObserver,
CWVPasswordManagerClientDelegate,
CWVPasswordManagerDriverDelegate,
PasswordControllerHelperDelegate>
PasswordFormHelperDelegate>
// The PasswordManagerDriver owned by this PasswordController.
@property(nonatomic, readonly)
password_manager::PasswordManagerDriver* passwordManagerDriver;
// Helper contains common password controller logic.
@property(nonatomic, readonly) PasswordControllerHelper* helper;
// Helper contains common password form processing logic.
@property(nonatomic, readonly) PasswordFormHelper* formHelper;
// Delegate to receive password autofill suggestion callbacks.
@property(nonatomic, weak, nullable) id<CWVPasswordControllerDelegate> delegate;
......@@ -83,7 +83,7 @@ using password_manager::PasswordFormManagerForUI;
#pragma mark - Properties
@synthesize helper = _helper;
@synthesize formHelper = _formHelper;
@synthesize delegate = _delegate;
- (password_manager::PasswordManagerDriver*)passwordManagerDriver {
......@@ -102,8 +102,8 @@ using password_manager::PasswordFormManagerForUI;
_webStateObserverBridge =
std::make_unique<web::WebStateObserverBridge>(self);
_webState->AddObserver(_webStateObserverBridge.get());
_helper = [[PasswordControllerHelper alloc] initWithWebState:webState
delegate:self];
_formHelper =
[[PasswordFormHelper alloc] initWithWebState:webState delegate:self];
_passwordManagerClient =
std::make_unique<WebViewPasswordManagerClient>(self);
......@@ -186,7 +186,7 @@ using password_manager::PasswordFormManagerForUI;
}
- (const GURL&)lastCommittedURL {
return self.helper.lastCommittedURL;
return self.formHelper.lastCommittedURL;
}
- (void)showSavePasswordInfoBar:
......@@ -259,7 +259,7 @@ using password_manager::PasswordFormManagerForUI;
- (void)fillPasswordForm:(const autofill::PasswordFormFillData&)formData {
// TODO(crbug.com/865114): Add suggestion related logic.
[self.helper fillPasswordForm:formData completionHandler:nil];
[self.formHelper fillPasswordForm:formData completionHandler:nil];
}
// Informs delegate that there are no saved credentials for the current page.
......@@ -267,11 +267,11 @@ using password_manager::PasswordFormManagerForUI;
// TODO(crbug.com/865114): Implement remaining logic.
}
#pragma mark - PasswordControllerHelperDelegate
#pragma mark - PasswordFormHelperDelegate
- (void)helper:(PasswordControllerHelper*)helper
didSubmitForm:(const PasswordForm&)form
inMainFrame:(BOOL)inMainFrame {
- (void)formHelper:(PasswordFormHelper*)formHelper
didSubmitForm:(const PasswordForm&)form
inMainFrame:(BOOL)inMainFrame {
if (inMainFrame) {
self.passwordManager->OnPasswordFormSubmitted(self.passwordManagerDriver,
form);
......@@ -314,8 +314,8 @@ using password_manager::PasswordFormManagerForUI;
// Read all password forms from the page and send them to the password
// manager.
__weak CWVPasswordController* weakSelf = self;
[self.helper findPasswordFormsWithCompletionHandler:^(
const std::vector<autofill::PasswordForm>& forms) {
[self.formHelper findPasswordFormsWithCompletionHandler:^(
const std::vector<autofill::PasswordForm>& forms) {
[weakSelf didFinishPasswordFormExtraction:forms];
}];
}
......
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