Commit 03fad82c authored by Lakshmi Kumar Dabbiru's avatar Lakshmi Kumar Dabbiru Committed by Commit Bot

Fix Name UI with recent changes

Latest UI - https://screenshot.googleplex.com/qqSuM2bvctM.png

UI + tool tip - https://screenshot.googleplex.com/RPZkrxgBdnN.png

Changes
1) Remove legal message from second screen as it is not needed
2) Add tool tip icon and adjust spacing for name.

UX is still working on final spaces to make it clean post Legal removal
message world. Would like to get this CL before M72 branch date,so dont need
to ask TPMs for merge. Small UI spacing fixes, can request TPMs.

Bug: 848955
Change-Id: Ia8a5cd4fe2c6751c1e169a58ac88123770838234
Reviewed-on: https://chromium-review.googlesource.com/c/1334509
Commit-Queue: Lakshmi Kumar Dabbiru <dlkumar@google.com>
Reviewed-by: default avatarBecky Zhou <huayinz@chromium.org>
Reviewed-by: default avatarTed Choc <tedchoc@chromium.org>
Reviewed-by: default avatarMatthew Jones <mdjones@chromium.org>
Reviewed-by: default avatarFabio Tirelo <ftirelo@chromium.org>
Reviewed-by: default avatarRouslan Solomakhin <rouslan@chromium.org>
Reviewed-by: default avatarChangwan Ryu <changwan@chromium.org>
Reviewed-by: default avatarJared Saul <jsaul@google.com>
Cr-Commit-Position: refs/heads/master@{#610959}
parent 336bb21b
......@@ -282,7 +282,6 @@ void AwAutofillClient::ShowLocalCardMigrationDialog(
}
void AwAutofillClient::ConfirmAccountNameFixFlow(
std::unique_ptr<base::DictionaryValue> legal_message,
base::OnceCallback<void(const base::string16&)> callback) {
NOTIMPLEMENTED();
}
......
......@@ -80,7 +80,6 @@ class AwAutofillClient : public autofill::AutofillClient,
void ShowLocalCardMigrationDialog(
base::OnceClosure show_migration_dialog_closure) override;
void ConfirmAccountNameFixFlow(
std::unique_ptr<base::DictionaryValue> legal_message,
base::OnceCallback<void(const base::string16&)> callback) override;
void ConfirmMigrateLocalCardToCloud(
std::unique_ptr<base::DictionaryValue> legal_message,
......
......@@ -8,31 +8,30 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/pref_autofill_field_horizontal_padding"
style="@style/AlertDialogContent"
android:minHeight="36dp"
android:orientation="vertical"
android:gravity="center_vertical">
<TextView
android:id="@+id/cc_name_label_text"
android:labelFor="@+id/cc_name"
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/pref_autofill_field_top_margin"
android:layout_marginEnd="@dimen/pref_autofill_field_horizontal_padding"
android:textAppearance="@style/BlackCaption"
android:text="@string/autofill_credit_card_editor_name" />
android:layout_marginBottom="14dp"
android:orientation="horizontal">
<org.chromium.chrome.browser.widget.CompatibilityTextInputLayout
android:id="@+id/cc_name"
android:labelFor="@+id/cc_name_edit"
android:layout_width="match_parent"
android:layout_marginTop="6dp"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content">
<!-- TODO(crbug.com/900912): Fix and remove lint ignore -->
<EditText
tools:ignore="Autofill,LabelFor"
android:id="@+id/cc_name_edit"
android:hint="@string/autofill_card_holder_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:imeOptions="flagNoExtractUi"
......@@ -40,12 +39,13 @@
</org.chromium.chrome.browser.widget.CompatibilityTextInputLayout>
<TextView
android:id="@+id/cc_name_legal_message"
android:layout_width="match_parent"
android:layout_marginTop="@dimen/pref_autofill_field_top_margin"
<ImageView
android:id="@+id/cc_name_tooltip_icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="@style/BlackBody"
android:textColorLink="@color/infobar_accent_blue" />
android:padding="12dp"
android:src="@drawable/help_outline"
android:contentDescription="@string/learn_more" />
</LinearLayout>
</LinearLayout>
......@@ -12,12 +12,8 @@ import org.chromium.base.annotations.JNINamespace;
import org.chromium.chrome.browser.ChromeActivity;
import org.chromium.chrome.browser.ResourceId;
import org.chromium.chrome.browser.autofill.AutofillNameFixFlowPrompt.AutofillNameFixFlowPromptDelegate;
import org.chromium.chrome.browser.autofill.AutofillNameFixFlowPrompt.LegalMessageLine;
import org.chromium.ui.base.WindowAndroid;
import java.util.ArrayList;
import java.util.List;
/**
* JNI call glue for AutofillNameFixFlowPrompt C++ and Java objects.
*/
......@@ -29,7 +25,6 @@ final class AutofillNameFixFlowBridge implements AutofillNameFixFlowPromptDelega
private final String mInferredName;
private final String mConfirmButtonLabel;
private final int mIconId;
private final List<LegalMessageLine> mLegalMessageLines = new ArrayList<LegalMessageLine>();
private AutofillNameFixFlowPrompt mNameFixFlowPrompt;
private AutofillNameFixFlowBridge(long nativeCardNameFixFlowViewAndroid, String title,
......@@ -58,29 +53,6 @@ final class AutofillNameFixFlowBridge implements AutofillNameFixFlowPromptDelega
confirmButtonLabel, iconId, windowAndroid);
}
/**
* Adds a line of legal message plain text to the infobar.
*
* @param text The legal message plain text.
*/
@CalledByNative
private void addLegalMessageLine(String text) {
mLegalMessageLines.add(new LegalMessageLine(text));
}
/**
* Marks up the last added line of legal message text with a link.
*
* @param start The inclusive offset of the start of the link in the text.
* @param end The exclusive offset of the end of the link in the text.
* @param url The URL to open when the link is clicked.
*/
@CalledByNative
private void addLinkToLastLegalMessageLine(int start, int end, String url) {
mLegalMessageLines.get(mLegalMessageLines.size() - 1)
.links.add(new LegalMessageLine.Link(start, end, url));
}
@Override
public void onPromptDismissed() {
nativePromptDismissed(mNativeCardNameFixFlowViewAndroid);
......@@ -91,18 +63,13 @@ final class AutofillNameFixFlowBridge implements AutofillNameFixFlowPromptDelega
nativeOnUserAccept(mNativeCardNameFixFlowViewAndroid, name);
}
@Override
public void onLegalMessageLinkClicked(String url) {
nativeOnLegalMessageLinkClicked(mNativeCardNameFixFlowViewAndroid, url);
}
/**
* Shows a prompt for name fix flow.
*/
@CalledByNative
private void show(WindowAndroid windowAndroid) {
mNameFixFlowPrompt = new AutofillNameFixFlowPrompt(mActivity, this, mTitle, mInferredName,
mLegalMessageLines, mConfirmButtonLabel, ResourceId.mapToDrawableId(mIconId));
mConfirmButtonLabel, ResourceId.mapToDrawableId(mIconId));
if (mNameFixFlowPrompt != null) {
mNameFixFlowPrompt.show((ChromeActivity) (windowAndroid.getActivity().get()));
......@@ -119,6 +86,4 @@ final class AutofillNameFixFlowBridge implements AutofillNameFixFlowPromptDelega
private native void nativePromptDismissed(long nativeCardNameFixFlowViewAndroid);
private native void nativeOnUserAccept(long nativeCardNameFixFlowViewAndroid, String name);
private native void nativeOnLegalMessageLinkClicked(
long nativeCardNameFixFlowViewAndroid, String url);
}
......@@ -5,16 +5,15 @@
package org.chromium.chrome.browser.autofill;
import android.content.Context;
import android.text.SpannableString;
import android.text.SpannableStringBuilder;
import android.text.Spanned;
import android.text.method.LinkMovementMethod;
import android.text.style.ClickableSpan;
import android.support.v4.view.MarginLayoutParamsCompat;
import android.support.v4.view.ViewCompat;
import android.view.LayoutInflater;
import android.view.View;
import android.view.inputmethod.EditorInfo;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.PopupWindow;
import android.widget.TextView.BufferType;
import org.chromium.chrome.R;
......@@ -27,69 +26,10 @@ import org.chromium.chrome.browser.modaldialog.ModalDialogViewBinder;
import org.chromium.chrome.browser.modelutil.PropertyModel;
import org.chromium.chrome.browser.modelutil.PropertyModelChangeProcessor;
import java.util.ArrayList;
import java.util.List;
/**
* Prompt that asks users to confirm user's name before saving card to Google.
*/
public class AutofillNameFixFlowPrompt implements ModalDialogView.Controller {
/**
* Legal message line with links to show in the fix flow prompt.
*/
public static class LegalMessageLine {
/**
* A link in the legal message line.
*/
public static class Link {
/**
* The starting inclusive index of the link position in the text.
*/
public int start;
/**
* The ending exclusive index of the link position in the text.
*/
public int end;
/**
* The URL of the link.
*/
public String url;
/**
* Creates a new instance of the link.
*
* @param start The starting inclusive index of the link position in the text.
* @param end The ending exclusive index of the link position in the text.
* @param url The URL of the link.
*/
public Link(int start, int end, String url) {
this.start = start;
this.end = end;
this.url = url;
}
}
/**
* The plain text legal message line.
*/
public String text;
/**
* A collection of links in the legal message line.
*/
public final List<Link> links = new ArrayList<Link>();
/**
* Creates a new instance of the legal message line.
*
* @param legalText The plain text legal message.
*/
public LegalMessageLine(String legalText) {
text = legalText;
}
}
/**
* An interface to handle the interaction with
......@@ -107,19 +47,15 @@ public class AutofillNameFixFlowPrompt implements ModalDialogView.Controller {
* @param name Card holder name.
*/
void onUserAccept(String name);
/**
* Called when user clicked on legal message.
*
* @param url Legal message URL that user clicked.
*/
void onLegalMessageLinkClicked(String url);
}
private final AutofillNameFixFlowPromptDelegate mDelegate;
private final ModalDialogView mDialog;
private final View mDialogView;
private final EditText mUserNameInput;
private final ImageView mNameFixFlowTooltipIcon;
private PopupWindow mNameFixFlowTooltipPopup;
private ModalDialogManager mModalDialogManager;
private Context mContext;
......@@ -128,38 +64,23 @@ public class AutofillNameFixFlowPrompt implements ModalDialogView.Controller {
* Fix flow prompt to confirm user name before saving the card to Google.
*/
public AutofillNameFixFlowPrompt(Context context, AutofillNameFixFlowPromptDelegate delegate,
String title, String inferredName, List<LegalMessageLine> legalMessageLines,
String confirmButtonLabel, int drawableId) {
String title, String inferredName, String confirmButtonLabel, int drawableId) {
mDelegate = delegate;
LayoutInflater inflater = LayoutInflater.from(context);
View customView = inflater.inflate(R.layout.autofill_name_fixflow, null);
mDialogView = inflater.inflate(R.layout.autofill_name_fixflow, null);
mUserNameInput = (EditText) customView.findViewById(R.id.cc_name_edit);
mUserNameInput = (EditText) mDialogView.findViewById(R.id.cc_name_edit);
mUserNameInput.setText(inferredName, BufferType.EDITABLE);
SpannableStringBuilder legalMessageText = new SpannableStringBuilder();
for (LegalMessageLine line : legalMessageLines) {
SpannableString text = new SpannableString(line.text);
for (final LegalMessageLine.Link link : line.links) {
text.setSpan(new ClickableSpan() {
@Override
public void onClick(View view) {
delegate.onLegalMessageLinkClicked(link.url);
}
}, link.start, link.end, Spanned.SPAN_INCLUSIVE_EXCLUSIVE);
}
legalMessageText.append(legalMessageText);
}
TextView legalMessageView = (TextView) customView.findViewById(R.id.cc_name_legal_message);
legalMessageView.setText(legalMessageText);
legalMessageView.setMovementMethod(LinkMovementMethod.getInstance());
mUserNameInput.setSelection(inferredName.length());
mNameFixFlowTooltipIcon = (ImageView) mDialogView.findViewById(R.id.cc_name_tooltip_icon);
mNameFixFlowTooltipIcon.setOnClickListener((view) -> onTooltipIconClicked());
PropertyModel model =
new PropertyModel.Builder(ModalDialogProperties.ALL_KEYS)
.with(ModalDialogProperties.CONTROLLER, this)
.with(ModalDialogProperties.TITLE, title)
.with(ModalDialogProperties.TITLE_ICON, context, drawableId)
.with(ModalDialogProperties.CUSTOM_VIEW, customView)
.with(ModalDialogProperties.CUSTOM_VIEW, mDialogView)
.with(ModalDialogProperties.POSITIVE_BUTTON_TEXT, confirmButtonLabel)
.with(ModalDialogProperties.NEGATIVE_BUTTON_TEXT, context.getResources(),
R.string.cancel)
......@@ -187,7 +108,6 @@ public class AutofillNameFixFlowPrompt implements ModalDialogView.Controller {
mContext = activity;
mModalDialogManager = activity.getModalDialogManager();
mModalDialogManager.showDialog(mDialog, ModalDialogManager.ModalDialogType.APP);
}
......@@ -195,6 +115,25 @@ public class AutofillNameFixFlowPrompt implements ModalDialogView.Controller {
mModalDialogManager.dismissDialog(mDialog);
}
/**
* Handle tooltip icon clicked. If tooltip is already opened, don't show another. Otherwise
* create a new one.
*/
private void onTooltipIconClicked() {
if (mNameFixFlowTooltipPopup != null) return;
mNameFixFlowTooltipPopup = new PopupWindow(mContext);
int textWidth = mDialogView.getWidth() - ViewCompat.getPaddingEnd(mNameFixFlowTooltipIcon)
- MarginLayoutParamsCompat.getMarginEnd(
(LinearLayout.LayoutParams) mNameFixFlowTooltipIcon.getLayoutParams());
Runnable dismissAction = () -> {
mNameFixFlowTooltipPopup = null;
};
AutofillUiUtils.showTooltip(mContext, mNameFixFlowTooltipPopup,
R.string.autofill_save_card_prompt_cardholder_name_tooltip, textWidth,
mUserNameInput, dismissAction);
}
@Override
public void onClick(@ModalDialogView.ButtonType int buttonType) {
if (buttonType == ModalDialogView.ButtonType.POSITIVE) {
......
// 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.
package org.chromium.chrome.browser.autofill;
import android.content.Context;
import android.content.res.Resources;
import android.os.Handler;
import android.support.v4.view.ViewCompat;
import android.support.v4.widget.TextViewCompat;
import android.view.View;
import android.view.ViewGroup;
import android.widget.PopupWindow;
import android.widget.TextView;
import org.chromium.base.ApiCompatibilityUtils;
import org.chromium.chrome.R;
/**
* Helper methods that can be used across multiple Autofill UIs.
*/
public class AutofillUiUtils {
// 200ms is chosen small enough not to be detectable to human eye, but big
// enough for to avoid any race conditions on modern machines.
private static final int TOOLTIP_DEFERRED_PERIOD_MS = 200;
/**
* Show Tooltip UI.
*
* @param context Context required to get resources.
* @param popup {@PopupWindow} that shows tooltip UI.
* @param text Text to be shown in tool tip UI.
* @param width Width of the textview.
* @param anchorView Anchor view under which tooltip popup has to be shown
* @param dismissAction Tooltip dismissive action.
*/
public static void showTooltip(Context context, PopupWindow popup, int text, int width,
View anchorView, final Runnable dismissAction) {
TextView textView = new TextView(context);
textView.setText(text);
textView.setWidth(width);
TextViewCompat.setTextAppearance(textView, R.style.WhiteBody);
Resources resources = context.getResources();
int hPadding = resources.getDimensionPixelSize(
R.dimen.autofill_card_unmask_tooltip_horizontal_padding);
int vPadding = resources.getDimensionPixelSize(
R.dimen.autofill_card_unmask_tooltip_vertical_padding);
textView.setPadding(hPadding, vPadding, hPadding, vPadding);
popup.setContentView(textView);
popup.setHeight(ViewGroup.LayoutParams.WRAP_CONTENT);
popup.setWidth(ViewGroup.LayoutParams.WRAP_CONTENT);
popup.setOutsideTouchable(true);
popup.setBackgroundDrawable(ApiCompatibilityUtils.getDrawable(
resources, R.drawable.store_locally_tooltip_background));
popup.setOnDismissListener(() -> {
Handler h = new Handler();
h.postDelayed(dismissAction, TOOLTIP_DEFERRED_PERIOD_MS);
});
popup.showAsDropDown(anchorView, ViewCompat.getPaddingStart(anchorView), 0);
textView.announceForAccessibility(textView.getText());
}
}
......@@ -459,6 +459,9 @@ CHAR-LIMIT guidelines:
<message name="IDS_AUTOFILL_CREDIT_CARD_EDITOR_NAME" desc="Label for text input field containing the name on a credit card. [CHAR-LIMIT=32]">
Name on card
</message>
<message name="IDS_AUTOFILL_CARD_HOLDER_NAME" desc="Label for text input field containing the name on a credit card. [CHAR-LIMIT=32]">
Cardholder name
</message>
<message name="IDS_AUTOFILL_CREDIT_CARD_EDITOR_NUMBER" desc="Label for text input field containing a card number. This can be a credit, debit, or prepaid card. [CHAR-LIMIT=32]">
Card number
</message>
......
......@@ -2,10 +2,10 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import("//chrome/android/feed/feed_java_sources.gni")
import("//components/feed/features.gni")
import("//components/offline_pages/buildflags/features.gni")
import("//device/vr/buildflags/buildflags.gni")
import("//chrome/android/feed/feed_java_sources.gni")
chrome_java_sources = [
"java/src/com/google/android/apps/chrome/appwidget/bookmarks/BookmarkThumbnailWidgetProvider.java",
......@@ -93,6 +93,7 @@ chrome_java_sources = [
"java/src/org/chromium/chrome/browser/autofill/AutofillNameFixFlowBridge.java",
"java/src/org/chromium/chrome/browser/autofill/AutofillNameFixFlowPrompt.java",
"java/src/org/chromium/chrome/browser/autofill/AutofillPopupBridge.java",
"java/src/org/chromium/chrome/browser/autofill/AutofillUiUtils.java",
"java/src/org/chromium/chrome/browser/autofill/CardUnmaskBridge.java",
"java/src/org/chromium/chrome/browser/autofill/CardUnmaskPrompt.java",
"java/src/org/chromium/chrome/browser/autofill/CreditCardScannerBridge.java",
......
......@@ -45,17 +45,6 @@ void CardNameFixFlowViewAndroid::Show() {
confirm, ResourceMapper::MapFromChromiumId(delegate_->GetIconId()),
view_android->GetWindowAndroid()->GetJavaObject()));
for (const auto& line : delegate_->GetLegalMessageLines()) {
Java_AutofillNameFixFlowBridge_addLegalMessageLine(
env, java_object_,
base::android::ConvertUTF16ToJavaString(env, line.text()));
for (const auto& link : line.links()) {
Java_AutofillNameFixFlowBridge_addLinkToLastLegalMessageLine(
env, java_object_, link.range.start(), link.range.end(),
base::android::ConvertUTF8ToJavaString(env, link.url.spec()));
}
}
Java_AutofillNameFixFlowBridge_show(
env, java_object_, view_android->GetWindowAndroid()->GetJavaObject());
}
......@@ -74,14 +63,4 @@ void CardNameFixFlowViewAndroid::PromptDismissed(
delete this;
}
void CardNameFixFlowViewAndroid::OnLegalMessageLinkClicked(
JNIEnv* env,
const JavaParamRef<jobject>& obj,
const JavaParamRef<jstring>& url) {
web_contents_->OpenURL(content::OpenURLParams(
GURL(base::android::ConvertJavaStringToUTF16(env, url)),
content::Referrer(), WindowOpenDisposition::NEW_FOREGROUND_TAB,
ui::PAGE_TRANSITION_AUTO_TOPLEVEL, /*is_renderer_initiated=*/false));
}
} // namespace autofill
......@@ -34,11 +34,6 @@ class CardNameFixFlowViewAndroid {
void PromptDismissed(JNIEnv* env,
const base::android::JavaParamRef<jobject>& obj);
void OnLegalMessageLinkClicked(
JNIEnv* env,
const base::android::JavaParamRef<jobject>& obj,
const base::android::JavaParamRef<jstring>& url);
void Show();
private:
......
......@@ -318,12 +318,11 @@ void ChromeAutofillClient::ConfirmSaveCreditCardLocally(
#if defined(OS_ANDROID)
void ChromeAutofillClient::ConfirmAccountNameFixFlow(
std::unique_ptr<base::DictionaryValue> legal_message,
base::OnceCallback<void(const base::string16&)> callback) {
std::unique_ptr<CardNameFixFlowViewDelegateMobile>
card_name_fix_flow_view_delegate_mobile =
std::make_unique<CardNameFixFlowViewDelegateMobile>(
GetAccountHolderName(), std::move(legal_message),
GetAccountHolderName(),
/*upload_save_card_callback=*/std::move(callback));
card_name_fix_flow_view_android_ =
......
......@@ -91,7 +91,6 @@ class ChromeAutofillClient
UserAcceptedUploadCallback callback) override;
#if defined(OS_ANDROID)
void ConfirmAccountNameFixFlow(
std::unique_ptr<base::DictionaryValue> legal_message,
base::OnceCallback<void(const base::string16&)> callback) override;
#endif // defined(OS_ANDROID)
......
......@@ -211,9 +211,8 @@ class AutofillClient : public RiskDataLoader {
#if defined(OS_ANDROID)
// Run |callback| if the card should be uploaded to payments with updated
// name from the user. Displays the contents of |legal_message| to the user.
// name from the user.
virtual void ConfirmAccountNameFixFlow(
std::unique_ptr<base::DictionaryValue> legal_message,
base::OnceCallback<void(const base::string16&)> callback) = 0;
#endif // defined(OS_ANDROID)
......
......@@ -56,7 +56,8 @@ AutofillSaveCardInfoBarDelegateMobile::AutofillSaveCardInfoBarDelegateMobile(
DCHECK(upload_save_card_callback_.is_null());
DCHECK(!local_save_card_callback_.is_null());
}
if (legal_message && !should_request_name_from_user) {
if (legal_message) {
if (!LegalMessageLine::Parse(*legal_message, &legal_messages_,
/*escape_apostrophes=*/true)) {
AutofillMetrics::LogCreditCardInfoBarMetric(
......@@ -96,8 +97,8 @@ void AutofillSaveCardInfoBarDelegateMobile::OnLegalMessageLinkClicked(
bool AutofillSaveCardInfoBarDelegateMobile::LegalMessagesParsedSuccessfully() {
// If we are uploading to the server, verify that legal lines have been parsed
// into |legal_messages_| unless |should_request_name_from_user_| is enabled.
return !upload_ || !legal_messages_.empty() || should_request_name_from_user_;
// into |legal_messages_|.
return !upload_ || !legal_messages_.empty();
}
bool AutofillSaveCardInfoBarDelegateMobile::IsGooglePayBrandingEnabled() const {
......
......@@ -446,20 +446,8 @@ void CreditCardSaveManager::OfferCardUploadSave() {
if (!is_mobile_build || show_save_prompt_.value()) {
user_did_accept_upload_prompt_ = false;
// legal_message_ ownership is always handled out to chrome autofill client
// and eventually to UI classes. In Android, cards name fix flows take two
// steps and legal messsage is shown only in second step, hence nullptr is
// sent now.
std::unique_ptr<base::DictionaryValue> legal_message_tmp;
#if defined(OS_ANDROID)
legal_message_tmp =
should_request_name_from_user_ ? nullptr : std::move(legal_message_);
#else
legal_message_tmp = std::move(legal_message_);
#endif // #if defined(OS_ANDROID)
client_->ConfirmSaveCreditCardToCloud(
upload_request_.card, std::move(legal_message_tmp),
upload_request_.card, std::move(legal_message_),
should_request_name_from_user_,
should_request_expiration_date_from_user_, show_save_prompt_.value(),
base::BindOnce(&CreditCardSaveManager::OnUserDidAcceptUpload,
......@@ -761,7 +749,6 @@ void CreditCardSaveManager::OnUserDidAcceptUpload(
#if defined(OS_ANDROID)
if (should_request_name_from_user_) {
client_->ConfirmAccountNameFixFlow(
std::move(legal_message_),
base::BindOnce(
&CreditCardSaveManager::OnUserDidAcceptAccountNameFixFlow,
weak_ptr_factory_.GetWeakPtr()));
......
......@@ -126,7 +126,6 @@ void TestAutofillClient::ConfirmSaveCreditCardLocally(
#if defined(OS_ANDROID)
void TestAutofillClient::ConfirmAccountNameFixFlow(
std::unique_ptr<base::DictionaryValue> legal_message,
base::OnceCallback<void(const base::string16&)> callback) {
credit_card_name_fix_flow_bubble_was_shown_ = true;
std::move(callback).Run(base::string16(base::ASCIIToUTF16("Gaia Name")));
......
......@@ -65,7 +65,6 @@ class TestAutofillClient : public AutofillClient {
base::OnceClosure callback) override;
#if defined(OS_ANDROID)
void ConfirmAccountNameFixFlow(
std::unique_ptr<base::DictionaryValue> legal_message,
base::OnceCallback<void(const base::string16&)> callback) override;
#endif // defined(OS_ANDROID)
......
......@@ -17,16 +17,10 @@ namespace autofill {
CardNameFixFlowViewDelegateMobile::CardNameFixFlowViewDelegateMobile(
const base::string16& inferred_cardholder_name,
std::unique_ptr<base::DictionaryValue> legal_message,
base::OnceCallback<void(const base::string16&)> upload_save_card_callback)
: inferred_cardholder_name_(inferred_cardholder_name),
upload_save_card_callback_(std::move(upload_save_card_callback)) {
DCHECK(!upload_save_card_callback_.is_null());
if (legal_message &&
!LegalMessageLine::Parse(*legal_message, &legal_messages_,
/*escape_apostrophes=*/true)) {
return;
}
}
CardNameFixFlowViewDelegateMobile::~CardNameFixFlowViewDelegateMobile() {}
......
......@@ -10,11 +10,6 @@
#include "base/callback.h"
#include "base/macros.h"
#include "base/strings/string16.h"
#include "components/autofill/core/browser/legal_message_line.h"
namespace base {
class DictionaryValue;
}
namespace autofill {
......@@ -24,16 +19,11 @@ class CardNameFixFlowViewDelegateMobile {
public:
CardNameFixFlowViewDelegateMobile(
const base::string16& inferred_cardholder_name,
std::unique_ptr<base::DictionaryValue> legal_message,
base::OnceCallback<void(const base::string16&)>
upload_save_card_callback);
~CardNameFixFlowViewDelegateMobile();
const LegalMessageLines& GetLegalMessageLines() const {
return legal_messages_;
}
int GetIconId() const;
base::string16 GetTitleText() const;
base::string16 GetInferredCardHolderName() const;
......@@ -48,9 +38,6 @@ class CardNameFixFlowViewDelegateMobile {
// fix flow.
base::OnceCallback<void(const base::string16&)> upload_save_card_callback_;
// The legal messages to show in the fix flow.
LegalMessageLines legal_messages_;
DISALLOW_COPY_AND_ASSIGN(CardNameFixFlowViewDelegateMobile);
};
......
......@@ -246,7 +246,7 @@
<message name="IDS_AUTOFILL_SAVE_CARD_PROMPT_CARDHOLDER_NAME" desc="The label text for the cardholder name textfield.">
Cardholder name
</message>
<message name="IDS_AUTOFILL_SAVE_CARD_PROMPT_CARDHOLDER_NAME_TOOLTIP" desc="The tooltip text for the cardholder name textfield.">
<message name="IDS_AUTOFILL_SAVE_CARD_PROMPT_CARDHOLDER_NAME_TOOLTIP" desc="The tooltip text for the cardholder name textfield." formatter_data="android_java">
This name is from your Google Account.
</message>
<message name="IDS_AUTOFILL_SAVE_CARD_CARDHOLDER_NAME_FIX_FLOW_HEADER" desc="Header for the cardholder name fix flow.">
......
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