Commit 73377647 authored by David Jean's avatar David Jean Committed by Commit Bot

[ios] add manual fallback credit card cell

Bug: 845472
Change-Id: Ifc6f448c0000d4886a15aab5b06a979bd8dc63d6
Reviewed-on: https://chromium-review.googlesource.com/c/1303730
Commit-Queue: David Jean <djean@chromium.org>
Reviewed-by: default avatarMoe Ahmadi <mahmadi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#605649}
parent f51c4a6d
......@@ -46,12 +46,15 @@ source_set("manual_fill_ui") {
sources = [
"action_cell.h",
"action_cell.mm",
"card_list_delegate.h",
"credential.h",
"credential.mm",
"keyboard_observer_helper.h",
"keyboard_observer_helper.mm",
"manual_fill_accessory_view_controller.h",
"manual_fill_accessory_view_controller.mm",
"manual_fill_card_cell.h",
"manual_fill_card_cell.mm",
"manual_fill_content_delegate.h",
"manual_fill_password_cell.h",
"manual_fill_password_cell.mm",
......@@ -64,9 +67,12 @@ source_set("manual_fill_ui") {
]
deps = [
"//base",
"//components/autofill/core/browser",
"//components/autofill/core/common",
"//components/autofill/ios/browser",
"//components/password_manager/core/browser",
"//ios/chrome/app/strings:ios_strings_grit",
"//ios/chrome/browser",
"//ios/chrome/browser/autofill/manual_fill:manual_fill",
"//ios/chrome/browser/ui/autofill/manual_fill/resources:addresses",
"//ios/chrome/browser/ui/autofill/manual_fill/resources:mf_arrow_down",
......
// 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.
#ifndef IOS_CHROME_BROWSER_UI_AUTOFILL_MANUAL_FILL_CARD_LIST_DELEGATE_H_
#define IOS_CHROME_BROWSER_UI_AUTOFILL_MANUAL_FILL_CARD_LIST_DELEGATE_H_
namespace autofill {
class CreditCard;
} // namespace autofill
// Delegate for actions in manual fallback's cards list.
@protocol CardListDelegate
// Dismisses the presented view controller and continues as pop over on iPads
// or above the keyboard else.
- (void)dismissPresentedViewController;
// Opens cards settings.
- (void)openCardSettings;
// Open credit card unlock, through CVC, prompt.
- (void)requestFullCreditCard:(const autofill::CreditCard&)card;
@end
#endif // IOS_CHROME_BROWSER_UI_AUTOFILL_MANUAL_FILL_CARD_LIST_DELEGATE_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.
#ifndef IOS_CHROME_BROWSER_UI_AUTOFILL_MANUAL_FILL_MANUAL_FILL_CARD_CELL_H_
#define IOS_CHROME_BROWSER_UI_AUTOFILL_MANUAL_FILL_MANUAL_FILL_CARD_CELL_H_
#import <UIKit/UIKit.h>
#import "ios/chrome/browser/ui/table_view/cells/table_view_item.h"
namespace autofill {
class CreditCard;
} // namespace autofill
@protocol CardListDelegate;
@protocol ManualFillContentDelegate;
// Wrapper to show card cells in a ChromeTableViewController.
@interface ManualFillCardItem : TableViewItem
- (instancetype)initWithCreditCard:(const autofill::CreditCard&)card
contentDelegate:
(id<ManualFillContentDelegate>)contentDelegate
navigationDelegate:(id<CardListDelegate>)navigationDelegate
NS_DESIGNATED_INITIALIZER;
- (instancetype)initWithType:(NSInteger)type NS_UNAVAILABLE;
@end
// Cell to display a Card where the username and password are interactable
// and send the data to the delegate.
@interface ManualFillCardCell : UITableViewCell
// Updates the cell with credit card and the |delegate| to be notified.
- (void)setUpWithCreditCard:(const autofill::CreditCard&)card
contentDelegate:(id<ManualFillContentDelegate>)contentDelegate
navigationDelegate:(id<CardListDelegate>)navigationDelegate;
@end
#endif // IOS_CHROME_BROWSER_UI_AUTOFILL_MANUAL_FILL_MANUAL_FILL_CARD_CELL_H_
......@@ -156,7 +156,7 @@ static const CGFloat BottomSystemSpacingMultiplier = 2.26;
self.selectionStyle = UITableViewCellSelectionStyleNone;
UIView* grayLine = [[UIView alloc] init];
grayLine.backgroundColor = [UIColor colorWithWhite:0.88 alpha:1];
grayLine.backgroundColor = UIColor.cr_manualFillGrayLineColor;
grayLine.translatesAutoresizingMaskIntoConstraints = NO;
[self.contentView addSubview:grayLine];
......
......@@ -15,6 +15,9 @@
// Color for the line separators in manual fill (0.66, 0.66, 0.66 RGB).
@property(class, nonatomic, readonly) UIColor* cr_manualFillSeparatorColor;
// Color for the gray line separators in manual fill.
@property(class, nonatomic, readonly) UIColor* cr_manualFillGrayLineColor;
@end
#endif // IOS_CHROME_BROWSER_UI_AUTOFILL_MANUAL_FILL_UICOLOR_MANUALFILL_H_
......@@ -24,4 +24,9 @@
return color;
}
+ (UIColor*)cr_manualFillGrayLineColor {
static UIColor* color = [UIColor colorWithWhite:0.88 alpha:1];
return color;
}
@end
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