Commit 0609fce6 authored by Moe Ahmadi's avatar Moe Ahmadi Committed by Commit Bot

[AF][IOS] Split Autofill settings page into two separate pages

Splits Autofill settings page into two separate pages, one for addresses
and the other for credit cards.

Bug: 860526
Cq-Include-Trybots: luci.chromium.try:ios-simulator-full-configs;master.tryserver.chromium.mac:ios-simulator-cronet
Change-Id: I8f02f93fbd54fc17c2b97e5a97d9d5a08f729197
Reviewed-on: https://chromium-review.googlesource.com/1173314
Commit-Queue: Moe Ahmadi <mahmadi@chromium.org>
Reviewed-by: default avatarRohit Rao <rohitrao@chromium.org>
Cr-Commit-Position: refs/heads/master@{#583716}
parent 870f8434
...@@ -219,15 +219,6 @@ locale. The strings in this file are specific to iOS. ...@@ -219,15 +219,6 @@ locale. The strings in this file are specific to iOS.
<message name="IDS_IOS_APP_LAUNCHER_OPEN_APP_BUTTON_LABEL" desc="Label of a button to open an application. [Length: 10em] [iOS only]"> <message name="IDS_IOS_APP_LAUNCHER_OPEN_APP_BUTTON_LABEL" desc="Label of a button to open an application. [Length: 10em] [iOS only]">
Open Open
</message> </message>
<message name="IDS_IOS_AUTOFILL" desc="Title for the view in Settings for enabling/disabling Autofill. [Length: 15em] [iOS only]">
Autofill Forms
</message>
<message name="IDS_IOS_ENABLE_AUTOFILL_PROFILES" desc="Title for the the toggle in Autofill Settings for enabling/disabling Autofill Addresses. Title case. [Length: unlimited] [iOS only]">
Save and Fill Addresses
</message>
<message name="IDS_IOS_ENABLE_AUTOFILL_CREDIT_CARDS" desc="Title for the toggle in Autofill Settings for enabling/disabling Autofill Credit Cards. Title case. [Length: unlimited] [iOS only]">
Save and Fill Credit Cards
</message>
<message name="IDS_IOS_AUTOFILL_ACCNAME_HIDE_KEYBOARD" desc="The accessible name for the hide keyboard button in the keyboard accessory shown when filling out forms. [Length: unlimited] [iOS only]"> <message name="IDS_IOS_AUTOFILL_ACCNAME_HIDE_KEYBOARD" desc="The accessible name for the hide keyboard button in the keyboard accessory shown when filling out forms. [Length: unlimited] [iOS only]">
Hide keyboard Hide keyboard
</message> </message>
...@@ -246,9 +237,6 @@ locale. The strings in this file are specific to iOS. ...@@ -246,9 +237,6 @@ locale. The strings in this file are specific to iOS.
<message name="IDS_IOS_AUTOFILL_ADDRESS2" desc="Title of the field of a profile address representing the second line of the address. [Length: 15em] [iOS only]"> <message name="IDS_IOS_AUTOFILL_ADDRESS2" desc="Title of the field of a profile address representing the second line of the address. [Length: 15em] [iOS only]">
Address 2 Address 2
</message> </message>
<message name="IDS_IOS_AUTOFILL_ADDRESSES_GROUP_NAME" desc="The name of the Addresses group of the Autofill settings. Title case. [Length: 20em] [iOS only]">
Addresses
</message>
<message name="IDS_IOS_AUTOFILL_CARDHOLDER" desc="Title of the field representing the full name of a credit card holder. [Length: 15em] [iOS only]"> <message name="IDS_IOS_AUTOFILL_CARDHOLDER" desc="Title of the field representing the full name of a credit card holder. [Length: 15em] [iOS only]">
Name on Card Name on Card
</message> </message>
...@@ -264,9 +252,6 @@ locale. The strings in this file are specific to iOS. ...@@ -264,9 +252,6 @@ locale. The strings in this file are specific to iOS.
<message name="IDS_IOS_AUTOFILL_COUNTRY" desc="Title of the field of a profile address representing the country/nation of the address. [Length: 15em] [iOS only]"> <message name="IDS_IOS_AUTOFILL_COUNTRY" desc="Title of the field of a profile address representing the country/nation of the address. [Length: 15em] [iOS only]">
Country Country
</message> </message>
<message name="IDS_IOS_AUTOFILL_CREDITCARDS_GROUP_NAME" desc="The name of the Credit Cards group of the Autofill dialog. Title case. [Length: 20em] [iOS only]">
Credit Cards
</message>
<message name="IDS_IOS_AUTOFILL_DIALOG_PLACEHOLDER_EXPIRY_MONTH" desc="The placeholder text for credit card expiration month in the payments card unmask dialog. [Length: 4em] [iOS only]"> <message name="IDS_IOS_AUTOFILL_DIALOG_PLACEHOLDER_EXPIRY_MONTH" desc="The placeholder text for credit card expiration month in the payments card unmask dialog. [Length: 4em] [iOS only]">
MM MM
</message> </message>
......
...@@ -9,13 +9,15 @@ source_set("settings") { ...@@ -9,13 +9,15 @@ source_set("settings") {
"about_chrome_collection_view_controller.mm", "about_chrome_collection_view_controller.mm",
"accounts_collection_view_controller.h", "accounts_collection_view_controller.h",
"accounts_collection_view_controller.mm", "accounts_collection_view_controller.mm",
"autofill_collection_view_controller.h", "autofill_credit_card_collection_view_controller.h",
"autofill_collection_view_controller.mm", "autofill_credit_card_collection_view_controller.mm",
"autofill_credit_card_edit_collection_view_controller.h", "autofill_credit_card_edit_collection_view_controller.h",
"autofill_credit_card_edit_collection_view_controller.mm", "autofill_credit_card_edit_collection_view_controller.mm",
"autofill_edit_collection_view_controller+protected.h", "autofill_edit_collection_view_controller+protected.h",
"autofill_edit_collection_view_controller.h", "autofill_edit_collection_view_controller.h",
"autofill_edit_collection_view_controller.mm", "autofill_edit_collection_view_controller.mm",
"autofill_profile_collection_view_controller.h",
"autofill_profile_collection_view_controller.mm",
"autofill_profile_edit_collection_view_controller.h", "autofill_profile_edit_collection_view_controller.h",
"autofill_profile_edit_collection_view_controller.mm", "autofill_profile_edit_collection_view_controller.mm",
"bandwidth_management_collection_view_controller.h", "bandwidth_management_collection_view_controller.h",
...@@ -104,13 +106,14 @@ source_set("settings") { ...@@ -104,13 +106,14 @@ source_set("settings") {
"resources:encryption_error", "resources:encryption_error",
"resources:settings_about_chrome", "resources:settings_about_chrome",
"resources:settings_accounts_add_account", "resources:settings_accounts_add_account",
"resources:settings_addresses",
"resources:settings_article_suggestions", "resources:settings_article_suggestions",
"resources:settings_autofill_forms",
"resources:settings_bandwidth", "resources:settings_bandwidth",
"resources:settings_content_settings", "resources:settings_content_settings",
"resources:settings_debug", "resources:settings_debug",
"resources:settings_error", "resources:settings_error",
"resources:settings_passwords", "resources:settings_passwords",
"resources:settings_payment_methods",
"resources:settings_privacy", "resources:settings_privacy",
"resources:settings_search_engine", "resources:settings_search_engine",
"resources:settings_sync", "resources:settings_sync",
...@@ -263,7 +266,8 @@ source_set("unit_tests") { ...@@ -263,7 +266,8 @@ source_set("unit_tests") {
testonly = true testonly = true
sources = [ sources = [
"about_chrome_collection_view_controller_unittest.mm", "about_chrome_collection_view_controller_unittest.mm",
"autofill_collection_view_controller_unittest.mm", "autofill_credit_card_collection_view_controller_unittest.mm",
"autofill_profile_collection_view_controller_unittest.mm",
"autofill_profile_edit_collection_view_controller_unittest.mm", "autofill_profile_edit_collection_view_controller_unittest.mm",
"bandwidth_management_collection_view_controller_unittest.mm", "bandwidth_management_collection_view_controller_unittest.mm",
"block_popups_collection_view_controller_unittest.mm", "block_popups_collection_view_controller_unittest.mm",
...@@ -365,7 +369,8 @@ source_set("eg_tests") { ...@@ -365,7 +369,8 @@ source_set("eg_tests") {
testonly = true testonly = true
sources = [ sources = [
"accounts_collection_egtest.mm", "accounts_collection_egtest.mm",
"autofill_settings_egtest.mm", "autofill_credit_card_settings_egtest.mm",
"autofill_profile_settings_egtest.mm",
"block_popups_egtest.mm", "block_popups_egtest.mm",
"clear_browsing_data_egtest.mm", "clear_browsing_data_egtest.mm",
"passwords_settings_egtest.mm", "passwords_settings_egtest.mm",
......
// Copyright 2015 The Chromium Authors. All rights reserved.
// 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_SETTINGS_AUTOFILL_CREDIT_CARD_COLLECTION_VIEW_CONTROLLER_H_
#define IOS_CHROME_BROWSER_UI_SETTINGS_AUTOFILL_CREDIT_CARD_COLLECTION_VIEW_CONTROLLER_H_
#import "ios/chrome/browser/ui/settings/settings_root_collection_view_controller.h"
namespace ios {
class ChromeBrowserState;
} // namespace ios
// The collection view for the Autofill settings.
@interface AutofillCreditCardCollectionViewController
: SettingsRootCollectionViewController
// The designated initializer. |browserState| must not be nil.
- (instancetype)initWithBrowserState:(ios::ChromeBrowserState*)browserState
NS_DESIGNATED_INITIALIZER;
- (instancetype)initWithLayout:(UICollectionViewLayout*)layout
style:(CollectionViewControllerStyle)style
NS_UNAVAILABLE;
@end
#endif // IOS_CHROME_BROWSER_UI_SETTINGS_AUTOFILL_CREDIT_CARD_COLLECTION_VIEW_CONTROLLER_H_
// Copyright 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#import "ios/chrome/browser/ui/settings/autofill_credit_card_collection_view_controller.h"
#include "base/guid.h"
#include "base/mac/foundation_util.h"
#include "base/strings/utf_string_conversions.h"
#import "base/test/ios/wait_util.h"
#include "components/autofill/core/browser/credit_card.h"
#include "components/autofill/core/browser/personal_data_manager.h"
#include "ios/chrome/browser/autofill/personal_data_manager_factory.h"
#include "ios/chrome/browser/browser_state/test_chrome_browser_state.h"
#import "ios/chrome/browser/ui/collection_view/collection_view_controller_test.h"
#include "ios/chrome/browser/ui/settings/personal_data_manager_data_changed_observer.h"
#include "ios/web/public/test/test_web_thread_bundle.h"
#include "testing/gtest/include/gtest/gtest.h"
#if !defined(__has_feature) || !__has_feature(objc_arc)
#error "This file requires ARC support."
#endif
@interface SettingsRootCollectionViewController (ExposedForTesting)
- (void)editButtonPressed;
@end
namespace {
class AutofillCreditCardCollectionViewControllerTest
: public CollectionViewControllerTest {
protected:
AutofillCreditCardCollectionViewControllerTest() {
TestChromeBrowserState::Builder test_cbs_builder;
chrome_browser_state_ = test_cbs_builder.Build();
// Credit card import requires a PersonalDataManager which itself needs the
// WebDataService; this is not initialized on a TestChromeBrowserState by
// default.
chrome_browser_state_->CreateWebDataService();
}
CollectionViewController* InstantiateController() override {
return [[AutofillCreditCardCollectionViewController alloc]
initWithBrowserState:chrome_browser_state_.get()];
}
void AddCreditCard(const std::string& origin,
const std::string& card_holder_name,
const std::string& card_number) {
autofill::PersonalDataManager* personal_data_manager =
autofill::PersonalDataManagerFactory::GetForBrowserState(
chrome_browser_state_.get());
PersonalDataManagerDataChangedObserver observer(personal_data_manager);
autofill::CreditCard credit_card(base::GenerateGUID(), origin);
credit_card.SetRawInfo(autofill::CREDIT_CARD_NAME_FULL,
base::ASCIIToUTF16(card_holder_name));
credit_card.SetRawInfo(autofill::CREDIT_CARD_NUMBER,
base::ASCIIToUTF16(card_number));
personal_data_manager->OnAcceptedLocalCreditCardSave(credit_card);
observer.Wait(); // Wait for completion of the asynchronous operation.
}
web::TestWebThreadBundle thread_bundle_;
std::unique_ptr<TestChromeBrowserState> chrome_browser_state_;
};
// Default test case of no addresses or credit cards.
TEST_F(AutofillCreditCardCollectionViewControllerTest, TestInitialization) {
CreateController();
CheckController();
// Expect one header section.
EXPECT_EQ(1, NumberOfSections());
// Expect header section to contain one row (the credit card Autofill toggle).
EXPECT_EQ(1, NumberOfItemsInSection(0));
}
// Adding a single credit card results in a credit card section.
TEST_F(AutofillCreditCardCollectionViewControllerTest, TestOneCreditCard) {
AddCreditCard("https://www.example.com/", "John Doe", "378282246310005");
CreateController();
CheckController();
// Expect two sections (header and credit cards section).
EXPECT_EQ(2, NumberOfSections());
// Expect address section to contain one row (the credit card itself).
EXPECT_EQ(1, NumberOfItemsInSection(1));
}
// Deleting the only credit card results in item deletion and section deletion.
TEST_F(AutofillCreditCardCollectionViewControllerTest,
TestOneCreditCardItemDeleted) {
AddCreditCard("https://www.example.com/", "John Doe", "378282246310005");
CreateController();
CheckController();
// Expect two sections (header and credit cards section).
EXPECT_EQ(2, NumberOfSections());
// Expect address section to contain one row (the credit card itself).
EXPECT_EQ(1, NumberOfItemsInSection(1));
AutofillCreditCardCollectionViewController* view_controller =
base::mac::ObjCCastStrict<AutofillCreditCardCollectionViewController>(
controller());
// Put the collectionView in 'edit' mode.
[view_controller editButtonPressed];
// This is a bit of a shortcut, since actually clicking on the 'delete'
// button would be tough.
void (^delete_item_with_wait)(int, int) = ^(int i, int j) {
__block BOOL completion_called = NO;
this->DeleteItem(i, j, ^{
completion_called = YES;
});
EXPECT_TRUE(base::test::ios::WaitUntilConditionOrTimeout(
base::test::ios::kWaitForUIElementTimeout, ^bool() {
return completion_called;
}));
};
autofill::PersonalDataManager* personal_data_manager =
autofill::PersonalDataManagerFactory::GetForBrowserState(
chrome_browser_state_.get());
PersonalDataManagerDataChangedObserver observer(personal_data_manager);
// This call cause a modification of the PersonalDataManager, so wait until
// the asynchronous task complete in addition to waiting for the UI update.
delete_item_with_wait(1, 0);
observer.Wait(); // Wait for completion of the asynchronous operation.
// Exit 'edit' mode.
[view_controller editButtonPressed];
// Expect one header section only.
EXPECT_EQ(1, NumberOfSections());
}
} // namespace
// Copyright 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#import <XCTest/XCTest.h>
#import "base/test/ios/wait_util.h"
#include "components/autofill/core/browser/autofill_test_utils.h"
#include "components/autofill/core/browser/credit_card.h"
#include "components/autofill/core/browser/personal_data_manager.h"
#include "components/strings/grit/components_strings.h"
#include "ios/chrome/browser/autofill/personal_data_manager_factory.h"
#include "ios/chrome/browser/ui/tools_menu/public/tools_menu_constants.h"
#include "ios/chrome/grit/ios_strings.h"
#import "ios/chrome/test/app/chrome_test_util.h"
#import "ios/chrome/test/app/web_view_interaction_test_util.h"
#include "ios/chrome/test/earl_grey/accessibility_util.h"
#import "ios/chrome/test/earl_grey/chrome_actions.h"
#import "ios/chrome/test/earl_grey/chrome_earl_grey.h"
#import "ios/chrome/test/earl_grey/chrome_earl_grey_ui.h"
#import "ios/chrome/test/earl_grey/chrome_matchers.h"
#import "ios/chrome/test/earl_grey/chrome_test_case.h"
#include "ui/base/l10n/l10n_util.h"
#if !defined(__has_feature) || !__has_feature(objc_arc)
#error "This file requires ARC support."
#endif
using chrome_test_util::ButtonWithAccessibilityLabel;
using chrome_test_util::ButtonWithAccessibilityLabelId;
using chrome_test_util::NavigationBarDoneButton;
using chrome_test_util::SettingsDoneButton;
using chrome_test_util::SettingsMenuBackButton;
namespace {
// Expectation of how the saved Autofill credit card looks like, a map from cell
// name IDs to expected contents.
struct DisplayStringIDToExpectedResult {
int display_string_id;
NSString* expected_result;
};
const DisplayStringIDToExpectedResult kExpectedFields[] = {
{IDS_IOS_AUTOFILL_CARDHOLDER, @"Test User"},
{IDS_IOS_AUTOFILL_CARD_NUMBER, @"4111111111111111"},
{IDS_IOS_AUTOFILL_EXP_MONTH, @"11"},
{IDS_IOS_AUTOFILL_EXP_YEAR, @"2022"}};
NSString* const kCreditCardLabel =
@"Test User, Visa ‪• • • • 1111‬";
} // namespace
// Various tests for the Autofill credit cards section of the settings.
@interface AutofillCreditCardSettingsTestCase : ChromeTestCase
@end
@implementation AutofillCreditCardSettingsTestCase {
// The PersonalDataManager instance for the current browser state.
autofill::PersonalDataManager* _personalDataManager;
}
- (void)setUp {
[super setUp];
_personalDataManager =
autofill::PersonalDataManagerFactory::GetForBrowserState(
chrome_test_util::GetOriginalBrowserState());
_personalDataManager->SetSyncingForTest(true);
}
- (void)tearDown {
// Clear existing credit cards.
for (const auto* creditCard : _personalDataManager->GetCreditCards()) {
_personalDataManager->RemoveByGUID(creditCard->guid());
}
[super tearDown];
}
- (autofill::CreditCard)addCreditCard {
autofill::CreditCard creditCard = autofill::test::GetCreditCard();
size_t creditCardCount = _personalDataManager->GetCreditCards().size();
_personalDataManager->AddCreditCard(creditCard);
GREYAssert(base::test::ios::WaitUntilConditionOrTimeout(
base::test::ios::kWaitForActionTimeout,
^bool() {
return creditCardCount <
_personalDataManager->GetCreditCards().size();
}),
@"Failed to add credit card.");
return creditCard;
}
// Helper to open the settings page for Autofill credit cards.
- (void)openCreditCardsSettings {
[ChromeEarlGreyUI openSettingsMenu];
[[EarlGrey selectElementWithMatcher:ButtonWithAccessibilityLabel(
l10n_util::GetNSString(
IDS_AUTOFILL_PAYMENT_METHODS))]
performAction:grey_tap()];
}
// Helper to open the settings page for the Autofill credit card with |label|.
- (void)openEditCreditCard:(NSString*)label {
[self openCreditCardsSettings];
[[EarlGrey selectElementWithMatcher:grey_accessibilityLabel(label)]
performAction:grey_tap()];
}
// Close the settings.
- (void)exitSettingsMenu {
[[EarlGrey selectElementWithMatcher:SettingsMenuBackButton()]
performAction:grey_tap()];
[[EarlGrey selectElementWithMatcher:SettingsDoneButton()]
performAction:grey_tap()];
// Wait for UI components to finish loading.
[[GREYUIThreadExecutor sharedInstance] drainUntilIdle];
}
// Test that the page for viewing Autofill credit card details is as expected.
- (void)testCreditCardViewPage {
autofill::CreditCard creditCard = [self addCreditCard];
[self openEditCreditCard:kCreditCardLabel];
// Check that all fields and values match the expectations.
for (const DisplayStringIDToExpectedResult& expectation : kExpectedFields) {
[[EarlGrey selectElementWithMatcher:
grey_accessibilityLabel([NSString
stringWithFormat:@"%@, %@",
l10n_util::GetNSString(
expectation.display_string_id),
expectation.expected_result])]
assertWithMatcher:grey_notNil()];
}
// Go back to the list view page.
[[EarlGrey selectElementWithMatcher:SettingsMenuBackButton()]
performAction:grey_tap()];
[self exitSettingsMenu];
}
// Test that the page for viewing Autofill credit card details is accessible.
- (void)testAccessibilityOnCreditCardViewPage {
autofill::CreditCard creditCard = [self addCreditCard];
[self openEditCreditCard:kCreditCardLabel];
chrome_test_util::VerifyAccessibilityForCurrentScreen();
// Go back to the list view page.
[[EarlGrey selectElementWithMatcher:SettingsMenuBackButton()]
performAction:grey_tap()];
[self exitSettingsMenu];
}
// Test that the page for editing Autofill credit card details is accessible.
- (void)testAccessibilityOnCreditCardEditPage {
autofill::CreditCard creditCard = [self addCreditCard];
[self openEditCreditCard:kCreditCardLabel];
// Switch on edit mode.
[[EarlGrey selectElementWithMatcher:ButtonWithAccessibilityLabelId(
IDS_IOS_NAVIGATION_BAR_EDIT_BUTTON)]
performAction:grey_tap()];
chrome_test_util::VerifyAccessibilityForCurrentScreen();
// Go back to the list view page.
[[EarlGrey selectElementWithMatcher:SettingsMenuBackButton()]
performAction:grey_tap()];
[self exitSettingsMenu];
}
// Checks that the Autofill credit cards list view is in edit mode and the
// Autofill credit cards switch is disabled.
- (void)testListViewEditMode {
autofill::CreditCard creditCard = [self addCreditCard];
[self openCreditCardsSettings];
// Switch on edit mode.
[[EarlGrey selectElementWithMatcher:ButtonWithAccessibilityLabelId(
IDS_IOS_NAVIGATION_BAR_EDIT_BUTTON)]
performAction:grey_tap()];
// Check the Autofill credit card switch is disabled.
[[EarlGrey selectElementWithMatcher:chrome_test_util::SettingsSwitchCell(
@"cardItem_switch", YES, NO)]
assertWithMatcher:grey_notNil()];
[self exitSettingsMenu];
}
// Checks that the Autofill credit card switch can be toggled on/off and the
// list of Autofill credit cards is not affected by it.
- (void)testToggleCreditCardSwitch {
autofill::CreditCard creditCard = [self addCreditCard];
[self openCreditCardsSettings];
// Toggle the Autofill credit cards switch off.
[[EarlGrey selectElementWithMatcher:chrome_test_util::SettingsSwitchCell(
@"cardItem_switch", YES, YES)]
performAction:chrome_test_util::TurnSettingsSwitchOn(NO)];
// Expect Autofill credit cards to remain visible.
[[EarlGrey selectElementWithMatcher:grey_accessibilityLabel(kCreditCardLabel)]
assertWithMatcher:grey_notNil()];
// Toggle the Autofill credit cards switch back on.
[[EarlGrey selectElementWithMatcher:chrome_test_util::SettingsSwitchCell(
@"cardItem_switch", NO, YES)]
performAction:chrome_test_util::TurnSettingsSwitchOn(YES)];
// Expect Autofill credit cards to remain visible.
[[EarlGrey selectElementWithMatcher:grey_accessibilityLabel(kCreditCardLabel)]
assertWithMatcher:grey_notNil()];
[self exitSettingsMenu];
}
@end
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
// 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_SETTINGS_AUTOFILL_COLLECTION_VIEW_CONTROLLER_H_ #ifndef IOS_CHROME_BROWSER_UI_SETTINGS_AUTOFILL_PROFILE_COLLECTION_VIEW_CONTROLLER_H_
#define IOS_CHROME_BROWSER_UI_SETTINGS_AUTOFILL_COLLECTION_VIEW_CONTROLLER_H_ #define IOS_CHROME_BROWSER_UI_SETTINGS_AUTOFILL_PROFILE_COLLECTION_VIEW_CONTROLLER_H_
#import "ios/chrome/browser/ui/settings/settings_root_collection_view_controller.h" #import "ios/chrome/browser/ui/settings/settings_root_collection_view_controller.h"
...@@ -12,7 +12,7 @@ class ChromeBrowserState; ...@@ -12,7 +12,7 @@ class ChromeBrowserState;
} // namespace ios } // namespace ios
// The collection view for the Autofill settings. // The collection view for the Autofill settings.
@interface AutofillCollectionViewController @interface AutofillProfileCollectionViewController
: SettingsRootCollectionViewController : SettingsRootCollectionViewController
// The designated initializer. |browserState| must not be nil. // The designated initializer. |browserState| must not be nil.
...@@ -24,4 +24,4 @@ class ChromeBrowserState; ...@@ -24,4 +24,4 @@ class ChromeBrowserState;
@end @end
#endif // IOS_CHROME_BROWSER_UI_SETTINGS_AUTOFILL_COLLECTION_VIEW_CONTROLLER_H_ #endif // IOS_CHROME_BROWSER_UI_SETTINGS_AUTOFILL_PROFILE_COLLECTION_VIEW_CONTROLLER_H_
...@@ -2,14 +2,13 @@ ...@@ -2,14 +2,13 @@
// 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.
#import "ios/chrome/browser/ui/settings/autofill_collection_view_controller.h" #import "ios/chrome/browser/ui/settings/autofill_profile_collection_view_controller.h"
#include "base/guid.h" #include "base/guid.h"
#include "base/mac/foundation_util.h" #include "base/mac/foundation_util.h"
#include "base/strings/utf_string_conversions.h" #include "base/strings/utf_string_conversions.h"
#import "base/test/ios/wait_util.h" #import "base/test/ios/wait_util.h"
#include "components/autofill/core/browser/autofill_profile.h" #include "components/autofill/core/browser/autofill_profile.h"
#include "components/autofill/core/browser/credit_card.h"
#include "components/autofill/core/browser/personal_data_manager.h" #include "components/autofill/core/browser/personal_data_manager.h"
#include "ios/chrome/browser/autofill/personal_data_manager_factory.h" #include "ios/chrome/browser/autofill/personal_data_manager_factory.h"
#include "ios/chrome/browser/browser_state/test_chrome_browser_state.h" #include "ios/chrome/browser/browser_state/test_chrome_browser_state.h"
...@@ -28,10 +27,10 @@ ...@@ -28,10 +27,10 @@
namespace { namespace {
class AutofillCollectionViewControllerTest class AutofillProfileCollectionViewControllerTest
: public CollectionViewControllerTest { : public CollectionViewControllerTest {
protected: protected:
AutofillCollectionViewControllerTest() { AutofillProfileCollectionViewControllerTest() {
TestChromeBrowserState::Builder test_cbs_builder; TestChromeBrowserState::Builder test_cbs_builder;
chrome_browser_state_ = test_cbs_builder.Build(); chrome_browser_state_ = test_cbs_builder.Build();
// Profile import requires a PersonalDataManager which itself needs the // Profile import requires a PersonalDataManager which itself needs the
...@@ -41,7 +40,7 @@ class AutofillCollectionViewControllerTest ...@@ -41,7 +40,7 @@ class AutofillCollectionViewControllerTest
} }
CollectionViewController* InstantiateController() override { CollectionViewController* InstantiateController() override {
return [[AutofillCollectionViewController alloc] return [[AutofillProfileCollectionViewController alloc]
initWithBrowserState:chrome_browser_state_.get()]; initWithBrowserState:chrome_browser_state_.get()];
} }
...@@ -65,67 +64,43 @@ class AutofillCollectionViewControllerTest ...@@ -65,67 +64,43 @@ class AutofillCollectionViewControllerTest
std::unique_ptr<TestChromeBrowserState> chrome_browser_state_; std::unique_ptr<TestChromeBrowserState> chrome_browser_state_;
}; };
// Default test case of no addresses or credit cards. // Default test case of no addresses.
TEST_F(AutofillCollectionViewControllerTest, TestInitialization) { TEST_F(AutofillProfileCollectionViewControllerTest, TestInitialization) {
CreateController(); CreateController();
CheckController(); CheckController();
// Expect one header section. // Expect one header section.
EXPECT_EQ(1, NumberOfSections()); EXPECT_EQ(1, NumberOfSections());
// Expect header section to contain three rows. // Expect header section to contain one row (the address Autofill toggle).
EXPECT_EQ(3, NumberOfItemsInSection(0)); EXPECT_EQ(1, NumberOfItemsInSection(0));
} }
// Adding a single address results in an address section. // Adding a single address results in an address section.
TEST_F(AutofillCollectionViewControllerTest, TestOneProfile) { TEST_F(AutofillProfileCollectionViewControllerTest, TestOneProfile) {
AddProfile("https://www.example.com/", "John Doe", "1 Main Street"); AddProfile("https://www.example.com/", "John Doe", "1 Main Street");
CreateController(); CreateController();
// Expect two sections (header and addresses section). CheckController();
EXPECT_EQ(2, NumberOfSections());
// Expect header section to contain three rows.
EXPECT_EQ(3, NumberOfItemsInSection(0));
// Expect address section to contain 1 row (the address itself).
EXPECT_EQ(1, NumberOfItemsInSection(1));
}
// Adding a single credit card results in a credit card section.
TEST_F(AutofillCollectionViewControllerTest, TestOneCreditCard) {
autofill::PersonalDataManager* personal_data_manager =
autofill::PersonalDataManagerFactory::GetForBrowserState(
chrome_browser_state_.get());
PersonalDataManagerDataChangedObserver observer(personal_data_manager);
autofill::CreditCard credit_card(base::GenerateGUID(),
"https://www.example.com/");
credit_card.SetRawInfo(autofill::CREDIT_CARD_NAME_FULL,
base::ASCIIToUTF16("Alan Smithee"));
credit_card.SetRawInfo(autofill::CREDIT_CARD_NUMBER,
base::ASCIIToUTF16("378282246310005"));
personal_data_manager->OnAcceptedLocalCreditCardSave(credit_card);
observer.Wait(); // Wait for completion of the asynchronous operation.
CreateController(); // Expect two sections (header and addresses section).
// Expect two sections (header and credit card section).
EXPECT_EQ(2, NumberOfSections()); EXPECT_EQ(2, NumberOfSections());
// Expect header section to contain three rows. // Expect address section to contain one row (the address itself).
EXPECT_EQ(3, NumberOfItemsInSection(0));
// Expect credit card section to contain 1 row (the credit card itself).
EXPECT_EQ(1, NumberOfItemsInSection(1)); EXPECT_EQ(1, NumberOfItemsInSection(1));
} }
// Deleting the only profile results in item deletion and section deletion. // Deleting the only profile results in item deletion and section deletion.
TEST_F(AutofillCollectionViewControllerTest, TestOneProfileItemDeleted) { TEST_F(AutofillProfileCollectionViewControllerTest, TestOneProfileItemDeleted) {
AddProfile("https://www.example.com/", "John Doe", "1 Main Street"); AddProfile("https://www.example.com/", "John Doe", "1 Main Street");
CreateController(); CreateController();
CheckController();
// Expect two sections (header and addresses section). // Expect two sections (header and addresses section).
EXPECT_EQ(2, NumberOfSections()); EXPECT_EQ(2, NumberOfSections());
// Expect header section to contain three rows. // Expect address section to contain one row (the address itself).
EXPECT_EQ(3, NumberOfItemsInSection(0));
// Expect address section to contain 1 row (the address itself).
EXPECT_EQ(1, NumberOfItemsInSection(1)); EXPECT_EQ(1, NumberOfItemsInSection(1));
AutofillCollectionViewController* view_controller = AutofillProfileCollectionViewController* view_controller =
base::mac::ObjCCastStrict<AutofillCollectionViewController>(controller()); base::mac::ObjCCastStrict<AutofillProfileCollectionViewController>(
controller());
// Put the collectionView in 'edit' mode. // Put the collectionView in 'edit' mode.
[view_controller editButtonPressed]; [view_controller editButtonPressed];
...@@ -155,11 +130,8 @@ TEST_F(AutofillCollectionViewControllerTest, TestOneProfileItemDeleted) { ...@@ -155,11 +130,8 @@ TEST_F(AutofillCollectionViewControllerTest, TestOneProfileItemDeleted) {
// Exit 'edit' mode. // Exit 'edit' mode.
[view_controller editButtonPressed]; [view_controller editButtonPressed];
// Verify the resulting UI. // Expect one header section only.
// Expect one header section.
EXPECT_EQ(1, NumberOfSections()); EXPECT_EQ(1, NumberOfSections());
// Expect header section to contain three rows.
EXPECT_EQ(3, NumberOfItemsInSection(0));
} }
} // namespace } // namespace
...@@ -67,15 +67,6 @@ imageset("settings_article_suggestions") { ...@@ -67,15 +67,6 @@ imageset("settings_article_suggestions") {
] ]
} }
imageset("settings_autofill_forms") {
sources = [
"settings_autofill_forms.imageset/Contents.json",
"settings_autofill_forms.imageset/settings_autofill_forms.png",
"settings_autofill_forms.imageset/settings_autofill_forms@2x.png",
"settings_autofill_forms.imageset/settings_autofill_forms@3x.png",
]
}
imageset("settings_bandwidth") { imageset("settings_bandwidth") {
sources = [ sources = [
"settings_bandwidth.imageset/Contents.json", "settings_bandwidth.imageset/Contents.json",
...@@ -112,6 +103,24 @@ imageset("settings_passwords") { ...@@ -112,6 +103,24 @@ imageset("settings_passwords") {
] ]
} }
imageset("settings_payment_methods") {
sources = [
"settings_payment_methods.imageset/Contents.json",
"settings_payment_methods.imageset/payment_methods.png",
"settings_payment_methods.imageset/payment_methods@2x.png",
"settings_payment_methods.imageset/payment_methods@3x.png",
]
}
imageset("settings_addresses") {
sources = [
"settings_addresses.imageset/Contents.json",
"settings_addresses.imageset/addresses.png",
"settings_addresses.imageset/addresses@2x.png",
"settings_addresses.imageset/addresses@3x.png",
]
}
imageset("settings_privacy") { imageset("settings_privacy") {
sources = [ sources = [
"settings_privacy.imageset/Contents.json", "settings_privacy.imageset/Contents.json",
......
...@@ -3,21 +3,21 @@ ...@@ -3,21 +3,21 @@
{ {
"idiom": "universal", "idiom": "universal",
"scale": "1x", "scale": "1x",
"filename": "settings_autofill_forms.png" "filename": "addresses.png"
}, },
{ {
"idiom": "universal", "idiom": "universal",
"scale": "2x", "scale": "2x",
"filename": "settings_autofill_forms@2x.png" "filename": "addresses@2x.png"
}, },
{ {
"idiom": "universal", "idiom": "universal",
"scale": "3x", "scale": "3x",
"filename": "settings_autofill_forms@3x.png" "filename": "addresses@3x.png"
} }
], ],
"info": { "info": {
"version": 1, "version": 1,
"author": "xcode" "author": "xcode"
} }
} }
\ No newline at end of file
{
"images": [
{
"idiom": "universal",
"scale": "1x",
"filename": "payment_methods.png"
},
{
"idiom": "universal",
"scale": "2x",
"filename": "payment_methods@2x.png"
},
{
"idiom": "universal",
"scale": "3x",
"filename": "payment_methods@3x.png"
}
],
"info": {
"version": 1,
"author": "xcode"
}
}
\ No newline at end of file
...@@ -44,7 +44,8 @@ ...@@ -44,7 +44,8 @@
#import "ios/chrome/browser/ui/commands/settings_main_page_commands.h" #import "ios/chrome/browser/ui/commands/settings_main_page_commands.h"
#import "ios/chrome/browser/ui/settings/about_chrome_collection_view_controller.h" #import "ios/chrome/browser/ui/settings/about_chrome_collection_view_controller.h"
#import "ios/chrome/browser/ui/settings/accounts_collection_view_controller.h" #import "ios/chrome/browser/ui/settings/accounts_collection_view_controller.h"
#import "ios/chrome/browser/ui/settings/autofill_collection_view_controller.h" #import "ios/chrome/browser/ui/settings/autofill_credit_card_collection_view_controller.h"
#import "ios/chrome/browser/ui/settings/autofill_profile_collection_view_controller.h"
#import "ios/chrome/browser/ui/settings/bandwidth_management_collection_view_controller.h" #import "ios/chrome/browser/ui/settings/bandwidth_management_collection_view_controller.h"
#import "ios/chrome/browser/ui/settings/cells/account_signin_item.h" #import "ios/chrome/browser/ui/settings/cells/account_signin_item.h"
#import "ios/chrome/browser/ui/settings/cells/settings_detail_item.h" #import "ios/chrome/browser/ui/settings/cells/settings_detail_item.h"
...@@ -96,7 +97,9 @@ const CGFloat kAccountProfilePhotoDimension = 40.0f; ...@@ -96,7 +97,9 @@ const CGFloat kAccountProfilePhotoDimension = 40.0f;
NSString* const kSyncAndGoogleServicesImageName = @"sync_and_google_services"; NSString* const kSyncAndGoogleServicesImageName = @"sync_and_google_services";
NSString* const kSettingsSearchEngineImageName = @"settings_search_engine"; NSString* const kSettingsSearchEngineImageName = @"settings_search_engine";
NSString* const kSettingsPasswordsImageName = @"settings_passwords"; NSString* const kSettingsPasswordsImageName = @"settings_passwords";
NSString* const kSettingsAutofillFormsImageName = @"settings_autofill_forms"; NSString* const kSettingsAutofillCreditCardImageName =
@"settings_payment_methods";
NSString* const kSettingsAutofillProfileImageName = @"settings_addresses";
NSString* const kSettingsVoiceSearchImageName = @"settings_voice_search"; NSString* const kSettingsVoiceSearchImageName = @"settings_voice_search";
NSString* const kSettingsPrivacyImageName = @"settings_privacy"; NSString* const kSettingsPrivacyImageName = @"settings_privacy";
NSString* const kSettingsContentSettingsImageName = NSString* const kSettingsContentSettingsImageName =
...@@ -124,7 +127,8 @@ typedef NS_ENUM(NSInteger, ItemType) { ...@@ -124,7 +127,8 @@ typedef NS_ENUM(NSInteger, ItemType) {
ItemTypeHeader, ItemTypeHeader,
ItemTypeSearchEngine, ItemTypeSearchEngine,
ItemTypeSavedPasswords, ItemTypeSavedPasswords,
ItemTypeAutofill, ItemTypeAutofillCreditCard,
ItemTypeAutofillProfile,
ItemTypeVoiceSearch, ItemTypeVoiceSearch,
ItemTypePrivacy, ItemTypePrivacy,
ItemTypeContentSettings, ItemTypeContentSettings,
...@@ -240,7 +244,8 @@ void SigninObserverBridge::GoogleSignedOut(const std::string& account_id, ...@@ -240,7 +244,8 @@ void SigninObserverBridge::GoogleSignedOut(const std::string& account_id,
SettingsDetailItem* _voiceSearchDetailItem; SettingsDetailItem* _voiceSearchDetailItem;
SettingsDetailItem* _defaultSearchEngineItem; SettingsDetailItem* _defaultSearchEngineItem;
SettingsDetailItem* _savePasswordsDetailItem; SettingsDetailItem* _savePasswordsDetailItem;
SettingsDetailItem* _autoFillDetailItem; SettingsDetailItem* _autoFillProfileDetailItem;
SettingsDetailItem* _autoFillCreditCardDetailItem;
// YES if the user used at least once the sign-in promo view buttons. // YES if the user used at least once the sign-in promo view buttons.
BOOL _signinStarted; BOOL _signinStarted;
...@@ -424,7 +429,9 @@ void SigninObserverBridge::GoogleSignedOut(const std::string& account_id, ...@@ -424,7 +429,9 @@ void SigninObserverBridge::GoogleSignedOut(const std::string& account_id,
toSectionWithIdentifier:SectionIdentifierBasics]; toSectionWithIdentifier:SectionIdentifierBasics];
[model addItem:[self savePasswordsDetailItem] [model addItem:[self savePasswordsDetailItem]
toSectionWithIdentifier:SectionIdentifierBasics]; toSectionWithIdentifier:SectionIdentifierBasics];
[model addItem:[self autoFillDetailItem] [model addItem:[self AutoFillCreditCardDetailItem]
toSectionWithIdentifier:SectionIdentifierBasics];
[model addItem:[self autoFillProfileDetailItem]
toSectionWithIdentifier:SectionIdentifierBasics]; toSectionWithIdentifier:SectionIdentifierBasics];
// Advanced Section // Advanced Section
...@@ -562,19 +569,34 @@ void SigninObserverBridge::GoogleSignedOut(const std::string& account_id, ...@@ -562,19 +569,34 @@ void SigninObserverBridge::GoogleSignedOut(const std::string& account_id,
return _savePasswordsDetailItem; return _savePasswordsDetailItem;
} }
- (CollectionViewItem*)autoFillDetailItem { - (CollectionViewItem*)AutoFillCreditCardDetailItem {
BOOL autofillEnabled = BOOL autofillCreditCardEnabled =
autofill::prefs::IsAutofillEnabled(_browserState->GetPrefs()); autofill::prefs::IsCreditCardAutofillEnabled(_browserState->GetPrefs());
NSString* autofillDetail = autofillEnabled NSString* detailText = autofillCreditCardEnabled
? l10n_util::GetNSString(IDS_IOS_SETTING_ON) ? l10n_util::GetNSString(IDS_IOS_SETTING_ON)
: l10n_util::GetNSString(IDS_IOS_SETTING_OFF); : l10n_util::GetNSString(IDS_IOS_SETTING_OFF);
_autoFillDetailItem = _autoFillCreditCardDetailItem = [self
[self detailItemWithType:ItemTypeAutofill detailItemWithType:ItemTypeAutofillCreditCard
text:l10n_util::GetNSString(IDS_IOS_AUTOFILL) text:l10n_util::GetNSString(IDS_AUTOFILL_PAYMENT_METHODS)
detailText:autofillDetail detailText:detailText
iconImageName:kSettingsAutofillFormsImageName]; iconImageName:kSettingsAutofillCreditCardImageName];
return _autoFillDetailItem; return _autoFillCreditCardDetailItem;
}
- (CollectionViewItem*)autoFillProfileDetailItem {
BOOL autofillProfileEnabled =
autofill::prefs::IsProfileAutofillEnabled(_browserState->GetPrefs());
NSString* detailText = autofillProfileEnabled
? l10n_util::GetNSString(IDS_IOS_SETTING_ON)
: l10n_util::GetNSString(IDS_IOS_SETTING_OFF);
_autoFillProfileDetailItem =
[self detailItemWithType:ItemTypeAutofillProfile
text:l10n_util::GetNSString(IDS_AUTOFILL_ADDRESSES)
detailText:detailText
iconImageName:kSettingsAutofillProfileImageName];
return _autoFillProfileDetailItem;
} }
- (CollectionViewItem*)voiceSearchDetailItem { - (CollectionViewItem*)voiceSearchDetailItem {
...@@ -856,8 +878,12 @@ void SigninObserverBridge::GoogleSignedOut(const std::string& account_id, ...@@ -856,8 +878,12 @@ void SigninObserverBridge::GoogleSignedOut(const std::string& account_id,
controller = [[SavePasswordsCollectionViewController alloc] controller = [[SavePasswordsCollectionViewController alloc]
initWithBrowserState:_browserState]; initWithBrowserState:_browserState];
break; break;
case ItemTypeAutofill: case ItemTypeAutofillCreditCard:
controller = [[AutofillCollectionViewController alloc] controller = [[AutofillCreditCardCollectionViewController alloc]
initWithBrowserState:_browserState];
break;
case ItemTypeAutofillProfile:
controller = [[AutofillProfileCollectionViewController alloc]
initWithBrowserState:_browserState]; initWithBrowserState:_browserState];
break; break;
case ItemTypeVoiceSearch: case ItemTypeVoiceSearch:
...@@ -1260,15 +1286,24 @@ void SigninObserverBridge::GoogleSignedOut(const std::string& account_id, ...@@ -1260,15 +1286,24 @@ void SigninObserverBridge::GoogleSignedOut(const std::string& account_id,
[self reconfigureCellsForItems:@[ _savePasswordsDetailItem ]]; [self reconfigureCellsForItems:@[ _savePasswordsDetailItem ]];
} }
if (preferenceName == autofill::prefs::kAutofillCreditCardEnabled || if (preferenceName == autofill::prefs::kAutofillProfileEnabled) {
preferenceName == autofill::prefs::kAutofillProfileEnabled) { BOOL autofillProfileEnabled =
BOOL autofillEnabled = autofill::prefs::IsProfileAutofillEnabled(_browserState->GetPrefs());
autofill::prefs::IsAutofillEnabled(_browserState->GetPrefs()); NSString* detailText = autofillProfileEnabled
NSString* autofillDetail = ? l10n_util::GetNSString(IDS_IOS_SETTING_ON)
autofillEnabled ? l10n_util::GetNSString(IDS_IOS_SETTING_ON) : l10n_util::GetNSString(IDS_IOS_SETTING_OFF);
: l10n_util::GetNSString(IDS_IOS_SETTING_OFF); _autoFillProfileDetailItem.detailText = detailText;
_autoFillDetailItem.detailText = autofillDetail; [self reconfigureCellsForItems:@[ _autoFillProfileDetailItem ]];
[self reconfigureCellsForItems:@[ _autoFillDetailItem ]]; }
if (preferenceName == autofill::prefs::kAutofillCreditCardEnabled) {
BOOL autofillCreditCardEnabled =
autofill::prefs::IsCreditCardAutofillEnabled(_browserState->GetPrefs());
NSString* detailText = autofillCreditCardEnabled
? l10n_util::GetNSString(IDS_IOS_SETTING_ON)
: l10n_util::GetNSString(IDS_IOS_SETTING_OFF);
_autoFillCreditCardDetailItem.detailText = detailText;
[self reconfigureCellsForItems:@[ _autoFillCreditCardDetailItem ]];
} }
} }
......
...@@ -97,9 +97,13 @@ id<GREYMatcher> ClearBrowsingDataCell() { ...@@ -97,9 +97,13 @@ id<GREYMatcher> ClearBrowsingDataCell() {
id<GREYMatcher> SearchEngineButton() { id<GREYMatcher> SearchEngineButton() {
return ButtonWithAccessibilityLabelId(IDS_IOS_SEARCH_ENGINE_SETTING_TITLE); return ButtonWithAccessibilityLabelId(IDS_IOS_SEARCH_ENGINE_SETTING_TITLE);
} }
// Matcher for the Autofill Forms cell on the main Settings screen. // Matcher for the payment methods cell on the main Settings screen.
id<GREYMatcher> AutofillButton() { id<GREYMatcher> PaymentMethodsButton() {
return ButtonWithAccessibilityLabelId(IDS_IOS_AUTOFILL); return ButtonWithAccessibilityLabelId(IDS_AUTOFILL_PAYMENT_METHODS);
}
// Matcher for the addresses cell on the main Settings screen.
id<GREYMatcher> AddressesButton() {
return ButtonWithAccessibilityLabelId(IDS_AUTOFILL_ADDRESSES);
} }
// Matcher for the Google Chrome cell on the main Settings screen. // Matcher for the Google Chrome cell on the main Settings screen.
id<GREYMatcher> GoogleChromeButton() { id<GREYMatcher> GoogleChromeButton() {
...@@ -709,10 +713,18 @@ bool IsCertificateCleared() { ...@@ -709,10 +713,18 @@ bool IsCertificateCleared() {
[self closeSubSettingsMenu]; [self closeSubSettingsMenu];
} }
// Verifies the UI elements are accessible on the Autofill Forms page. // Verifies the UI elements are accessible on the payment methods page.
- (void)testAccessibilityOnAutofillForms { - (void)testAccessibilityOnPaymentMethods {
[ChromeEarlGreyUI openSettingsMenu];
[ChromeEarlGreyUI tapSettingsMenuButton:PaymentMethodsButton()];
chrome_test_util::VerifyAccessibilityForCurrentScreen();
[self closeSubSettingsMenu];
}
// Verifies the UI elements are accessible on the addresses page.
- (void)testAccessibilityOnAddresses {
[ChromeEarlGreyUI openSettingsMenu]; [ChromeEarlGreyUI openSettingsMenu];
[ChromeEarlGreyUI tapSettingsMenuButton:AutofillButton()]; [ChromeEarlGreyUI tapSettingsMenuButton:AddressesButton()];
chrome_test_util::VerifyAccessibilityForCurrentScreen(); chrome_test_util::VerifyAccessibilityForCurrentScreen();
[self closeSubSettingsMenu]; [self closeSubSettingsMenu];
} }
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
#import "ios/chrome/browser/ui/material_components/app_bar_presenting.h" #import "ios/chrome/browser/ui/material_components/app_bar_presenting.h"
#import "ios/chrome/browser/ui/material_components/utils.h" #import "ios/chrome/browser/ui/material_components/utils.h"
#import "ios/chrome/browser/ui/settings/accounts_collection_view_controller.h" #import "ios/chrome/browser/ui/settings/accounts_collection_view_controller.h"
#import "ios/chrome/browser/ui/settings/autofill_collection_view_controller.h" #import "ios/chrome/browser/ui/settings/autofill_profile_collection_view_controller.h"
#import "ios/chrome/browser/ui/settings/clear_browsing_data_collection_view_controller.h" #import "ios/chrome/browser/ui/settings/clear_browsing_data_collection_view_controller.h"
#import "ios/chrome/browser/ui/settings/import_data_collection_view_controller.h" #import "ios/chrome/browser/ui/settings/import_data_collection_view_controller.h"
#import "ios/chrome/browser/ui/settings/save_passwords_collection_view_controller.h" #import "ios/chrome/browser/ui/settings/save_passwords_collection_view_controller.h"
...@@ -248,8 +248,8 @@ newImportDataController:(ios::ChromeBrowserState*)browserState ...@@ -248,8 +248,8 @@ newImportDataController:(ios::ChromeBrowserState*)browserState
+ (SettingsNavigationController*) + (SettingsNavigationController*)
newAutofillController:(ios::ChromeBrowserState*)browserState newAutofillController:(ios::ChromeBrowserState*)browserState
delegate:(id<SettingsNavigationControllerDelegate>)delegate { delegate:(id<SettingsNavigationControllerDelegate>)delegate {
AutofillCollectionViewController* controller = AutofillProfileCollectionViewController* controller =
[[AutofillCollectionViewController alloc] [[AutofillProfileCollectionViewController alloc]
initWithBrowserState:browserState]; initWithBrowserState:browserState];
controller.dispatcher = [delegate dispatcherForSettings]; controller.dispatcher = [delegate dispatcherForSettings];
......
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