Commit 38797b5c authored by Gauthier Ambard's avatar Gauthier Ambard Committed by Commit Bot

[iOS] Convert ImportData to UITableView

This CL converts ImportDataCollectionViewController to use UITableView
instead of MDCCollectionViewController.

Bug: 894791
Change-Id: I38a99ae849ef2b30d90820b197f4ba56edadabba
Reviewed-on: https://chromium-review.googlesource.com/c/1352156
Commit-Queue: Gauthier Ambard <gambard@chromium.org>
Reviewed-by: default avatarRohit Rao <rohitrao@chromium.org>
Reviewed-by: default avataredchin <edchin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#612205}
parent 1854accc
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
#include "ios/chrome/browser/ui/alert_coordinator/alert_coordinator.h" #include "ios/chrome/browser/ui/alert_coordinator/alert_coordinator.h"
#import "ios/chrome/browser/ui/authentication/authentication_ui_util.h" #import "ios/chrome/browser/ui/authentication/authentication_ui_util.h"
#import "ios/chrome/browser/ui/commands/browsing_data_commands.h" #import "ios/chrome/browser/ui/commands/browsing_data_commands.h"
#import "ios/chrome/browser/ui/settings/import_data_collection_view_controller.h" #import "ios/chrome/browser/ui/settings/import_data_table_view_controller.h"
#import "ios/chrome/browser/ui/settings/settings_navigation_controller.h" #import "ios/chrome/browser/ui/settings/settings_navigation_controller.h"
#include "ios/chrome/grit/ios_chromium_strings.h" #include "ios/chrome/grit/ios_chromium_strings.h"
#include "ios/chrome/grit/ios_strings.h" #include "ios/chrome/grit/ios_strings.h"
...@@ -396,7 +396,7 @@ const int64_t kAuthenticationFlowTimeoutSeconds = 10; ...@@ -396,7 +396,7 @@ const int64_t kAuthenticationFlowTimeoutSeconds = 10;
#pragma mark - ImportDataControllerDelegate #pragma mark - ImportDataControllerDelegate
- (void)didChooseClearDataPolicy:(ImportDataCollectionViewController*)controller - (void)didChooseClearDataPolicy:(ImportDataTableViewController*)controller
shouldClearData:(ShouldClearData)shouldClearData { shouldClearData:(ShouldClearData)shouldClearData {
DCHECK_NE(SHOULD_CLEAR_DATA_USER_CHOICE, shouldClearData); DCHECK_NE(SHOULD_CLEAR_DATA_USER_CHOICE, shouldClearData);
if (shouldClearData == SHOULD_CLEAR_DATA_CLEAR_DATA) { if (shouldClearData == SHOULD_CLEAR_DATA_CLEAR_DATA) {
......
...@@ -58,8 +58,8 @@ source_set("settings") { ...@@ -58,8 +58,8 @@ source_set("settings") {
"google_services_settings_view_controller_model_delegate.h", "google_services_settings_view_controller_model_delegate.h",
"handoff_table_view_controller.h", "handoff_table_view_controller.h",
"handoff_table_view_controller.mm", "handoff_table_view_controller.mm",
"import_data_collection_view_controller.h", "import_data_table_view_controller.h",
"import_data_collection_view_controller.mm", "import_data_table_view_controller.mm",
"legacy_autofill_edit_collection_view_controller+protected.h", "legacy_autofill_edit_collection_view_controller+protected.h",
"legacy_autofill_edit_collection_view_controller.h", "legacy_autofill_edit_collection_view_controller.h",
"legacy_autofill_edit_collection_view_controller.mm", "legacy_autofill_edit_collection_view_controller.mm",
...@@ -281,7 +281,7 @@ source_set("unit_tests") { ...@@ -281,7 +281,7 @@ source_set("unit_tests") {
"compose_email_handler_collection_view_controller_unittest.mm", "compose_email_handler_collection_view_controller_unittest.mm",
"content_settings_table_view_controller_unittest.mm", "content_settings_table_view_controller_unittest.mm",
"dataplan_usage_table_view_controller_unittest.mm", "dataplan_usage_table_view_controller_unittest.mm",
"import_data_collection_view_controller_unittest.mm", "import_data_table_view_controller_unittest.mm",
"password_details_table_view_controller_unittest.mm", "password_details_table_view_controller_unittest.mm",
"password_exporter_unittest.mm", "password_exporter_unittest.mm",
"privacy_table_view_controller_unittest.mm", "privacy_table_view_controller_unittest.mm",
......
...@@ -7,15 +7,14 @@ ...@@ -7,15 +7,14 @@
#import <UIKit/UIKit.h> #import <UIKit/UIKit.h>
#import "ios/chrome/browser/ui/collection_view/cells/collection_view_item.h" #import "ios/chrome/browser/ui/table_view/cells/table_view_item.h"
#import "ios/third_party/material_components_ios/src/components/CollectionCells/src/MaterialCollectionCells.h"
// ImportDataMultilineDetailItem is a model class that uses // ImportDataMultilineDetailItem is a model class that uses
// ImportDataMultilineDetailCell. // ImportDataMultilineDetailCell.
@interface ImportDataMultilineDetailItem : CollectionViewItem @interface ImportDataMultilineDetailItem : TableViewItem
// The accessory type to display on the trailing edge of the cell. // The accessory type to display on the trailing edge of the cell.
@property(nonatomic) MDCCollectionViewCellAccessoryType accessoryType; @property(nonatomic) UITableViewCellAccessoryType accessoryType;
// The main text string. // The main text string.
@property(nonatomic, copy) NSString* text; @property(nonatomic, copy) NSString* text;
...@@ -25,12 +24,12 @@ ...@@ -25,12 +24,12 @@
@end @end
// ImportDataMultilineDetailCell implements an MDCCollectionViewCell // ImportDataMultilineDetailCell implements an UITableViewCell
// subclass containing two text labels: a "main" label and a "detail" label. // subclass containing two text labels: a "main" label and a "detail" label.
// The two labels are laid out on top of each other. The detail text can span // The two labels are laid out on top of each other. The detail text can span
// multiple lines. // multiple lines.
// This is to be used with a ImportDataMultilineDetailItem. // This is to be used with a ImportDataMultilineDetailItem.
@interface ImportDataMultilineDetailCell : MDCCollectionViewCell @interface ImportDataMultilineDetailCell : UITableViewCell
// UILabels corresponding to |text| and |detailText| from the item. // UILabels corresponding to |text| and |detailText| from the item.
@property(nonatomic, readonly, strong) UILabel* textLabel; @property(nonatomic, readonly, strong) UILabel* textLabel;
......
...@@ -4,25 +4,15 @@ ...@@ -4,25 +4,15 @@
#import "ios/chrome/browser/ui/settings/cells/import_data_multiline_detail_item.h" #import "ios/chrome/browser/ui/settings/cells/import_data_multiline_detail_item.h"
#import "ios/chrome/browser/ui/collection_view/cells/MDCCollectionViewCell+Chrome.h" #import "ios/chrome/browser/ui/settings/cells/settings_cells_constants.h"
#include "ios/chrome/browser/ui/collection_view/cells/collection_view_cell_constants.h" #import "ios/chrome/browser/ui/table_view/cells/table_view_cells_constants.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/ui_util/constraints_ui_util.h" #import "ios/chrome/common/ui_util/constraints_ui_util.h"
#import "ios/third_party/material_components_ios/src/components/Palettes/src/MaterialPalettes.h"
#import "ios/third_party/material_components_ios/src/components/Typography/src/MaterialTypography.h"
#if !defined(__has_feature) || !__has_feature(objc_arc) #if !defined(__has_feature) || !__has_feature(objc_arc)
#error "This file requires ARC support." #error "This file requires ARC support."
#endif #endif
namespace {
// Padding used on the leading and trailing edges of the cell.
const CGFloat kHorizontalPadding = 16;
// Padding used on the top and bottom edges of the cell.
const CGFloat kVerticalPadding = 16;
} // namespace
@implementation ImportDataMultilineDetailItem @implementation ImportDataMultilineDetailItem
@synthesize accessoryType = _accessoryType; @synthesize accessoryType = _accessoryType;
...@@ -39,9 +29,10 @@ const CGFloat kVerticalPadding = 16; ...@@ -39,9 +29,10 @@ const CGFloat kVerticalPadding = 16;
#pragma mark CollectionViewItem #pragma mark CollectionViewItem
- (void)configureCell:(ImportDataMultilineDetailCell*)cell { - (void)configureCell:(ImportDataMultilineDetailCell*)cell
[super configureCell:cell]; withStyler:(ChromeTableViewStyler*)styler {
[cell cr_setAccessoryType:self.accessoryType]; [super configureCell:cell withStyler:styler];
cell.accessoryType = self.accessoryType;
cell.textLabel.text = self.text; cell.textLabel.text = self.text;
cell.detailTextLabel.text = self.detailText; cell.detailTextLabel.text = self.detailText;
} }
...@@ -53,34 +44,37 @@ const CGFloat kVerticalPadding = 16; ...@@ -53,34 +44,37 @@ const CGFloat kVerticalPadding = 16;
@synthesize textLabel = _textLabel; @synthesize textLabel = _textLabel;
@synthesize detailTextLabel = _detailTextLabel; @synthesize detailTextLabel = _detailTextLabel;
- (instancetype)initWithFrame:(CGRect)frame { - (instancetype)initWithStyle:(UITableViewCellStyle)style
self = [super initWithFrame:frame]; reuseIdentifier:(NSString*)reuseIdentifier {
self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
if (self) { if (self) {
self.isAccessibilityElement = YES; self.isAccessibilityElement = YES;
UIView* contentView = self.contentView; UIView* contentView = self.contentView;
_textLabel = [[UILabel alloc] init]; _textLabel = [[UILabel alloc] init];
_textLabel.translatesAutoresizingMaskIntoConstraints = NO; _textLabel.translatesAutoresizingMaskIntoConstraints = NO;
_textLabel.font = [UIFont systemFontOfSize:kUIKitMainFontSize]; _textLabel.font = [UIFont preferredFontForTextStyle:UIFontTextStyleBody];
_textLabel.textColor = UIColorFromRGB(kUIKitMainTextColor); _textLabel.adjustsFontForContentSizeCategory = YES;
_textLabel.textColor = UIColor.blackColor;
[contentView addSubview:_textLabel]; [contentView addSubview:_textLabel];
_detailTextLabel = [[UILabel alloc] init]; _detailTextLabel = [[UILabel alloc] init];
_detailTextLabel.translatesAutoresizingMaskIntoConstraints = NO; _detailTextLabel.translatesAutoresizingMaskIntoConstraints = NO;
_detailTextLabel.numberOfLines = 0; _detailTextLabel.numberOfLines = 0;
_detailTextLabel.font = _detailTextLabel.font =
[UIFont systemFontOfSize:kUIKitMultilineDetailFontSize]; [UIFont preferredFontForTextStyle:UIFontTextStyleCaption1];
_detailTextLabel.textColor = UIColorFromRGB(kUIKitMultilineDetailTextColor); _detailTextLabel.adjustsFontForContentSizeCategory = YES;
_detailTextLabel.textColor = UIColorFromRGB(kSettingsCellsDetailTextColor);
[contentView addSubview:_detailTextLabel]; [contentView addSubview:_detailTextLabel];
// Set up the constraints. // Set up the constraints.
[NSLayoutConstraint activateConstraints:@[ [NSLayoutConstraint activateConstraints:@[
[_textLabel.leadingAnchor [_textLabel.leadingAnchor
constraintEqualToAnchor:contentView.leadingAnchor constraintEqualToAnchor:contentView.leadingAnchor
constant:kHorizontalPadding], constant:kTableViewHorizontalSpacing],
[_textLabel.trailingAnchor [_textLabel.trailingAnchor
constraintEqualToAnchor:contentView.trailingAnchor constraintEqualToAnchor:contentView.trailingAnchor
constant:-kHorizontalPadding], constant:-kTableViewHorizontalSpacing],
[_detailTextLabel.leadingAnchor [_detailTextLabel.leadingAnchor
constraintEqualToAnchor:_textLabel.leadingAnchor], constraintEqualToAnchor:_textLabel.leadingAnchor],
[_detailTextLabel.trailingAnchor [_detailTextLabel.trailingAnchor
...@@ -89,41 +83,11 @@ const CGFloat kVerticalPadding = 16; ...@@ -89,41 +83,11 @@ const CGFloat kVerticalPadding = 16;
constraintEqualToAnchor:_detailTextLabel.topAnchor], constraintEqualToAnchor:_detailTextLabel.topAnchor],
]]; ]];
AddOptionalVerticalPadding(contentView, _textLabel, _detailTextLabel, AddOptionalVerticalPadding(contentView, _textLabel, _detailTextLabel,
kVerticalPadding); kTableViewLargeVerticalSpacing);
} }
return self; return self;
} }
- (void)layoutSubviews {
// When the accessory type is None, the content view of the cell (and thus)
// the labels inside it span larger than when there is a Checkmark accessory
// type. That means that toggling the accessory type can induce a rewrapping
// of the detail text, which is not visually pleasing. To alleviate that
// issue, always lay out the cell as if there was a Checkmark accessory type.
//
// Force the accessory type to Checkmark for the duration of layout.
MDCCollectionViewCellAccessoryType realAccessoryType = self.accessoryType;
self.accessoryType = MDCCollectionViewCellAccessoryCheckmark;
// Implement -layoutSubviews as per instructions in documentation for
// +[MDCCollectionViewCell cr_preferredHeightForWidth:forItem:].
[super layoutSubviews];
// Adjust the text label preferredMaxLayoutWidth when the parent's width
// changes, for instance on screen rotation.
CGFloat parentWidth = CGRectGetWidth(self.contentView.bounds);
self.textLabel.preferredMaxLayoutWidth = parentWidth - 2 * kHorizontalPadding;
self.detailTextLabel.preferredMaxLayoutWidth =
parentWidth - 2 * kHorizontalPadding;
// Re-layout with the new preferred width to allow the label to adjust its
// height.
[super layoutSubviews];
// Restore the real accessory type at the end of the layout.
self.accessoryType = realAccessoryType;
}
#pragma mark Accessibility #pragma mark Accessibility
- (NSString*)accessibilityLabel { - (NSString*)accessibilityLabel {
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
#import "ios/chrome/browser/ui/settings/cells/import_data_multiline_detail_item.h" #import "ios/chrome/browser/ui/settings/cells/import_data_multiline_detail_item.h"
#import "ios/chrome/browser/ui/table_view/chrome_table_view_styler.h"
#include "testing/gtest/include/gtest/gtest.h" #include "testing/gtest/include/gtest/gtest.h"
#import "testing/gtest_mac.h" #import "testing/gtest_mac.h"
#include "testing/platform_test.h" #include "testing/platform_test.h"
...@@ -38,7 +39,7 @@ TEST_F(ImportDataMultilineDetailItemTest, ConfigureCell) { ...@@ -38,7 +39,7 @@ TEST_F(ImportDataMultilineDetailItemTest, ConfigureCell) {
EXPECT_FALSE(multilineDetailCell.textLabel.text); EXPECT_FALSE(multilineDetailCell.textLabel.text);
EXPECT_FALSE(multilineDetailCell.detailTextLabel.text); EXPECT_FALSE(multilineDetailCell.detailTextLabel.text);
[item configureCell:cell]; [item configureCell:cell withStyler:[[ChromeTableViewStyler alloc] init]];
EXPECT_NSEQ(text, multilineDetailCell.textLabel.text); EXPECT_NSEQ(text, multilineDetailCell.textLabel.text);
EXPECT_NSEQ(detailText, multilineDetailCell.detailTextLabel.text); EXPECT_NSEQ(detailText, multilineDetailCell.detailTextLabel.text);
} }
......
...@@ -2,13 +2,13 @@ ...@@ -2,13 +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.
#ifndef IOS_CHROME_BROWSER_UI_SETTINGS_IMPORT_DATA_COLLECTION_VIEW_CONTROLLER_H_ #ifndef IOS_CHROME_BROWSER_UI_SETTINGS_IMPORT_DATA_TABLE_VIEW_CONTROLLER_H_
#define IOS_CHROME_BROWSER_UI_SETTINGS_IMPORT_DATA_COLLECTION_VIEW_CONTROLLER_H_ #define IOS_CHROME_BROWSER_UI_SETTINGS_IMPORT_DATA_TABLE_VIEW_CONTROLLER_H_
#import "ios/chrome/browser/signin/constants.h" #import "ios/chrome/browser/signin/constants.h"
#import "ios/chrome/browser/ui/settings/settings_root_collection_view_controller.h" #import "ios/chrome/browser/ui/settings/settings_root_table_view_controller.h"
@class ImportDataCollectionViewController; @class ImportDataTableViewController;
// The accessibility identifier of the Import Data cell. // The accessibility identifier of the Import Data cell.
extern NSString* const kImportDataImportCellId; extern NSString* const kImportDataImportCellId;
...@@ -17,19 +17,18 @@ extern NSString* const kImportDataImportCellId; ...@@ -17,19 +17,18 @@ extern NSString* const kImportDataImportCellId;
extern NSString* const kImportDataKeepSeparateCellId; extern NSString* const kImportDataKeepSeparateCellId;
// Notifies of the user action on the corresponding // Notifies of the user action on the corresponding
// ImportDataCollectionViewController. // ImportDataTableViewController.
@protocol ImportDataControllerDelegate @protocol ImportDataControllerDelegate
// Indicates that the user chose the clear data policy to be |shouldClearData| // Indicates that the user chose the clear data policy to be |shouldClearData|
// when presented with |controller|. // when presented with |controller|.
- (void)didChooseClearDataPolicy:(ImportDataCollectionViewController*)controller - (void)didChooseClearDataPolicy:(ImportDataTableViewController*)controller
shouldClearData:(ShouldClearData)shouldClearData; shouldClearData:(ShouldClearData)shouldClearData;
@end @end
// Collection View that handles how to import data during account switching. // Table View that handles how to import data during account switching.
@interface ImportDataCollectionViewController @interface ImportDataTableViewController : SettingsRootTableViewController
: SettingsRootCollectionViewController
// |fromEmail| is the email of the previously signed in account. // |fromEmail| is the email of the previously signed in account.
// |toIdentity| is the email of the account switched to. // |toIdentity| is the email of the account switched to.
...@@ -41,10 +40,11 @@ extern NSString* const kImportDataKeepSeparateCellId; ...@@ -41,10 +40,11 @@ extern NSString* const kImportDataKeepSeparateCellId;
toEmail:(NSString*)toEmail toEmail:(NSString*)toEmail
isSignedIn:(BOOL)isSignedIn NS_DESIGNATED_INITIALIZER; isSignedIn:(BOOL)isSignedIn NS_DESIGNATED_INITIALIZER;
- (instancetype)initWithLayout:(UICollectionViewLayout*)layout - (instancetype)initWithTableViewStyle:(UITableViewStyle)style
style:(CollectionViewControllerStyle)style appBarStyle:
(ChromeTableViewControllerStyle)appBarStyle
NS_UNAVAILABLE; NS_UNAVAILABLE;
@end @end
#endif // IOS_CHROME_BROWSER_UI_SETTINGS_IMPORT_DATA_COLLECTION_VIEW_CONTROLLER_H_ #endif // IOS_CHROME_BROWSER_UI_SETTINGS_IMPORT_DATA_TABLE_VIEW_CONTROLLER_H_
...@@ -2,20 +2,16 @@ ...@@ -2,20 +2,16 @@
// 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/import_data_collection_view_controller.h" #import "ios/chrome/browser/ui/settings/import_data_table_view_controller.h"
#include "base/logging.h" #include "base/logging.h"
#import "base/mac/foundation_util.h" #import "base/mac/foundation_util.h"
#include "base/strings/sys_string_conversions.h" #include "base/strings/sys_string_conversions.h"
#import "ios/chrome/browser/ui/collection_view/cells/MDCCollectionViewCell+Chrome.h"
#import "ios/chrome/browser/ui/collection_view/cells/collection_view_item.h"
#import "ios/chrome/browser/ui/collection_view/collection_view_model.h"
#import "ios/chrome/browser/ui/settings/cells/card_multiline_item.h"
#import "ios/chrome/browser/ui/settings/cells/import_data_multiline_detail_item.h" #import "ios/chrome/browser/ui/settings/cells/import_data_multiline_detail_item.h"
#import "ios/chrome/browser/ui/table_view/cells/table_view_text_item.h"
#import "ios/chrome/browser/ui/table_view/table_view_model.h"
#include "ios/chrome/grit/ios_chromium_strings.h" #include "ios/chrome/grit/ios_chromium_strings.h"
#include "ios/chrome/grit/ios_strings.h" #include "ios/chrome/grit/ios_strings.h"
#import "ios/third_party/material_components_ios/src/components/CollectionCells/src/MaterialCollectionCells.h"
#import "ios/third_party/material_components_ios/src/components/Collections/src/MaterialCollections.h"
#include "ui/base/l10n/l10n_util_mac.h" #include "ui/base/l10n/l10n_util_mac.h"
#if !defined(__has_feature) || !__has_feature(objc_arc) #if !defined(__has_feature) || !__has_feature(objc_arc)
...@@ -43,7 +39,7 @@ typedef NS_ENUM(NSInteger, ItemType) { ...@@ -43,7 +39,7 @@ typedef NS_ENUM(NSInteger, ItemType) {
} // namespace } // namespace
@implementation ImportDataCollectionViewController { @implementation ImportDataTableViewController {
__weak id<ImportDataControllerDelegate> _delegate; __weak id<ImportDataControllerDelegate> _delegate;
NSString* _fromEmail; NSString* _fromEmail;
NSString* _toEmail; NSString* _toEmail;
...@@ -53,7 +49,7 @@ typedef NS_ENUM(NSInteger, ItemType) { ...@@ -53,7 +49,7 @@ typedef NS_ENUM(NSInteger, ItemType) {
ImportDataMultilineDetailItem* _keepDataSeparateItem; ImportDataMultilineDetailItem* _keepDataSeparateItem;
} }
#pragma mark Initialization #pragma mark - Initialization
- (instancetype)initWithDelegate:(id<ImportDataControllerDelegate>)delegate - (instancetype)initWithDelegate:(id<ImportDataControllerDelegate>)delegate
fromEmail:(NSString*)fromEmail fromEmail:(NSString*)fromEmail
...@@ -61,9 +57,9 @@ typedef NS_ENUM(NSInteger, ItemType) { ...@@ -61,9 +57,9 @@ typedef NS_ENUM(NSInteger, ItemType) {
isSignedIn:(BOOL)isSignedIn { isSignedIn:(BOOL)isSignedIn {
DCHECK(fromEmail); DCHECK(fromEmail);
DCHECK(toEmail); DCHECK(toEmail);
UICollectionViewLayout* layout = [[MDCCollectionViewFlowLayout alloc] init];
self = self =
[super initWithLayout:layout style:CollectionViewControllerStyleAppBar]; [super initWithTableViewStyle:UITableViewStyleGrouped
appBarStyle:ChromeTableViewControllerStyleWithAppBar];
if (self) { if (self) {
_delegate = delegate; _delegate = delegate;
_fromEmail = [fromEmail copy]; _fromEmail = [fromEmail copy];
...@@ -76,24 +72,29 @@ typedef NS_ENUM(NSInteger, ItemType) { ...@@ -76,24 +72,29 @@ typedef NS_ENUM(NSInteger, ItemType) {
? l10n_util::GetNSString(IDS_IOS_OPTIONS_IMPORT_DATA_TITLE_SWITCH) ? l10n_util::GetNSString(IDS_IOS_OPTIONS_IMPORT_DATA_TITLE_SWITCH)
: l10n_util::GetNSString(IDS_IOS_OPTIONS_IMPORT_DATA_TITLE_SIGNIN); : l10n_util::GetNSString(IDS_IOS_OPTIONS_IMPORT_DATA_TITLE_SIGNIN);
[self setShouldHideDoneButton:YES]; [self setShouldHideDoneButton:YES];
}
return self;
}
- (void)viewDidLoad {
[super viewDidLoad];
[self setShouldHideDoneButton:YES];
self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc]
initWithTitle:l10n_util::GetNSString( initWithTitle:l10n_util::GetNSString(
IDS_IOS_OPTIONS_IMPORT_DATA_CONTINUE_BUTTON) IDS_IOS_OPTIONS_IMPORT_DATA_CONTINUE_BUTTON)
style:UIBarButtonItemStyleDone style:UIBarButtonItemStyleDone
target:self target:self
action:@selector(didTapContinue)]; action:@selector(didTapContinue)];
// TODO(crbug.com/764578): -loadModel should not be called from
// initializer. A possible fix is to move this call to -viewDidLoad.
[self loadModel]; [self loadModel];
}
return self;
} }
#pragma mark SettingsRootCollectionViewController #pragma mark - SettingsRootTableViewController
- (void)loadModel { - (void)loadModel {
[super loadModel]; [super loadModel];
CollectionViewModel* model = self.collectionViewModel; TableViewModel* model = self.tableViewModel;
[model addSectionWithIdentifier:SectionIdentifierDisclaimer]; [model addSectionWithIdentifier:SectionIdentifierDisclaimer];
[model addItem:[self descriptionItem] [model addItem:[self descriptionItem]
...@@ -115,13 +116,14 @@ typedef NS_ENUM(NSInteger, ItemType) { ...@@ -115,13 +116,14 @@ typedef NS_ENUM(NSInteger, ItemType) {
} }
} }
#pragma mark Items #pragma mark - Items
- (CollectionViewItem*)descriptionItem { - (TableViewItem*)descriptionItem {
CardMultilineItem* item = TableViewTextItem* item =
[[CardMultilineItem alloc] initWithType:ItemTypeFooter]; [[TableViewTextItem alloc] initWithType:ItemTypeFooter];
item.text = l10n_util::GetNSStringF(IDS_IOS_OPTIONS_IMPORT_DATA_HEADER, item.text = l10n_util::GetNSStringF(IDS_IOS_OPTIONS_IMPORT_DATA_HEADER,
base::SysNSStringToUTF16(_fromEmail)); base::SysNSStringToUTF16(_fromEmail));
item.textColor = UIColor.blackColor;
return item; return item;
} }
...@@ -132,8 +134,8 @@ typedef NS_ENUM(NSInteger, ItemType) { ...@@ -132,8 +134,8 @@ typedef NS_ENUM(NSInteger, ItemType) {
item.detailText = item.detailText =
l10n_util::GetNSStringF(IDS_IOS_OPTIONS_IMPORT_DATA_IMPORT_SUBTITLE, l10n_util::GetNSStringF(IDS_IOS_OPTIONS_IMPORT_DATA_IMPORT_SUBTITLE,
base::SysNSStringToUTF16(_toEmail)); base::SysNSStringToUTF16(_toEmail));
item.accessoryType = _isSignedIn ? MDCCollectionViewCellAccessoryNone item.accessoryType = _isSignedIn ? UITableViewCellAccessoryNone
: MDCCollectionViewCellAccessoryCheckmark; : UITableViewCellAccessoryCheckmark;
item.accessibilityIdentifier = kImportDataImportCellId; item.accessibilityIdentifier = kImportDataImportCellId;
return item; return item;
} }
...@@ -150,54 +152,52 @@ typedef NS_ENUM(NSInteger, ItemType) { ...@@ -150,54 +152,52 @@ typedef NS_ENUM(NSInteger, ItemType) {
item.detailText = l10n_util::GetNSString( item.detailText = l10n_util::GetNSString(
IDS_IOS_OPTIONS_IMPORT_DATA_KEEP_SUBTITLE_SIGNIN); IDS_IOS_OPTIONS_IMPORT_DATA_KEEP_SUBTITLE_SIGNIN);
} }
item.accessoryType = _isSignedIn ? MDCCollectionViewCellAccessoryCheckmark item.accessoryType = _isSignedIn ? UITableViewCellAccessoryCheckmark
: MDCCollectionViewCellAccessoryNone; : UITableViewCellAccessoryNone;
item.accessibilityIdentifier = kImportDataKeepSeparateCellId; item.accessibilityIdentifier = kImportDataKeepSeparateCellId;
return item; return item;
} }
#pragma mark MDCCollectionViewStylingDelegate #pragma mark - UITableViewDelegate
- (CGFloat)collectionView:(UICollectionView*)collectionView - (BOOL)tableView:(UITableView*)tableView
cellHeightAtIndexPath:(NSIndexPath*)indexPath { shouldHighlightRowAtIndexPath:(NSIndexPath*)indexPath {
CollectionViewItem* item = NSInteger sectionIdentifier =
[self.collectionViewModel itemAtIndexPath:indexPath]; [self.tableViewModel sectionIdentifierForSection:indexPath.section];
CGFloat cardWidth = CGRectGetWidth(collectionView.bounds) - if (sectionIdentifier != SectionIdentifierOptions)
2 * MDCCollectionViewCellStyleCardSectionInset; return NO;
return return YES;
[MDCCollectionViewCell cr_preferredHeightForWidth:cardWidth forItem:item];
} }
#pragma mark UICollectionViewDelegate - (void)tableView:(UITableView*)tableView
didSelectRowAtIndexPath:(NSIndexPath*)indexPath {
- (void)collectionView:(UICollectionView*)collectionView [super tableView:tableView didSelectRowAtIndexPath:indexPath];
didSelectItemAtIndexPath:(NSIndexPath*)indexPath {
[super collectionView:collectionView didSelectItemAtIndexPath:indexPath];
NSInteger sectionIdentifier = NSInteger sectionIdentifier =
[self.collectionViewModel sectionIdentifierForSection:indexPath.section]; [self.tableViewModel sectionIdentifierForSection:indexPath.section];
if (sectionIdentifier == SectionIdentifierOptions) { if (sectionIdentifier == SectionIdentifierOptions) {
// Store the user choice. // Store the user choice.
NSInteger itemType = NSInteger itemType = [self.tableViewModel itemTypeForIndexPath:indexPath];
[self.collectionViewModel itemTypeForIndexPath:indexPath];
_shouldClearData = (itemType == ItemTypeOptionImportData) _shouldClearData = (itemType == ItemTypeOptionImportData)
? SHOULD_CLEAR_DATA_MERGE_DATA ? SHOULD_CLEAR_DATA_MERGE_DATA
: SHOULD_CLEAR_DATA_CLEAR_DATA; : SHOULD_CLEAR_DATA_CLEAR_DATA;
[self updateUI]; [self updateUI];
} }
[tableView deselectRowAtIndexPath:indexPath animated:YES];
} }
#pragma mark Private methods #pragma mark - Private
// Updates the UI based on the value of |_shouldClearData|. // Updates the UI based on the value of |_shouldClearData|.
- (void)updateUI { - (void)updateUI {
BOOL importDataSelected = _shouldClearData == SHOULD_CLEAR_DATA_MERGE_DATA; BOOL importDataSelected = _shouldClearData == SHOULD_CLEAR_DATA_MERGE_DATA;
_importDataItem.accessoryType = importDataSelected _importDataItem.accessoryType = importDataSelected
? MDCCollectionViewCellAccessoryCheckmark ? UITableViewCellAccessoryCheckmark
: MDCCollectionViewCellAccessoryNone; : UITableViewCellAccessoryNone;
_keepDataSeparateItem.accessoryType = _keepDataSeparateItem.accessoryType = importDataSelected
importDataSelected ? MDCCollectionViewCellAccessoryNone ? UITableViewCellAccessoryNone
: MDCCollectionViewCellAccessoryCheckmark; : UITableViewCellAccessoryCheckmark;
[self reconfigureCellsForItems:@[ _importDataItem, _keepDataSeparateItem ]]; [self reconfigureCellsForItems:@[ _importDataItem, _keepDataSeparateItem ]];
} }
......
...@@ -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.
#import "ios/chrome/browser/ui/settings/import_data_collection_view_controller.h" #import "ios/chrome/browser/ui/settings/import_data_table_view_controller.h"
#include "base/mac/foundation_util.h" #include "base/mac/foundation_util.h"
#include "base/strings/sys_string_conversions.h" #include "base/strings/sys_string_conversions.h"
#import "ios/chrome/browser/ui/collection_view/collection_view_controller_test.h"
#import "ios/chrome/browser/ui/collection_view/collection_view_model.h"
#import "ios/chrome/browser/ui/settings/cells/card_multiline_item.h" #import "ios/chrome/browser/ui/settings/cells/card_multiline_item.h"
#import "ios/chrome/browser/ui/settings/cells/import_data_multiline_detail_item.h" #import "ios/chrome/browser/ui/settings/cells/import_data_multiline_detail_item.h"
#import "ios/chrome/browser/ui/table_view/chrome_table_view_controller_test.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"
#include "testing/gtest/include/gtest/gtest.h" #include "testing/gtest/include/gtest/gtest.h"
#import "testing/gtest_mac.h" #import "testing/gtest_mac.h"
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
#endif #endif
@interface ImportDataControllerTestDelegate @interface ImportDataControllerTestDelegate
: NSObject<ImportDataControllerDelegate> : NSObject <ImportDataControllerDelegate>
@property(nonatomic, readonly) BOOL didChooseClearDataPolicyCalled; @property(nonatomic, readonly) BOOL didChooseClearDataPolicyCalled;
@property(nonatomic, readonly) ShouldClearData shouldClearData; @property(nonatomic, readonly) ShouldClearData shouldClearData;
@end @end
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
@synthesize didChooseClearDataPolicyCalled = _didChooseClearDataPolicyCalled; @synthesize didChooseClearDataPolicyCalled = _didChooseClearDataPolicyCalled;
@synthesize shouldClearData = _shouldClearData; @synthesize shouldClearData = _shouldClearData;
- (void)didChooseClearDataPolicy:(ImportDataCollectionViewController*)controller - (void)didChooseClearDataPolicy:(ImportDataTableViewController*)controller
shouldClearData:(ShouldClearData)shouldClearData { shouldClearData:(ShouldClearData)shouldClearData {
_didChooseClearDataPolicyCalled = YES; _didChooseClearDataPolicyCalled = YES;
_shouldClearData = shouldClearData; _shouldClearData = shouldClearData;
...@@ -41,20 +41,19 @@ ...@@ -41,20 +41,19 @@
namespace { namespace {
class ImportDataCollectionViewControllerTest class ImportDataTableViewControllerTest : public ChromeTableViewControllerTest {
: public CollectionViewControllerTest {
public: public:
ImportDataControllerTestDelegate* delegate() { return delegate_; } ImportDataControllerTestDelegate* delegate() { return delegate_; }
protected: protected:
void SetUp() override { void SetUp() override {
CollectionViewControllerTest::SetUp(); ChromeTableViewControllerTest::SetUp();
is_signed_in_ = true; is_signed_in_ = true;
} }
CollectionViewController* InstantiateController() override { ChromeTableViewController* InstantiateController() override {
delegate_ = [[ImportDataControllerTestDelegate alloc] init]; delegate_ = [[ImportDataControllerTestDelegate alloc] init];
return [[ImportDataCollectionViewController alloc] return [[ImportDataTableViewController alloc]
initWithDelegate:delegate_ initWithDelegate:delegate_
fromEmail:@"fromEmail@gmail.com" fromEmail:@"fromEmail@gmail.com"
toEmail:@"toEmail@gmail.com" toEmail:@"toEmail@gmail.com"
...@@ -67,91 +66,89 @@ class ImportDataCollectionViewControllerTest ...@@ -67,91 +66,89 @@ class ImportDataCollectionViewControllerTest
ImportDataControllerTestDelegate* delegate_; ImportDataControllerTestDelegate* delegate_;
}; };
TEST_F(ImportDataCollectionViewControllerTest, TestModelSignedIn) { TEST_F(ImportDataTableViewControllerTest, TestModelSignedIn) {
CreateController(); CreateController();
CheckController(); CheckController();
ASSERT_EQ(2, NumberOfSections()); ASSERT_EQ(2, NumberOfSections());
EXPECT_EQ(1, NumberOfItemsInSection(0)); EXPECT_EQ(1, NumberOfItemsInSection(0));
CardMultilineItem* item = GetCollectionViewItem(0, 0); CardMultilineItem* item = GetTableViewItem(0, 0);
EXPECT_NSEQ( EXPECT_NSEQ(
l10n_util::GetNSStringF(IDS_IOS_OPTIONS_IMPORT_DATA_HEADER, l10n_util::GetNSStringF(IDS_IOS_OPTIONS_IMPORT_DATA_HEADER,
base::SysNSStringToUTF16(@"fromEmail@gmail.com")), base::SysNSStringToUTF16(@"fromEmail@gmail.com")),
item.text); item.text);
EXPECT_EQ(2, NumberOfItemsInSection(1)); EXPECT_EQ(2, NumberOfItemsInSection(1));
CheckTextCellTitleAndSubtitle( CheckTextCellTextAndDetailText(
l10n_util::GetNSString(IDS_IOS_OPTIONS_IMPORT_DATA_KEEP_TITLE), l10n_util::GetNSString(IDS_IOS_OPTIONS_IMPORT_DATA_KEEP_TITLE),
l10n_util::GetNSStringF(IDS_IOS_OPTIONS_IMPORT_DATA_KEEP_SUBTITLE_SWITCH, l10n_util::GetNSStringF(IDS_IOS_OPTIONS_IMPORT_DATA_KEEP_SUBTITLE_SWITCH,
base::SysNSStringToUTF16(@"fromEmail@gmail.com")), base::SysNSStringToUTF16(@"fromEmail@gmail.com")),
1, 0); 1, 0);
CheckAccessoryType(MDCCollectionViewCellAccessoryCheckmark, 1, 0); CheckAccessoryType(UITableViewCellAccessoryCheckmark, 1, 0);
CheckTextCellTitleAndSubtitle( CheckTextCellTextAndDetailText(
l10n_util::GetNSString(IDS_IOS_OPTIONS_IMPORT_DATA_IMPORT_TITLE), l10n_util::GetNSString(IDS_IOS_OPTIONS_IMPORT_DATA_IMPORT_TITLE),
l10n_util::GetNSStringF(IDS_IOS_OPTIONS_IMPORT_DATA_IMPORT_SUBTITLE, l10n_util::GetNSStringF(IDS_IOS_OPTIONS_IMPORT_DATA_IMPORT_SUBTITLE,
base::SysNSStringToUTF16(@"toEmail@gmail.com")), base::SysNSStringToUTF16(@"toEmail@gmail.com")),
1, 1); 1, 1);
CheckAccessoryType(MDCCollectionViewCellAccessoryNone, 1, 1); CheckAccessoryType(UITableViewCellAccessoryNone, 1, 1);
} }
TEST_F(ImportDataCollectionViewControllerTest, TestModelSignedOut) { TEST_F(ImportDataTableViewControllerTest, TestModelSignedOut) {
set_is_signed_in(false); set_is_signed_in(false);
CreateController(); CreateController();
CheckController(); CheckController();
ASSERT_EQ(2, NumberOfSections()); ASSERT_EQ(2, NumberOfSections());
EXPECT_EQ(1, NumberOfItemsInSection(0)); EXPECT_EQ(1, NumberOfItemsInSection(0));
CardMultilineItem* item = GetCollectionViewItem(0, 0); CardMultilineItem* item = GetTableViewItem(0, 0);
EXPECT_NSEQ( EXPECT_NSEQ(
l10n_util::GetNSStringF(IDS_IOS_OPTIONS_IMPORT_DATA_HEADER, l10n_util::GetNSStringF(IDS_IOS_OPTIONS_IMPORT_DATA_HEADER,
base::SysNSStringToUTF16(@"fromEmail@gmail.com")), base::SysNSStringToUTF16(@"fromEmail@gmail.com")),
item.text); item.text);
EXPECT_EQ(2, NumberOfItemsInSection(1)); EXPECT_EQ(2, NumberOfItemsInSection(1));
CheckTextCellTitleAndSubtitle( CheckTextCellTextAndDetailText(
l10n_util::GetNSString(IDS_IOS_OPTIONS_IMPORT_DATA_IMPORT_TITLE), l10n_util::GetNSString(IDS_IOS_OPTIONS_IMPORT_DATA_IMPORT_TITLE),
l10n_util::GetNSStringF(IDS_IOS_OPTIONS_IMPORT_DATA_IMPORT_SUBTITLE, l10n_util::GetNSStringF(IDS_IOS_OPTIONS_IMPORT_DATA_IMPORT_SUBTITLE,
base::SysNSStringToUTF16(@"toEmail@gmail.com")), base::SysNSStringToUTF16(@"toEmail@gmail.com")),
1, 0); 1, 0);
CheckAccessoryType(MDCCollectionViewCellAccessoryCheckmark, 1, 0); CheckAccessoryType(UITableViewCellAccessoryCheckmark, 1, 0);
CheckTextCellTitleAndSubtitle( CheckTextCellTextAndDetailText(
l10n_util::GetNSString(IDS_IOS_OPTIONS_IMPORT_DATA_KEEP_TITLE), l10n_util::GetNSString(IDS_IOS_OPTIONS_IMPORT_DATA_KEEP_TITLE),
l10n_util::GetNSString(IDS_IOS_OPTIONS_IMPORT_DATA_KEEP_SUBTITLE_SIGNIN), l10n_util::GetNSString(IDS_IOS_OPTIONS_IMPORT_DATA_KEEP_SUBTITLE_SIGNIN),
1, 1); 1, 1);
CheckAccessoryType(MDCCollectionViewCellAccessoryNone, 1, 1); CheckAccessoryType(UITableViewCellAccessoryNone, 1, 1);
} }
// Tests that checking a checkbox correctly uncheck the other one. // Tests that checking a checkbox correctly uncheck the other one.
TEST_F(ImportDataCollectionViewControllerTest, TestUniqueBoxChecked) { TEST_F(ImportDataTableViewControllerTest, TestUniqueBoxChecked) {
CreateController(); CreateController();
ImportDataCollectionViewController* import_data_controller = ImportDataTableViewController* import_data_controller =
base::mac::ObjCCastStrict<ImportDataCollectionViewController>( base::mac::ObjCCastStrict<ImportDataTableViewController>(controller());
controller());
NSIndexPath* importIndexPath = [NSIndexPath indexPathForItem:0 inSection:1]; NSIndexPath* importIndexPath = [NSIndexPath indexPathForItem:0 inSection:1];
NSIndexPath* keepSeparateIndexPath = NSIndexPath* keepSeparateIndexPath = [NSIndexPath indexPathForItem:1
[NSIndexPath indexPathForItem:1 inSection:1]; inSection:1];
ImportDataMultilineDetailItem* importItem = ImportDataMultilineDetailItem* importItem =
base::mac::ObjCCastStrict<ImportDataMultilineDetailItem>( base::mac::ObjCCastStrict<ImportDataMultilineDetailItem>(
[import_data_controller.collectionViewModel [import_data_controller.tableViewModel
itemAtIndexPath:importIndexPath]); itemAtIndexPath:importIndexPath]);
ImportDataMultilineDetailItem* keepSeparateItem = ImportDataMultilineDetailItem* keepSeparateItem =
base::mac::ObjCCastStrict<ImportDataMultilineDetailItem>( base::mac::ObjCCastStrict<ImportDataMultilineDetailItem>(
[import_data_controller.collectionViewModel [import_data_controller.tableViewModel
itemAtIndexPath:keepSeparateIndexPath]); itemAtIndexPath:keepSeparateIndexPath]);
[import_data_controller collectionView:[import_data_controller collectionView] [import_data_controller tableView:[import_data_controller tableView]
didSelectItemAtIndexPath:importIndexPath]; didSelectRowAtIndexPath:importIndexPath];
EXPECT_EQ(MDCCollectionViewCellAccessoryCheckmark, importItem.accessoryType); EXPECT_EQ(UITableViewCellAccessoryCheckmark, importItem.accessoryType);
EXPECT_EQ(MDCCollectionViewCellAccessoryNone, keepSeparateItem.accessoryType); EXPECT_EQ(UITableViewCellAccessoryNone, keepSeparateItem.accessoryType);
[import_data_controller collectionView:[import_data_controller collectionView] [import_data_controller tableView:[import_data_controller tableView]
didSelectItemAtIndexPath:keepSeparateIndexPath]; didSelectRowAtIndexPath:keepSeparateIndexPath];
EXPECT_EQ(MDCCollectionViewCellAccessoryNone, importItem.accessoryType); EXPECT_EQ(UITableViewCellAccessoryNone, importItem.accessoryType);
EXPECT_EQ(MDCCollectionViewCellAccessoryCheckmark, EXPECT_EQ(UITableViewCellAccessoryCheckmark, keepSeparateItem.accessoryType);
keepSeparateItem.accessoryType);
} }
// Tests that the default choice when the user is signed in is Clear Data and // Tests that the default choice when the user is signed in is Clear Data and
// that tapping continue will correctly select it. Regression test for // that tapping continue will correctly select it. Regression test for
// crbug.com/649533 // crbug.com/649533
TEST_F(ImportDataCollectionViewControllerTest, TestDefaultChoiceSignedIn) { TEST_F(ImportDataTableViewControllerTest, TestDefaultChoiceSignedIn) {
CreateController(); CreateController();
EXPECT_FALSE(delegate().didChooseClearDataPolicyCalled); EXPECT_FALSE(delegate().didChooseClearDataPolicyCalled);
...@@ -169,7 +166,7 @@ TEST_F(ImportDataCollectionViewControllerTest, TestDefaultChoiceSignedIn) { ...@@ -169,7 +166,7 @@ TEST_F(ImportDataCollectionViewControllerTest, TestDefaultChoiceSignedIn) {
// Tests that the default choice when the user is signed out is Merge Data and // Tests that the default choice when the user is signed out is Merge Data and
// that tapping continue will correctly select it. Regression test for // that tapping continue will correctly select it. Regression test for
// crbug.com/649533 // crbug.com/649533
TEST_F(ImportDataCollectionViewControllerTest, TestDefaultChoiceSignedOut) { TEST_F(ImportDataTableViewControllerTest, TestDefaultChoiceSignedOut) {
set_is_signed_in(false); set_is_signed_in(false);
CreateController(); CreateController();
......
...@@ -94,7 +94,7 @@ newUserFeedbackController:(ios::ChromeBrowserState*)browserState ...@@ -94,7 +94,7 @@ newUserFeedbackController:(ios::ChromeBrowserState*)browserState
delegate:(id<SettingsNavigationControllerDelegate>)delegate delegate:(id<SettingsNavigationControllerDelegate>)delegate
feedbackDataSource:(id<UserFeedbackDataSource>)dataSource; feedbackDataSource:(id<UserFeedbackDataSource>)dataSource;
// Creates and displays a new ImportDataCollectionViewController. |browserState| // Creates and displays a new ImportDataTableViewController. |browserState|
// should not be nil. // should not be nil.
+ (SettingsNavigationController*) + (SettingsNavigationController*)
newImportDataController:(ios::ChromeBrowserState*)browserState newImportDataController:(ios::ChromeBrowserState*)browserState
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
#import "ios/chrome/browser/ui/settings/autofill_profile_collection_view_controller.h" #import "ios/chrome/browser/ui/settings/autofill_profile_collection_view_controller.h"
#import "ios/chrome/browser/ui/settings/google_services_settings_coordinator.h" #import "ios/chrome/browser/ui/settings/google_services_settings_coordinator.h"
#import "ios/chrome/browser/ui/settings/google_services_settings_view_controller.h" #import "ios/chrome/browser/ui/settings/google_services_settings_view_controller.h"
#import "ios/chrome/browser/ui/settings/import_data_collection_view_controller.h" #import "ios/chrome/browser/ui/settings/import_data_table_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"
#import "ios/chrome/browser/ui/settings/settings_collection_view_controller.h" #import "ios/chrome/browser/ui/settings/settings_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"
...@@ -221,8 +221,8 @@ newImportDataController:(ios::ChromeBrowserState*)browserState ...@@ -221,8 +221,8 @@ newImportDataController:(ios::ChromeBrowserState*)browserState
fromEmail:(NSString*)fromEmail fromEmail:(NSString*)fromEmail
toEmail:(NSString*)toEmail toEmail:(NSString*)toEmail
isSignedIn:(BOOL)isSignedIn { isSignedIn:(BOOL)isSignedIn {
UIViewController* controller = [[ImportDataCollectionViewController alloc] UIViewController* controller =
initWithDelegate:importDataDelegate [[ImportDataTableViewController alloc] initWithDelegate:importDataDelegate
fromEmail:fromEmail fromEmail:fromEmail
toEmail:toEmail toEmail:toEmail
isSignedIn:isSignedIn]; isSignedIn:isSignedIn];
......
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
#import "ios/chrome/browser/ui/settings/cells/sync_switch_item.h" #import "ios/chrome/browser/ui/settings/cells/sync_switch_item.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/clear_browsing_data_ui_constants.h" #import "ios/chrome/browser/ui/settings/clear_browsing_data_ui_constants.h"
#import "ios/chrome/browser/ui/settings/import_data_collection_view_controller.h" #import "ios/chrome/browser/ui/settings/import_data_table_view_controller.h"
#import "ios/chrome/browser/ui/settings/settings_collection_view_controller.h" #import "ios/chrome/browser/ui/settings/settings_collection_view_controller.h"
#import "ios/chrome/browser/ui/settings/sync_settings_collection_view_controller.h" #import "ios/chrome/browser/ui/settings/sync_settings_collection_view_controller.h"
#import "ios/chrome/browser/ui/static_content/static_html_view_controller.h" #import "ios/chrome/browser/ui/static_content/static_html_view_controller.h"
......
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