Commit c1900c58 authored by Tina Wang's avatar Tina Wang Committed by Commit Bot

[iOS Enterprise] Enable AutofillAddressEnabled policy on ios

- Add AutofillAddressEnabled policy to simple policy map.
- Edit policy_test_cases.json to enable unit test.

Bug: 1066475
Change-Id: If8d73c2eaf891599a08854411dc94e064323187b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2149639
Commit-Queue: Tina Wang <tinazwang@chromium.org>
Reviewed-by: default avatarRohit Rao <rohitrao@chromium.org>
Reviewed-by: default avatarsebsg <sebsg@chromium.org>
Reviewed-by: default avatarJulian Pastarmov <pastarmovj@chromium.org>
Cr-Commit-Position: refs/heads/master@{#760723}
parent fd6f33e2
...@@ -30,6 +30,8 @@ jumbo_static_library("browser") { ...@@ -30,6 +30,8 @@ jumbo_static_library("browser") {
"address_rewriter.h", "address_rewriter.h",
"autocomplete_history_manager.cc", "autocomplete_history_manager.cc",
"autocomplete_history_manager.h", "autocomplete_history_manager.h",
"autofill_address_policy_handler.cc",
"autofill_address_policy_handler.h",
"autofill_address_util.cc", "autofill_address_util.cc",
"autofill_address_util.h", "autofill_address_util.h",
"autofill_browser_util.cc", "autofill_browser_util.cc",
...@@ -317,8 +319,6 @@ jumbo_static_library("browser") { ...@@ -317,8 +319,6 @@ jumbo_static_library("browser") {
if (!is_ios) { if (!is_ios) {
sources += [ sources += [
"autofill_address_policy_handler.cc",
"autofill_address_policy_handler.h",
"autofill_policy_handler.cc", "autofill_policy_handler.cc",
"autofill_policy_handler.h", "autofill_policy_handler.h",
"payments/credit_card_fido_authenticator.cc", "payments/credit_card_fido_authenticator.cc",
...@@ -539,6 +539,7 @@ source_set("unit_tests") { ...@@ -539,6 +539,7 @@ source_set("unit_tests") {
"address_normalizer_impl_unittest.cc", "address_normalizer_impl_unittest.cc",
"address_rewriter_unittest.cc", "address_rewriter_unittest.cc",
"autocomplete_history_manager_unittest.cc", "autocomplete_history_manager_unittest.cc",
"autofill_address_policy_handler_unittest.cc",
"autofill_credit_card_policy_handler_unittest.cc", "autofill_credit_card_policy_handler_unittest.cc",
"autofill_data_util_unittest.cc", "autofill_data_util_unittest.cc",
"autofill_download_manager_unittest.cc", "autofill_download_manager_unittest.cc",
...@@ -622,7 +623,6 @@ source_set("unit_tests") { ...@@ -622,7 +623,6 @@ source_set("unit_tests") {
if (!is_ios) { if (!is_ios) {
sources += [ sources += [
"autofill_address_policy_handler_unittest.cc",
"autofill_policy_handler_unittest.cc", "autofill_policy_handler_unittest.cc",
"payments/credit_card_fido_authenticator_unittest.cc", "payments/credit_card_fido_authenticator_unittest.cc",
] ]
......
...@@ -3081,6 +3081,7 @@ ...@@ -3081,6 +3081,7 @@
'chrome.*:69-', 'chrome.*:69-',
'chrome_os:69-', 'chrome_os:69-',
'android:69-', 'android:69-',
'ios:84-',
], ],
'features': { 'features': {
'can_be_recommended': True, 'can_be_recommended': True,
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
#include "base/bind.h" #include "base/bind.h"
#include "base/logging.h" #include "base/logging.h"
#include "components/autofill/core/browser/autofill_address_policy_handler.h"
#include "components/autofill/core/browser/autofill_credit_card_policy_handler.h" #include "components/autofill/core/browser/autofill_credit_card_policy_handler.h"
#include "components/bookmarks/common/bookmark_pref_names.h" #include "components/bookmarks/common/bookmark_pref_names.h"
#include "components/bookmarks/managed/managed_bookmarks_policy_handler.h" #include "components/bookmarks/managed/managed_bookmarks_policy_handler.h"
...@@ -69,6 +70,8 @@ std::unique_ptr<policy::ConfigurationPolicyHandlerList> BuildPolicyHandlerList( ...@@ -69,6 +70,8 @@ std::unique_ptr<policy::ConfigurationPolicyHandlerList> BuildPolicyHandlerList(
kSimplePolicyMap[i].value_type)); kSimplePolicyMap[i].value_type));
} }
handlers->AddHandler(
std::make_unique<autofill::AutofillAddressPolicyHandler>());
handlers->AddHandler( handlers->AddHandler(
std::make_unique<autofill::AutofillCreditCardPolicyHandler>()); std::make_unique<autofill::AutofillCreditCardPolicyHandler>());
......
...@@ -24,6 +24,17 @@ ...@@ -24,6 +24,17 @@
] ]
}, },
"AutofillAddressEnabled": {
"os": [ "ios" ],
"can_be_recommended": true,
"policy_pref_mapping_test": [
{
"policies": { "AutofillAddressEnabled": false },
"prefs": { "autofill.profile_enabled": {} }
}
]
},
"AutofillCreditCardEnabled": { "AutofillCreditCardEnabled": {
"os": [ "ios" ], "os": [ "ios" ],
"can_be_recommended": true, "can_be_recommended": true,
......
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