Commit d80e2c10 authored by Shannia's avatar Shannia Committed by Commit Bot

Removing the google pay branding from the keyboard accessory

Change-Id: Ifbb3fe06c160484a945aa1166b6c3f71eaa531e3
Bug: 1005405
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1807228Reviewed-by: default avatarJared Saul <jsaul@google.com>
Reviewed-by: default avatarMoe Ahmadi <mahmadi@chromium.org>
Reviewed-by: default avatarFriedrich [CET] <fhorschig@chromium.org>
Reviewed-by: default avatarEvan Stade <estade@chromium.org>
Commit-Queue: Shannia Fu <shannia@google.com>
Cr-Commit-Position: refs/heads/master@{#700024}
parent 9b1c2175
...@@ -133,7 +133,6 @@ class KeyboardAccessoryMediator ...@@ -133,7 +133,6 @@ class KeyboardAccessoryMediator
case PopupItemId.ITEM_ID_CLEAR_FORM: case PopupItemId.ITEM_ID_CLEAR_FORM:
case PopupItemId.ITEM_ID_CREDIT_CARD_SIGNIN_PROMO: case PopupItemId.ITEM_ID_CREDIT_CARD_SIGNIN_PROMO:
case PopupItemId.ITEM_ID_ALL_SAVED_PASSWORDS_ENTRY: case PopupItemId.ITEM_ID_ALL_SAVED_PASSWORDS_ENTRY:
case PopupItemId.ITEM_ID_GOOGLE_PAY_BRANDING:
case PopupItemId.ITEM_ID_GENERATE_PASSWORD_ENTRY: case PopupItemId.ITEM_ID_GENERATE_PASSWORD_ENTRY:
case PopupItemId.ITEM_ID_SHOW_ACCOUNT_CARDS: case PopupItemId.ITEM_ID_SHOW_ACCOUNT_CARDS:
case PopupItemId.ITEM_ID_AUTOFILL_OPTIONS: case PopupItemId.ITEM_ID_AUTOFILL_OPTIONS:
......
...@@ -189,7 +189,6 @@ const gfx::FontList& AutofillPopupLayoutModel::GetValueFontListForRow( ...@@ -189,7 +189,6 @@ const gfx::FontList& AutofillPopupLayoutModel::GetValueFontListForRow(
case POPUP_ITEM_ID_PASSWORD_ENTRY: case POPUP_ITEM_ID_PASSWORD_ENTRY:
case POPUP_ITEM_ID_ALL_SAVED_PASSWORDS_ENTRY: case POPUP_ITEM_ID_ALL_SAVED_PASSWORDS_ENTRY:
case POPUP_ITEM_ID_GENERATE_PASSWORD_ENTRY: case POPUP_ITEM_ID_GENERATE_PASSWORD_ENTRY:
case POPUP_ITEM_ID_GOOGLE_PAY_BRANDING:
case POPUP_ITEM_ID_SHOW_ACCOUNT_CARDS: case POPUP_ITEM_ID_SHOW_ACCOUNT_CARDS:
return normal_font_list_; return normal_font_list_;
case POPUP_ITEM_ID_AUTOCOMPLETE_ENTRY: case POPUP_ITEM_ID_AUTOCOMPLETE_ENTRY:
......
...@@ -55,12 +55,6 @@ const PaymentRequestData kPaymentRequestData[]{ ...@@ -55,12 +55,6 @@ const PaymentRequestData kPaymentRequestData[]{
{autofill::kVisaCard, "visa", IDR_AUTOFILL_CC_VISA, IDS_AUTOFILL_CC_VISA}, {autofill::kVisaCard, "visa", IDR_AUTOFILL_CC_VISA, IDS_AUTOFILL_CC_VISA},
}; };
#if BUILDFLAG(GOOGLE_CHROME_BRANDING)
const PaymentRequestData kGooglePayBrandingRequestData = {
"googlePay", "googlePay", IDR_AUTOFILL_GOOGLE_PAY,
IDS_AUTOFILL_CC_GOOGLE_PAY};
#endif // BUILDFLAG(GOOGLE_CHROME_BRANDING)
const PaymentRequestData kGenericPaymentRequestData = { const PaymentRequestData kGenericPaymentRequestData = {
autofill::kGenericCard, "generic", IDR_AUTOFILL_CC_GENERIC, autofill::kGenericCard, "generic", IDR_AUTOFILL_CC_GENERIC,
IDS_AUTOFILL_CC_GENERIC}; IDS_AUTOFILL_CC_GENERIC};
...@@ -523,11 +517,6 @@ const PaymentRequestData& GetPaymentRequestData( ...@@ -523,11 +517,6 @@ const PaymentRequestData& GetPaymentRequestData(
if (issuer_network == data.issuer_network) if (issuer_network == data.issuer_network)
return data; return data;
} }
#if BUILDFLAG(GOOGLE_CHROME_BRANDING)
if (issuer_network == kGooglePayBrandingRequestData.issuer_network) {
return kGooglePayBrandingRequestData;
}
#endif // BUILDFLAG(GOOGLE_CHROME_BRANDING)
return kGenericPaymentRequestData; return kGenericPaymentRequestData;
} }
......
...@@ -373,18 +373,6 @@ void AutofillExternalDelegate::ApplyAutofillOptions( ...@@ -373,18 +373,6 @@ void AutofillExternalDelegate::ApplyAutofillOptions(
#endif #endif
} }
// On iOS, GooglePayIcon comes at the begining and hence prepended to the list.
#if defined(OS_IOS)
if (base::FeatureList::IsEnabled(
features::kAutofillDownstreamUseGooglePayBrandingOniOS) &&
is_all_server_suggestions) {
Suggestion googlepay_icon;
googlepay_icon.icon = "googlePay";
googlepay_icon.frontend_id = POPUP_ITEM_ID_GOOGLE_PAY_BRANDING;
suggestions->insert(suggestions->begin(), googlepay_icon);
}
#endif
#if defined(OS_ANDROID) #if defined(OS_ANDROID)
if (IsKeyboardAccessoryEnabled()) { if (IsKeyboardAccessoryEnabled()) {
suggestions->back().icon = "settings"; suggestions->back().icon = "settings";
......
...@@ -36,7 +36,6 @@ ...@@ -36,7 +36,6 @@
#include "ui/base/l10n/l10n_util.h" #include "ui/base/l10n/l10n_util.h"
#include "ui/gfx/geometry/rect.h" #include "ui/gfx/geometry/rect.h"
using autofill::features::kAutofillDownstreamUseGooglePayBrandingOniOS;
using base::ASCIIToUTF16; using base::ASCIIToUTF16;
using testing::_; using testing::_;
...@@ -769,54 +768,6 @@ TEST_F(AutofillExternalDelegateUnitTest, ShouldShowGooglePayIcon) { ...@@ -769,54 +768,6 @@ TEST_F(AutofillExternalDelegateUnitTest, ShouldShowGooglePayIcon) {
kQueryId, autofill_item, /*autoselect_first_suggestion=*/false, true); kQueryId, autofill_item, /*autoselect_first_suggestion=*/false, true);
} }
#if defined(OS_IOS)
TEST_F(AutofillExternalDelegateUnitTest, ShouldShowGooglePayIconOniOS) {
// Turn on feature flag.
base::test::ScopedFeatureList scoped_feature_list_;
scoped_feature_list_.InitAndEnableFeature(
kAutofillDownstreamUseGooglePayBrandingOniOS);
IssueOnQuery(kQueryId);
auto element_icons =
testing::ElementsAre("googlePay", std::string(), "googlePay");
EXPECT_CALL(autofill_client_,
ShowAutofillPopup(_, _, SuggestionVectorIconsAre(element_icons),
false, PopupType::kPersonalInformation, _));
std::vector<Suggestion> autofill_item;
autofill_item.push_back(Suggestion());
autofill_item[0].frontend_id = kAutofillProfileId;
// This should call ShowAutofillPopup.
external_delegate_->OnSuggestionsReturned(
kQueryId, autofill_item, /*autoselect_first_suggestion=*/false, true);
}
TEST_F(AutofillExternalDelegateUnitTest,
ShouldNotShowGooglePayIconOniOSIfExperimentOff) {
// Turn on feature flag.
base::test::ScopedFeatureList scoped_feature_list_;
scoped_feature_list_.InitAndDisableFeature(
kAutofillDownstreamUseGooglePayBrandingOniOS);
IssueOnQuery(kQueryId);
auto element_icons = testing::ElementsAre(
std::string(),
std::string() /* Autofill setting item does not have icon. */);
EXPECT_CALL(autofill_client_,
ShowAutofillPopup(_, _, SuggestionVectorIconsAre(element_icons),
false, PopupType::kPersonalInformation, _));
std::vector<Suggestion> autofill_item;
autofill_item.push_back(Suggestion());
autofill_item[0].frontend_id = kAutofillProfileId;
// This should call ShowAutofillPopup.
external_delegate_->OnSuggestionsReturned(
kQueryId, autofill_item, /*autoselect_first_suggestion=*/false, false);
}
#endif // defined(OS_IOS)
TEST_F(AutofillExternalDelegateUnitTest, TEST_F(AutofillExternalDelegateUnitTest,
ShouldNotShowGooglePayIconIfSuggestionsContainLocalCards) { ShouldNotShowGooglePayIconIfSuggestionsContainLocalCards) {
IssueOnQuery(kQueryId); IssueOnQuery(kQueryId);
......
...@@ -25,9 +25,8 @@ enum PopupItemId { ...@@ -25,9 +25,8 @@ enum PopupItemId {
POPUP_ITEM_ID_USERNAME_ENTRY = -11, POPUP_ITEM_ID_USERNAME_ENTRY = -11,
POPUP_ITEM_ID_CREATE_HINT = -12, POPUP_ITEM_ID_CREATE_HINT = -12,
POPUP_ITEM_ID_ALL_SAVED_PASSWORDS_ENTRY = -13, POPUP_ITEM_ID_ALL_SAVED_PASSWORDS_ENTRY = -13,
POPUP_ITEM_ID_GOOGLE_PAY_BRANDING = -14, POPUP_ITEM_ID_GENERATE_PASSWORD_ENTRY = -14,
POPUP_ITEM_ID_GENERATE_PASSWORD_ENTRY = -15, POPUP_ITEM_ID_SHOW_ACCOUNT_CARDS = -15,
POPUP_ITEM_ID_SHOW_ACCOUNT_CARDS = -16,
}; };
} // namespace autofill } // namespace autofill
......
...@@ -60,12 +60,6 @@ const base::Feature kAutofillDoNotMigrateUnsupportedLocalCards{ ...@@ -60,12 +60,6 @@ const base::Feature kAutofillDoNotMigrateUnsupportedLocalCards{
"AutofillDoNotMigrateUnsupportedLocalCards", "AutofillDoNotMigrateUnsupportedLocalCards",
base::FEATURE_ENABLED_BY_DEFAULT}; base::FEATURE_ENABLED_BY_DEFAULT};
// Controls whether the credit card downstream keyboard accessory shows
// the Google Pay logo animation on iOS.
const base::Feature kAutofillDownstreamUseGooglePayBrandingOniOS{
"AutofillDownstreamUseGooglePayBrandingOniOS",
base::FEATURE_DISABLED_BY_DEFAULT};
// When enabled, enable local card migration flow for user who has signed in but // When enabled, enable local card migration flow for user who has signed in but
// has not turned on sync. // has not turned on sync.
const base::Feature kAutofillEnableLocalCardMigrationForNonSyncUser{ const base::Feature kAutofillEnableLocalCardMigrationForNonSyncUser{
......
...@@ -24,7 +24,6 @@ extern const base::Feature kAutofillCreditCardAblationExperiment; ...@@ -24,7 +24,6 @@ extern const base::Feature kAutofillCreditCardAblationExperiment;
extern const base::Feature kAutofillCreditCardAuthentication; extern const base::Feature kAutofillCreditCardAuthentication;
extern const base::Feature kAutofillCreditCardUploadFeedback; extern const base::Feature kAutofillCreditCardUploadFeedback;
extern const base::Feature kAutofillDoNotMigrateUnsupportedLocalCards; extern const base::Feature kAutofillDoNotMigrateUnsupportedLocalCards;
extern const base::Feature kAutofillDownstreamUseGooglePayBrandingOniOS;
extern const base::Feature kAutofillEnableLocalCardMigrationForNonSyncUser; extern const base::Feature kAutofillEnableLocalCardMigrationForNonSyncUser;
extern const base::Feature kAutofillEnableToolbarStatusChip; extern const base::Feature kAutofillEnableToolbarStatusChip;
extern const base::Feature kAutofillLocalCardMigrationUsesStrikeSystemV2; extern const base::Feature kAutofillLocalCardMigrationUsesStrikeSystemV2;
......
...@@ -503,7 +503,6 @@ autofillManagerFromWebState:(web::WebState*)webState ...@@ -503,7 +503,6 @@ autofillManagerFromWebState:(web::WebState*)webState
popupDelegate: popupDelegate:
(const base::WeakPtr<autofill::AutofillPopupDelegate>&) (const base::WeakPtr<autofill::AutofillPopupDelegate>&)
delegate { delegate {
bool has_gpay_branding = false;
// Convert the suggestions into an NSArray for the keyboard. // Convert the suggestions into an NSArray for the keyboard.
NSMutableArray<FormSuggestion*>* suggestions = [[NSMutableArray alloc] init]; NSMutableArray<FormSuggestion*>* suggestions = [[NSMutableArray alloc] init];
for (auto popup_suggestion : popup_suggestions) { for (auto popup_suggestion : popup_suggestions) {
...@@ -514,8 +513,7 @@ autofillManagerFromWebState:(web::WebState*)webState ...@@ -514,8 +513,7 @@ autofillManagerFromWebState:(web::WebState*)webState
// fortunately almost all the entries we are interested in (profile or // fortunately almost all the entries we are interested in (profile or
// autofill entries) are zero or positive. Negative entries we are // autofill entries) are zero or positive. Negative entries we are
// interested in is autofill::POPUP_ITEM_ID_CLEAR_FORM, used to show the // interested in is autofill::POPUP_ITEM_ID_CLEAR_FORM, used to show the
// "clear form" button and autofill::POPUP_ITEM_ID_GOOGLE_PAY_BRANDING, used // "clear form" button.
// to show the "Google Pay" branding.
NSString* value = nil; NSString* value = nil;
NSString* displayDescription = nil; NSString* displayDescription = nil;
if (popup_suggestion.frontend_id >= 0) { if (popup_suggestion.frontend_id >= 0) {
...@@ -534,11 +532,6 @@ autofillManagerFromWebState:(web::WebState*)webState ...@@ -534,11 +532,6 @@ autofillManagerFromWebState:(web::WebState*)webState
autofill::POPUP_ITEM_ID_CLEAR_FORM) { autofill::POPUP_ITEM_ID_CLEAR_FORM) {
// Show the "clear form" button. // Show the "clear form" button.
value = base::SysUTF16ToNSString(popup_suggestion.value); value = base::SysUTF16ToNSString(popup_suggestion.value);
} else if (popup_suggestion.frontend_id ==
autofill::POPUP_ITEM_ID_GOOGLE_PAY_BRANDING) {
// Show "GPay branding" icon
value = base::SysUTF16ToNSString(popup_suggestion.value);
has_gpay_branding = true;
} else if (popup_suggestion.frontend_id == } else if (popup_suggestion.frontend_id ==
autofill::POPUP_ITEM_ID_SHOW_ACCOUNT_CARDS) { autofill::POPUP_ITEM_ID_SHOW_ACCOUNT_CARDS) {
// Show opt-in for showing cards from account. // Show opt-in for showing cards from account.
...@@ -554,10 +547,9 @@ autofillManagerFromWebState:(web::WebState*)webState ...@@ -554,10 +547,9 @@ autofillManagerFromWebState:(web::WebState*)webState
icon:base::SysUTF8ToNSString(popup_suggestion.icon) icon:base::SysUTF8ToNSString(popup_suggestion.icon)
identifier:popup_suggestion.frontend_id]; identifier:popup_suggestion.frontend_id];
// Put "clear form" entry at the front of the suggestions. If // Put "clear form" entry at the front of the suggestions.
// "GPay branding" icon is present, it remains as the first suggestion.
if (popup_suggestion.frontend_id == autofill::POPUP_ITEM_ID_CLEAR_FORM) { if (popup_suggestion.frontend_id == autofill::POPUP_ITEM_ID_CLEAR_FORM) {
[suggestions insertObject:suggestion atIndex:has_gpay_branding ? 1 : 0]; [suggestions insertObject:suggestion atIndex:0];
} else { } else {
[suggestions addObject:suggestion]; [suggestions addObject:suggestion];
} }
......
...@@ -36,7 +36,6 @@ ...@@ -36,7 +36,6 @@
#endif #endif
using autofill::POPUP_ITEM_ID_CLEAR_FORM; using autofill::POPUP_ITEM_ID_CLEAR_FORM;
using autofill::POPUP_ITEM_ID_GOOGLE_PAY_BRANDING;
using autofill::POPUP_ITEM_ID_SHOW_ACCOUNT_CARDS; using autofill::POPUP_ITEM_ID_SHOW_ACCOUNT_CARDS;
using base::test::ios::WaitUntilCondition; using base::test::ios::WaitUntilCondition;
...@@ -379,8 +378,6 @@ TEST_F(AutofillAgentTests, onSuggestionsReady_ClearFormWithGPay) { ...@@ -379,8 +378,6 @@ TEST_F(AutofillAgentTests, onSuggestionsReady_ClearFormWithGPay) {
// Make the suggestions available to AutofillAgent. // Make the suggestions available to AutofillAgent.
std::vector<autofill::Suggestion> suggestions; std::vector<autofill::Suggestion> suggestions;
suggestions.push_back(
autofill::Suggestion("", "", "", POPUP_ITEM_ID_GOOGLE_PAY_BRANDING));
suggestions.push_back(autofill::Suggestion("", "", "", 123)); suggestions.push_back(autofill::Suggestion("", "", "", 123));
suggestions.push_back(autofill::Suggestion("", "", "", 321)); suggestions.push_back(autofill::Suggestion("", "", "", 321));
suggestions.push_back( suggestions.push_back(
...@@ -410,15 +407,11 @@ TEST_F(AutofillAgentTests, onSuggestionsReady_ClearFormWithGPay) { ...@@ -410,15 +407,11 @@ TEST_F(AutofillAgentTests, onSuggestionsReady_ClearFormWithGPay) {
return completion_handler_called; return completion_handler_called;
}); });
// GPay icon should appear as the first suggestion followed by "Clear Form". EXPECT_EQ(3U, completion_handler_suggestions.count);
// Otherwise, the order of suggestions should not change.
EXPECT_EQ(4U, completion_handler_suggestions.count);
EXPECT_EQ(POPUP_ITEM_ID_GOOGLE_PAY_BRANDING,
completion_handler_suggestions[0].identifier);
EXPECT_EQ(POPUP_ITEM_ID_CLEAR_FORM, EXPECT_EQ(POPUP_ITEM_ID_CLEAR_FORM,
completion_handler_suggestions[1].identifier); completion_handler_suggestions[0].identifier);
EXPECT_EQ(123, completion_handler_suggestions[2].identifier); EXPECT_EQ(123, completion_handler_suggestions[1].identifier);
EXPECT_EQ(321, completion_handler_suggestions[3].identifier); EXPECT_EQ(321, completion_handler_suggestions[2].identifier);
} }
// Test that every frames are processed whatever is the order of pageloading // Test that every frames are processed whatever is the order of pageloading
......
...@@ -17,11 +17,8 @@ extern NSString* const kFormSuggestionLabelAccessibilityIdentifier; ...@@ -17,11 +17,8 @@ extern NSString* const kFormSuggestionLabelAccessibilityIdentifier;
@interface FormSuggestionLabel : UIView @interface FormSuggestionLabel : UIView
// Designated initializer. Initializes with |client| for |suggestion|. // Designated initializer. Initializes with |client| for |suggestion|.
// |userInteractionEnabled| is a boolean that denotes whether user interaction
// is enabled on the suggestion.
- (instancetype)initWithSuggestion:(FormSuggestion*)suggestion - (instancetype)initWithSuggestion:(FormSuggestion*)suggestion
index:(NSUInteger)index index:(NSUInteger)index
userInteractionEnabled:(BOOL)userInteractionEnabled
numSuggestions:(NSUInteger)numSuggestions numSuggestions:(NSUInteger)numSuggestions
client:(id<FormSuggestionClient>)client client:(id<FormSuggestionClient>)client
NS_DESIGNATED_INITIALIZER; NS_DESIGNATED_INITIALIZER;
......
...@@ -68,19 +68,16 @@ UILabel* TextLabel(NSString* text, UIColor* textColor, BOOL bold) { ...@@ -68,19 +68,16 @@ UILabel* TextLabel(NSString* text, UIColor* textColor, BOOL bold) {
// Client of this view. // Client of this view.
__weak id<FormSuggestionClient> client_; __weak id<FormSuggestionClient> client_;
FormSuggestion* suggestion_; FormSuggestion* suggestion_;
BOOL userInteractionEnabled_;
} }
- (id)initWithSuggestion:(FormSuggestion*)suggestion - (id)initWithSuggestion:(FormSuggestion*)suggestion
index:(NSUInteger)index index:(NSUInteger)index
userInteractionEnabled:(BOOL)userInteractionEnabled
numSuggestions:(NSUInteger)numSuggestions numSuggestions:(NSUInteger)numSuggestions
client:(id<FormSuggestionClient>)client { client:(id<FormSuggestionClient>)client {
self = [super initWithFrame:CGRectZero]; self = [super initWithFrame:CGRectZero];
if (self) { if (self) {
suggestion_ = suggestion; suggestion_ = suggestion;
client_ = client; client_ = client;
userInteractionEnabled_ = userInteractionEnabled;
UIStackView* stackView = [[UIStackView alloc] initWithArrangedSubviews:@[]]; UIStackView* stackView = [[UIStackView alloc] initWithArrangedSubviews:@[]];
stackView.axis = UILayoutConstraintAxisHorizontal; stackView.axis = UILayoutConstraintAxisHorizontal;
...@@ -113,9 +110,7 @@ UILabel* TextLabel(NSString* text, UIColor* textColor, BOOL bold) { ...@@ -113,9 +110,7 @@ UILabel* TextLabel(NSString* text, UIColor* textColor, BOOL bold) {
[stackView addArrangedSubview:description]; [stackView addArrangedSubview:description];
} }
if (userInteractionEnabled_) { [self setBackgroundColor:[UIColor colorNamed:kGrey100Color]];
[self setBackgroundColor:[UIColor colorNamed:kGrey100Color]];
}
[self setClipsToBounds:YES]; [self setClipsToBounds:YES];
[self setUserInteractionEnabled:YES]; [self setUserInteractionEnabled:YES];
...@@ -143,22 +138,16 @@ UILabel* TextLabel(NSString* text, UIColor* textColor, BOOL bold) { ...@@ -143,22 +138,16 @@ UILabel* TextLabel(NSString* text, UIColor* textColor, BOOL bold) {
#pragma mark UIResponder #pragma mark UIResponder
- (void)touchesBegan:(NSSet*)touches withEvent:(UIEvent*)event { - (void)touchesBegan:(NSSet*)touches withEvent:(UIEvent*)event {
if (userInteractionEnabled_) { [self setBackgroundColor:[UIColor colorNamed:kGrey300Color]];
[self setBackgroundColor:[UIColor colorNamed:kGrey300Color]];
}
} }
- (void)touchesCancelled:(NSSet*)touches withEvent:(UIEvent*)event { - (void)touchesCancelled:(NSSet*)touches withEvent:(UIEvent*)event {
if (userInteractionEnabled_) { [self setBackgroundColor:[UIColor colorNamed:kGrey100Color]];
[self setBackgroundColor:[UIColor colorNamed:kGrey100Color]];
}
} }
- (void)touchesEnded:(NSSet*)touches withEvent:(UIEvent*)event { - (void)touchesEnded:(NSSet*)touches withEvent:(UIEvent*)event {
if (userInteractionEnabled_) { [self setBackgroundColor:[UIColor colorNamed:kGrey100Color]];
[self setBackgroundColor:[UIColor colorNamed:kGrey100Color]]; [client_ didSelectSuggestion:suggestion_];
[client_ didSelectSuggestion:suggestion_];
}
} }
@end @end
...@@ -140,34 +140,12 @@ const CGFloat kSuggestionHorizontalMargin = 6; ...@@ -140,34 +140,12 @@ const CGFloat kSuggestionHorizontalMargin = 6;
- (void)createAndInsertArrangedSubviews { - (void)createAndInsertArrangedSubviews {
auto setupBlock = ^(FormSuggestion* suggestion, NSUInteger idx, BOOL* stop) { auto setupBlock = ^(FormSuggestion* suggestion, NSUInteger idx, BOOL* stop) {
// Disable user interaction with suggestion if it is Google Pay logo.
BOOL userInteractionEnabled =
suggestion.identifier != autofill::POPUP_ITEM_ID_GOOGLE_PAY_BRANDING;
UIView* label = UIView* label =
[[FormSuggestionLabel alloc] initWithSuggestion:suggestion [[FormSuggestionLabel alloc] initWithSuggestion:suggestion
index:idx index:idx
userInteractionEnabled:userInteractionEnabled
numSuggestions:[self.suggestions count] numSuggestions:[self.suggestions count]
client:self.client]; client:self.client];
[self.stackView addArrangedSubview:label]; [self.stackView addArrangedSubview:label];
// If first suggestion is Google Pay logo animate it below the fold.
if (idx == 0U &&
suggestion.identifier == autofill::POPUP_ITEM_ID_GOOGLE_PAY_BRANDING) {
const CGFloat firstLabelWidth =
[label systemLayoutSizeFittingSize:UILayoutFittingCompressedSize]
.width +
kSuggestionHorizontalMargin;
dispatch_time_t popTime =
dispatch_time(DISPATCH_TIME_NOW, 0.5 * NSEC_PER_SEC);
__weak FormSuggestionView* weakSelf = self;
dispatch_after(popTime, dispatch_get_main_queue(), ^{
[weakSelf setContentOffset:CGPointMake(firstLabelWidth,
weakSelf.contentOffset.y)
animated:YES];
});
}
}; };
[self.suggestions enumerateObjectsUsingBlock:setupBlock]; [self.suggestions enumerateObjectsUsingBlock:setupBlock];
if (self.trailingView) { if (self.trailingView) {
......
...@@ -272,12 +272,6 @@ const flags_ui::FeatureEntry kFeatureEntries[] = { ...@@ -272,12 +272,6 @@ const flags_ui::FeatureEntry kFeatureEntries[] = {
flag_descriptions::kAutofillCreditCardUploadName, flag_descriptions::kAutofillCreditCardUploadName,
flag_descriptions::kAutofillCreditCardUploadDescription, flags_ui::kOsIos, flag_descriptions::kAutofillCreditCardUploadDescription, flags_ui::kOsIos,
FEATURE_VALUE_TYPE(autofill::features::kAutofillUpstream)}, FEATURE_VALUE_TYPE(autofill::features::kAutofillUpstream)},
{"enable-autofill-credit-card-downstream-google-pay-branding",
flag_descriptions::kAutofillDownstreamUseGooglePayBrandingOniOSName,
flag_descriptions::kAutofillDownstreamUseGooglePayBrandingOniOSDescription,
flags_ui::kOsIos,
FEATURE_VALUE_TYPE(
autofill::features::kAutofillDownstreamUseGooglePayBrandingOniOS)},
{"use-sync-sandbox", flag_descriptions::kSyncSandboxName, {"use-sync-sandbox", flag_descriptions::kSyncSandboxName,
flag_descriptions::kSyncSandboxDescription, flags_ui::kOsIos, flag_descriptions::kSyncSandboxDescription, flags_ui::kOsIos,
SINGLE_VALUE_TYPE_AND_VALUE( SINGLE_VALUE_TYPE_AND_VALUE(
......
...@@ -29,12 +29,6 @@ const char kAutofillCreditCardUploadDescription[] = ...@@ -29,12 +29,6 @@ const char kAutofillCreditCardUploadDescription[] =
"Offers uploading Autofilled credit cards to Google Payments after form " "Offers uploading Autofilled credit cards to Google Payments after form "
"submission."; "submission.";
const char kAutofillDownstreamUseGooglePayBrandingOniOSName[] =
"Enable Google Pay branding when offering credit card downstream";
const char kAutofillDownstreamUseGooglePayBrandingOniOSDescription[] =
"When enabled, shows the Google Pay logo animation when showing payments"
"credit card suggestions in downstream keyboard accessory";
const char kAutofillEnableCompanyNameName[] = const char kAutofillEnableCompanyNameName[] =
"Enable Autofill Company Name field"; "Enable Autofill Company Name field";
const char kAutofillEnableCompanyNameDescription[] = const char kAutofillEnableCompanyNameDescription[] =
......
...@@ -21,11 +21,6 @@ extern const char kAutofillCacheQueryResponsesDescription[]; ...@@ -21,11 +21,6 @@ extern const char kAutofillCacheQueryResponsesDescription[];
extern const char kAutofillCreditCardUploadName[]; extern const char kAutofillCreditCardUploadName[];
extern const char kAutofillCreditCardUploadDescription[]; extern const char kAutofillCreditCardUploadDescription[];
// Title and description for the flag to control GPay branding in credit card
// downstream keyboard accessory.
extern const char kAutofillDownstreamUseGooglePayBrandingOniOSName[];
extern const char kAutofillDownstreamUseGooglePayBrandingOniOSDescription[];
// Title and description for the flag to control deprecating company name. // Title and description for the flag to control deprecating company name.
extern const char kAutofillEnableCompanyNameName[]; extern const char kAutofillEnableCompanyNameName[];
extern const char kAutofillEnableCompanyNameDescription[]; extern const char kAutofillEnableCompanyNameDescription[];
......
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