From dfd440a42e37465b88b0fd33aa0e01c6d702923e Mon Sep 17 00:00:00 2001
From: Timofey Chudakov <tchudakov@google.com>
Date: Mon, 24 Apr 2023 15:55:06 +0000
Subject: [PATCH] [Leipzig][Android] Change strings and padding after UI
 review.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Apply following UI changes:
* Add a comma after "Google Account".
* Remove parentheses from the account email address.
* Increase padding for the prompt source notice.

Change-Id: I269b8fdd98382cea4836b628eda8d3d773b574ce
Bug: 1421056
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4466208
Commit-Queue: Timofey Chudakov <tchudakov@google.com>
Reviewed-by: Matthias Körber <koerber@google.com>
Cr-Commit-Position: refs/heads/main@{#1134626}
---
 chrome/android/chrome_java_resources.gni         |  1 -
 ...fill_address_profile_prompt_source_notice.xml | 16 ----------------
 .../autofill_migrate_address_profile_prompt.xml  |  7 +++++--
 .../autofill_save_address_profile_prompt.xml     |  7 +++++--
 .../autofill_update_address_profile_prompt.xml   |  7 +++++--
 chrome/android/java/res/values/dimens.xml        |  2 +-
 .../res/layout/editable_option_editor_footer.xml |  1 +
 components/autofill_strings.grdp                 | 12 ++++++------
 ...READY_SAVED_IN_ACCOUNT_SOURCE_NOTICE.png.sha1 |  2 +-
 ...LL_BE_SAVED_IN_ACCOUNT_SOURCE_NOTICE.png.sha1 |  2 +-
 ..._EXTERNAL_ACCOUNT_PROFILE_SUGGESTION.png.sha1 |  2 +-
 ...OCAL_PROFILE_MIGRATION_PROMPT_NOTICE.png.sha1 |  2 +-
 ...CCOUNT_MESSAGE_ADDRESS_SOURCE_NOTICE.png.sha1 |  2 +-
 ...ABLE_PROFILE_MIGRATION_PROMPT_NOTICE.png.sha1 |  2 +-
 14 files changed, 29 insertions(+), 36 deletions(-)
 delete mode 100644 chrome/android/java/res/layout/autofill_address_profile_prompt_source_notice.xml

diff --git a/chrome/android/chrome_java_resources.gni b/chrome/android/chrome_java_resources.gni
index 512c557afad4e..fbae8af7b7140 100644
--- a/chrome/android/chrome_java_resources.gni
+++ b/chrome/android/chrome_java_resources.gni
@@ -457,7 +457,6 @@ chrome_java_resources = [
   "java/res/layout/account_divider_preference.xml",
   "java/res/layout/account_management_account_row.xml",
   "java/res/layout/auto_sign_in_first_run_dialog.xml",
-  "java/res/layout/autofill_address_profile_prompt_source_notice.xml",
   "java/res/layout/autofill_billing_address_dropdown.xml",
   "java/res/layout/autofill_card_name_and_number.xml",
   "java/res/layout/autofill_card_unmask_prompt.xml",
diff --git a/chrome/android/java/res/layout/autofill_address_profile_prompt_source_notice.xml b/chrome/android/java/res/layout/autofill_address_profile_prompt_source_notice.xml
deleted file mode 100644
index ab57ae2691cd2..0000000000000
--- a/chrome/android/java/res/layout/autofill_address_profile_prompt_source_notice.xml
+++ /dev/null
@@ -1,16 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-Copyright 2023 The Chromium Authors
-Use of this source code is governed by a BSD-style license that can be
-found in the LICENSE file.
--->
-
-<TextView
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:tools="http://schemas.android.com/tools"
-    android:id="@+id/autofill_address_profile_prompt_source_notice"
-    android:layout_width="match_parent"
-    android:layout_height="wrap_content"
-    android:paddingStart="@dimen/dialog_padding_sides"
-    android:textAppearance="@style/TextAppearance.TextMedium.Secondary"
-    tools:text="@string/autofill_save_in_account_prompt_address_source_notice" />
diff --git a/chrome/android/java/res/layout/autofill_migrate_address_profile_prompt.xml b/chrome/android/java/res/layout/autofill_migrate_address_profile_prompt.xml
index b6830cf21c3af..8c07315c5c588 100644
--- a/chrome/android/java/res/layout/autofill_migrate_address_profile_prompt.xml
+++ b/chrome/android/java/res/layout/autofill_migrate_address_profile_prompt.xml
@@ -18,13 +18,16 @@ found in the LICENSE file.
       android:focusable="true"
       android:focusableInTouchMode="true">
 
-    <include
+    <TextView
+        android:id="@+id/autofill_address_profile_prompt_source_notice"
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
         android:layout_marginEnd="@dimen/address_prompt_end_margin"
         android:layout_marginTop="8dp"
         android:layout_marginBottom="8dp"
-        layout="@layout/autofill_address_profile_prompt_source_notice" />
+        android:layout_marginStart="@dimen/dialog_padding_sides"
+        android:textAppearance="@style/TextAppearance.TextMedium.Secondary"
+        tools:text="@string/autofill_save_in_account_prompt_address_source_notice" />
 
     <org.chromium.ui.widget.ChromeImageButton
         android:id="@+id/edit_button"
diff --git a/chrome/android/java/res/layout/autofill_save_address_profile_prompt.xml b/chrome/android/java/res/layout/autofill_save_address_profile_prompt.xml
index 7232249295008..c9f59bee8fb10 100644
--- a/chrome/android/java/res/layout/autofill_save_address_profile_prompt.xml
+++ b/chrome/android/java/res/layout/autofill_save_address_profile_prompt.xml
@@ -92,12 +92,15 @@ found in the LICENSE file.
           android:textAppearance="@style/TextAppearance.TextLarge.Secondary" />
     </com.google.android.material.textfield.TextInputLayout>
 
-    <include
+    <TextView
+        android:id="@+id/autofill_address_profile_prompt_source_notice"
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
         android:layout_marginEnd="@dimen/address_prompt_end_margin"
         android:layout_marginTop="20dp"
         android:layout_below="@+id/nickname_input_layout"
-        layout="@layout/autofill_address_profile_prompt_source_notice" />
+        android:layout_marginStart="@dimen/dialog_padding_sides"
+        android:textAppearance="@style/TextAppearance.TextMedium.Secondary"
+        tools:text="@string/autofill_save_in_account_prompt_address_source_notice" />
   </RelativeLayout>
 </ScrollView>
diff --git a/chrome/android/java/res/layout/autofill_update_address_profile_prompt.xml b/chrome/android/java/res/layout/autofill_update_address_profile_prompt.xml
index 19263a744e2bb..b17df387f17fd 100644
--- a/chrome/android/java/res/layout/autofill_update_address_profile_prompt.xml
+++ b/chrome/android/java/res/layout/autofill_update_address_profile_prompt.xml
@@ -107,10 +107,13 @@ found in the LICENSE file.
     </LinearLayout>
   </org.chromium.components.browser_ui.widget.FadingEdgeScrollView>
 
-  <include
+  <TextView
+      android:id="@+id/autofill_address_profile_prompt_source_notice"
       android:layout_width="match_parent"
       android:layout_height="wrap_content"
       android:layout_marginEnd="@dimen/address_prompt_end_margin"
       android:layout_marginTop="12dp"
-      layout="@layout/autofill_address_profile_prompt_source_notice" />
+      android:layout_marginStart="@dimen/dialog_padding_sides"
+      android:textAppearance="@style/TextAppearance.TextMedium.Secondary"
+      tools:text="@string/autofill_save_in_account_prompt_address_source_notice" />
 </LinearLayout>
diff --git a/chrome/android/java/res/values/dimens.xml b/chrome/android/java/res/values/dimens.xml
index ef1f8636ec2b7..44a534ff2d8b6 100644
--- a/chrome/android/java/res/values/dimens.xml
+++ b/chrome/android/java/res/values/dimens.xml
@@ -72,7 +72,7 @@ found in the LICENSE file.
     <dimen name="sheet_tab_toolbar_height">70dp</dimen>
 
     <!-- Autofill address prompt dimensions -->
-    <dimen name="address_prompt_end_margin">8dp</dimen>
+    <dimen name="address_prompt_end_margin">16dp</dimen>
     <dimen name="address_prompt_edit_button_size">48dp</dimen>
     <dimen name="address_prompt_edit_button_padding">12dp</dimen>
 
diff --git a/chrome/browser/autofill/android/java/res/layout/editable_option_editor_footer.xml b/chrome/browser/autofill/android/java/res/layout/editable_option_editor_footer.xml
index 290a55327f50b..a87b8d1c1df93 100644
--- a/chrome/browser/autofill/android/java/res/layout/editable_option_editor_footer.xml
+++ b/chrome/browser/autofill/android/java/res/layout/editable_option_editor_footer.xml
@@ -28,6 +28,7 @@ found in the LICENSE file.
         android:layout_marginBottom="16dp"
         android:layout_marginStart="@dimen/pref_autofill_field_horizontal_padding"
         android:layout_marginEnd="@dimen/pref_autofill_field_horizontal_padding"
+        android:breakStrategy="high_quality"
         android:textAppearance="@style/TextAppearance.TextSmall.Secondary" />
 
     <include layout="@layout/autofill_editor_base_buttons" />
diff --git a/components/autofill_strings.grdp b/components/autofill_strings.grdp
index 6ea5ac1899b0f..208265f99a7f3 100644
--- a/components/autofill_strings.grdp
+++ b/components/autofill_strings.grdp
@@ -167,7 +167,7 @@
   </if>
 
   <message name="IDS_AUTOFILL_IPH_EXTERNAL_ACCOUNT_PROFILE_SUGGESTION" desc="IPH bubble for a suggestion item with an account profile that was created somewhere outside Chrome (e.g. Google Pay)." formatter_data="android_java">
-    You can now use addresses from your Google Account.
+    You can now use addresses from your Google Account
   </message>
 
   <!-- Autofill suggestion label separator -->
@@ -225,16 +225,16 @@
     This address will be deleted from this device
   </message>
   <message name="IDS_AUTOFILL_SAVE_IN_ACCOUNT_MESSAGE_ADDRESS_SOURCE_NOTICE" desc="The notice/warning message for the user that this address is going to be stored in their account.">
-    In your Google Account <ph name="ACCOUNT">$1<ex>alexpark@gmail.com</ex></ph>
+    In your Google Account, <ph name="ACCOUNT">$1<ex>alexpark@gmail.com</ex></ph>
   </message>
   <message name="IDS_AUTOFILL_SAVE_IN_ACCOUNT_MESSAGE_ADDRESS_MIGRATION_SOURCE_NOTICE" desc="The notice/warning message for the user that this address is going to be migrated in their account.">
     You will be able to use it across Google products
   </message>
   <message name="IDS_AUTOFILL_ADDRESS_ALREADY_SAVED_IN_ACCOUNT_SOURCE_NOTICE" desc="The footer message used to notify user that their address is stored in their account." formatter_data="android_java">
-    You can use saved addresses across Google products. This address is saved in your Google Account (<ph name="ACCOUNT">$1<ex>alexpark@gmail.com</ex></ph>).
+    You can use saved addresses across Google products. This address is saved in your Google Account, <ph name="ACCOUNT">$1<ex>alexpark@gmail.com</ex></ph>.
   </message>
   <message name="IDS_AUTOFILL_ADDRESS_WILL_BE_SAVED_IN_ACCOUNT_SOURCE_NOTICE" desc="The footer message used to notify user that their address will be saved in their account." formatter_data="android_java">
-    You can use saved addresses across Google products. This address will be saved in your Google Account (<ph name="ACCOUNT">$1<ex>alexpark@gmail.com</ex></ph>).
+    You can use saved addresses across Google products. This address will be saved in your Google Account, <ph name="ACCOUNT">$1<ex>alexpark@gmail.com</ex></ph>.
   </message>
   <message name="IDS_AUTOFILL_EDIT_ADDRESS_REQUIRED_FIELD_FORM_ERROR" desc="The form error message shown to the user in case of a single required field missing.">
     A required field is empty. Fill it before saving.
@@ -387,10 +387,10 @@
     You can use saved addresses across Google products. This address is saved in your Google Account, <ph name="ACCOUNT">$1<ex>alexpark@gmail.com</ex></ph>.
   </message>
   <message name="IDS_AUTOFILL_SYNCABLE_PROFILE_MIGRATION_PROMPT_NOTICE" desc="The syncable profile prompt body text.">
-    This address is currently saved only to Chrome. To use it across Google products, save it in your Google Account, <ph name="ACCOUNT">$1<ex>alexpark@gmail.com</ex></ph>.
+    This address is currently saved to Chrome. To use it across Google products, save it in your Google Account, <ph name="ACCOUNT">$1<ex>alexpark@gmail.com</ex></ph>.
   </message>
   <message name="IDS_AUTOFILL_LOCAL_PROFILE_MIGRATION_PROMPT_NOTICE" desc="The local profile prompt body text.">
-    This address is currently saved only to this device. To use it across Google products, save it in your Google Account, <ph name="ACCOUNT">$1<ex>alexpark@gmail.com</ex></ph>.
+    This address is currently saved to this device. To use it across Google products, save it in your Google Account, <ph name="ACCOUNT">$1<ex>alexpark@gmail.com</ex></ph>.
   </message>
   <message name="IDS_AUTOFILL_SAVE_PROMPT_ADDRESS_SECTION_A11Y_LABEL" desc="The 'Save address' prompt address summary section a11y announcement, accompanied with a label to make it clear that the content being read is an address.">
     Address: <ph name="ADDRESS">$1<ex>345 Spear street</ex></ph>.
diff --git a/components/autofill_strings_grdp/IDS_AUTOFILL_ADDRESS_ALREADY_SAVED_IN_ACCOUNT_SOURCE_NOTICE.png.sha1 b/components/autofill_strings_grdp/IDS_AUTOFILL_ADDRESS_ALREADY_SAVED_IN_ACCOUNT_SOURCE_NOTICE.png.sha1
index e092ed5ec9a3b..b87a903141ed5 100644
--- a/components/autofill_strings_grdp/IDS_AUTOFILL_ADDRESS_ALREADY_SAVED_IN_ACCOUNT_SOURCE_NOTICE.png.sha1
+++ b/components/autofill_strings_grdp/IDS_AUTOFILL_ADDRESS_ALREADY_SAVED_IN_ACCOUNT_SOURCE_NOTICE.png.sha1
@@ -1 +1 @@
-802040f8fef75c9e621ee172dc34279d4597aef5
\ No newline at end of file
+309ade3dc12910db8ad91ccf947d140d5347da90
\ No newline at end of file
diff --git a/components/autofill_strings_grdp/IDS_AUTOFILL_ADDRESS_WILL_BE_SAVED_IN_ACCOUNT_SOURCE_NOTICE.png.sha1 b/components/autofill_strings_grdp/IDS_AUTOFILL_ADDRESS_WILL_BE_SAVED_IN_ACCOUNT_SOURCE_NOTICE.png.sha1
index 7491f0b748deb..e9f83d2031230 100644
--- a/components/autofill_strings_grdp/IDS_AUTOFILL_ADDRESS_WILL_BE_SAVED_IN_ACCOUNT_SOURCE_NOTICE.png.sha1
+++ b/components/autofill_strings_grdp/IDS_AUTOFILL_ADDRESS_WILL_BE_SAVED_IN_ACCOUNT_SOURCE_NOTICE.png.sha1
@@ -1 +1 @@
-7587160978442db4f3968c22140e28bad561eebb
\ No newline at end of file
+d94615e767f06420dd48bfa379587046f15142f3
\ No newline at end of file
diff --git a/components/autofill_strings_grdp/IDS_AUTOFILL_IPH_EXTERNAL_ACCOUNT_PROFILE_SUGGESTION.png.sha1 b/components/autofill_strings_grdp/IDS_AUTOFILL_IPH_EXTERNAL_ACCOUNT_PROFILE_SUGGESTION.png.sha1
index 719cfe846d6cf..66927039d9357 100644
--- a/components/autofill_strings_grdp/IDS_AUTOFILL_IPH_EXTERNAL_ACCOUNT_PROFILE_SUGGESTION.png.sha1
+++ b/components/autofill_strings_grdp/IDS_AUTOFILL_IPH_EXTERNAL_ACCOUNT_PROFILE_SUGGESTION.png.sha1
@@ -1 +1 @@
-b7e7184ad7aeae775ea014f00d74f937fccb013b
\ No newline at end of file
+3bae6f7863d87819d97cafc9189a02fafc3a31fc
\ No newline at end of file
diff --git a/components/autofill_strings_grdp/IDS_AUTOFILL_LOCAL_PROFILE_MIGRATION_PROMPT_NOTICE.png.sha1 b/components/autofill_strings_grdp/IDS_AUTOFILL_LOCAL_PROFILE_MIGRATION_PROMPT_NOTICE.png.sha1
index f8e3b01b9e3a1..f443c75032cd8 100644
--- a/components/autofill_strings_grdp/IDS_AUTOFILL_LOCAL_PROFILE_MIGRATION_PROMPT_NOTICE.png.sha1
+++ b/components/autofill_strings_grdp/IDS_AUTOFILL_LOCAL_PROFILE_MIGRATION_PROMPT_NOTICE.png.sha1
@@ -1 +1 @@
-7550186a5481c280ade76b98c7fe2535285b9184
\ No newline at end of file
+2bfa167f2dbca3fe1220550dd621f9e82c690f1b
\ No newline at end of file
diff --git a/components/autofill_strings_grdp/IDS_AUTOFILL_SAVE_IN_ACCOUNT_MESSAGE_ADDRESS_SOURCE_NOTICE.png.sha1 b/components/autofill_strings_grdp/IDS_AUTOFILL_SAVE_IN_ACCOUNT_MESSAGE_ADDRESS_SOURCE_NOTICE.png.sha1
index ac9aede6290eb..8d05ce3e1c97f 100644
--- a/components/autofill_strings_grdp/IDS_AUTOFILL_SAVE_IN_ACCOUNT_MESSAGE_ADDRESS_SOURCE_NOTICE.png.sha1
+++ b/components/autofill_strings_grdp/IDS_AUTOFILL_SAVE_IN_ACCOUNT_MESSAGE_ADDRESS_SOURCE_NOTICE.png.sha1
@@ -1 +1 @@
-10a08bbf9c0b5f8712084a2a8608dd884d0bae40
\ No newline at end of file
+783b1613c7481d5a81eebf8cfb8ac92f50002df1
\ No newline at end of file
diff --git a/components/autofill_strings_grdp/IDS_AUTOFILL_SYNCABLE_PROFILE_MIGRATION_PROMPT_NOTICE.png.sha1 b/components/autofill_strings_grdp/IDS_AUTOFILL_SYNCABLE_PROFILE_MIGRATION_PROMPT_NOTICE.png.sha1
index 9160fc01ef430..04471c3a0f8cd 100644
--- a/components/autofill_strings_grdp/IDS_AUTOFILL_SYNCABLE_PROFILE_MIGRATION_PROMPT_NOTICE.png.sha1
+++ b/components/autofill_strings_grdp/IDS_AUTOFILL_SYNCABLE_PROFILE_MIGRATION_PROMPT_NOTICE.png.sha1
@@ -1 +1 @@
-03b0fa16616ef4092ce007fab5ec4997365050a9
\ No newline at end of file
+eacb8c6eb48ea93a6e5c8599b4099e9d4fd41bb7
\ No newline at end of file