Commit 4022f0f5 authored by Olivier Robin's avatar Olivier Robin Committed by Commit Bot

[Autofill iOS] Fix Autofill CC filling on iOS

Server card fetching requires that ChromeAutofillClientIOS returns
a valid sync_service.

Bug: 825319, 535784
Cq-Include-Trybots: master.tryserver.chromium.mac:ios-simulator-cronet;master.tryserver.chromium.mac:ios-simulator-full-configs
Change-Id: Ic59cfd5fba28f0fa3721806bcfbfc91829f75445
Reviewed-on: https://chromium-review.googlesource.com/1023930
Commit-Queue: Olivier Robin <olivierrobin@chromium.org>
Reviewed-by: default avatarMoe Ahmadi <mahmadi@chromium.org>
Reviewed-by: default avatarSebastien Seguin-Gagnon <sebsg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#553067}
parent e68ce04b
......@@ -21,6 +21,7 @@ source_set("autofill") {
"//components/autofill/core/browser",
"//components/autofill/core/common",
"//components/autofill/ios/browser",
"//components/browser_sync",
"//components/infobars/core",
"//components/keyed_service/core",
"//components/password_manager/core/browser",
......@@ -33,6 +34,7 @@ source_set("autofill") {
"//ios/chrome/browser/infobars",
"//ios/chrome/browser/signin",
"//ios/chrome/browser/ssl",
"//ios/chrome/browser/sync",
"//ios/chrome/browser/ui",
"//ios/chrome/browser/ui/autofill/cells",
"//ios/chrome/browser/ui/collection_view/cells",
......
......@@ -92,6 +92,7 @@ class ChromeAutofillClientIOS : public AutofillClient {
private:
PrefService* pref_service_;
syncer::SyncService* sync_service_;
PersonalDataManager* personal_data_manager_;
web::WebState* web_state_;
__weak id<AutofillClientIOSBridge> bridge_;
......
......@@ -17,6 +17,7 @@
#include "components/autofill/core/common/autofill_features.h"
#include "components/autofill/core/common/autofill_pref_names.h"
#include "components/autofill/ios/browser/autofill_util.h"
#include "components/browser_sync/profile_sync_service.h"
#include "components/infobars/core/infobar.h"
#include "components/keyed_service/core/service_access_type.h"
#include "ios/chrome/browser/application_context.h"
......@@ -25,6 +26,7 @@
#include "ios/chrome/browser/infobars/infobar_utils.h"
#include "ios/chrome/browser/signin/identity_manager_factory.h"
#import "ios/chrome/browser/ssl/insecure_input_tab_helper.h"
#include "ios/chrome/browser/sync/ios_chrome_profile_sync_service_factory.h"
#include "ios/chrome/browser/ui/autofill/card_unmask_prompt_view_bridge.h"
#include "ios/chrome/browser/web_data_service_factory.h"
#include "ios/public/provider/chrome/browser/chrome_browser_provider.h"
......@@ -42,6 +44,8 @@ ChromeAutofillClientIOS::ChromeAutofillClientIOS(
id<AutofillClientIOSBridge> bridge,
password_manager::PasswordGenerationManager* password_generation_manager)
: pref_service_(browser_state->GetPrefs()),
sync_service_(IOSChromeProfileSyncServiceFactory::GetForBrowserState(
browser_state)),
personal_data_manager_(PersonalDataManagerFactory::GetForBrowserState(
browser_state->GetOriginalChromeBrowserState())),
web_state_(web_state),
......@@ -74,9 +78,8 @@ PrefService* ChromeAutofillClientIOS::GetPrefs() {
return pref_service_;
}
// TODO(crbug.com/535784): Implement this when adding credit card upload.
syncer::SyncService* ChromeAutofillClientIOS::GetSyncService() {
return nullptr;
return sync_service_;
}
identity::IdentityManager* ChromeAutofillClientIOS::GetIdentityManager() {
......
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