[Autofill]Adding manage server cards link

Bug: 931382
Change-Id: I0422682825f6cd930a95931c55972e78336100a4
Reviewed-on: https://chromium-review.googlesource.com/c/1457666
Reviewed-by: Demetrios Papadopoulos <dpapad@chromium.org>
Reviewed-by: Jared Saul <jsaul@google.com>
Commit-Queue: Hao Zhang <hozhng@google.com>
Cr-Commit-Position: refs/heads/master@{#632401}
diff --git a/chrome/app/settings_strings.grdp b/chrome/app/settings_strings.grdp
index f303e3c..d685680a 100644
--- a/chrome/app/settings_strings.grdp
+++ b/chrome/app/settings_strings.grdp
@@ -747,6 +747,12 @@
   <message name="IDS_SETTINGS_EDIT_CREDIT_CARD_TITLE" desc="The title for the dialog that's shown when editing a card. This can be either credit, debit, or prepaid card..">
     Edit card
   </message>
+  <message name="IDS_SETTINGS_PAYMENTS_MANAGE_CREDIT_CARDS" desc="Shown in the payments section of settings. Descriptive text to inform the user that credit cards can be accessed online. Has a link.">
+   To add or manage Google Pay payment methods, visit your <ph name="BEGIN_LINK">&lt;a href="$1" target="_blank"&gt;</ph>Google Account<ph name="END_LINK">&lt;/a&gt;</ph>
+  </message>
+    <message name="IDS_SETTINGS_PAYMENTS_SAVED_TO_THIS_DEVICE_ONLY" desc="Shown in the payments section of settings. Descriptive text to inform the user that this credit card will be saved to local device only.">
+   This card will be saved to this device only
+  </message>
   <message name="IDS_SETTINGS_ADD_CREDIT_CARD_TITLE" desc="The title for the dialog that's shown when entering the information for a new card. This can be either credit, debit, or prepaid card.">
     Add card
   </message>
diff --git a/chrome/browser/resources/settings/autofill_page/credit_card_edit_dialog.html b/chrome/browser/resources/settings/autofill_page/credit_card_edit_dialog.html
index 7138118..d8015e55 100644
--- a/chrome/browser/resources/settings/autofill_page/credit_card_edit_dialog.html
+++ b/chrome/browser/resources/settings/autofill_page/credit_card_edit_dialog.html
@@ -42,6 +42,10 @@
         width: 70px;
       }
 
+      #saved-to-this-device-only-label {
+        margin-top: var(--cr-form-field-bottom-spacing);
+      }
+
       #year {
         width: 100px;
       }
@@ -81,6 +85,9 @@
             >
           $i18n{creditCardExpired}
         </span>
+        <div id="saved-to-this-device-only-label">
+          $i18n{savedToThisDeviceOnly}
+        </div>
       </div>
       <div slot="button-container">
         <paper-button id="cancelButton" class="cancel-button"
diff --git a/chrome/browser/resources/settings/autofill_page/payments_section.html b/chrome/browser/resources/settings/autofill_page/payments_section.html
index 08a215c..3abd690 100644
--- a/chrome/browser/resources/settings/autofill_page/payments_section.html
+++ b/chrome/browser/resources/settings/autofill_page/payments_section.html
@@ -121,6 +121,11 @@
       </settings-credit-card-list>
     </template>
 
+    <div id="manageLink" class="settings-box first">
+      <!-- This span lays out the URL correctly, relative to the label. -->
+      <span>$i18nRaw{manageCreditCardsLabel}</span>
+    </div>
+
     <cr-action-menu id="creditCardSharedMenu">
       <button id="menuEditCreditCard" class="dropdown-item"
           on-click="onMenuEditCreditCardTap_">$i18n{edit}</button>
diff --git a/chrome/browser/ui/webui/settings/md_settings_localized_strings_provider.cc b/chrome/browser/ui/webui/settings/md_settings_localized_strings_provider.cc
index 986e5a36..7291835 100644
--- a/chrome/browser/ui/webui/settings/md_settings_localized_strings_provider.cc
+++ b/chrome/browser/ui/webui/settings/md_settings_localized_strings_provider.cc
@@ -1508,7 +1508,9 @@
       {"exportPasswordsFailTipsEnoughSpace",
        IDS_SETTINGS_PASSWORDS_EXPORTING_FAILURE_TIP_ENOUGH_SPACE},
       {"exportPasswordsFailTipsAnotherFolder",
-       IDS_SETTINGS_PASSWORDS_EXPORTING_FAILURE_TIP_ANOTHER_FOLDER}};
+       IDS_SETTINGS_PASSWORDS_EXPORTING_FAILURE_TIP_ANOTHER_FOLDER},
+      {"savedToThisDeviceOnly",
+       IDS_SETTINGS_PAYMENTS_SAVED_TO_THIS_DEVICE_ONLY}};
 
   GURL google_password_manager_url = GetGooglePasswordManagerURL(
       password_manager::ManagePasswordsReferrer::kChromeSettings);
@@ -1524,6 +1526,10 @@
                          chrome::kPasswordManagerLearnMoreURL);
   html_source->AddString("manageAddressesUrl",
                          autofill::payments::GetManageAddressesUrl(0).spec());
+  html_source->AddString("manageCreditCardsLabel",
+                         l10n_util::GetStringFUTF16(
+                             IDS_SETTINGS_PAYMENTS_MANAGE_CREDIT_CARDS,
+                             base::UTF8ToUTF16(chrome::kPaymentMethodsURL)));
   html_source->AddString("manageCreditCardsUrl",
                          autofill::payments::GetManageInstrumentsUrl(0).spec());
   html_source->AddString("paymentMethodsLearnMoreURL",
diff --git a/chrome/common/url_constants.cc b/chrome/common/url_constants.cc
index ae6378e..1e238570 100644
--- a/chrome/common/url_constants.cc
+++ b/chrome/common/url_constants.cc
@@ -181,6 +181,11 @@
     "https://support.google.com/chrome/?p=settings_password";
 #endif
 
+const char kPaymentMethodsURL[] =
+    "https://pay.google.com/payments/"
+    "home?utm_source=chrome&utm_medium=settings&utm_campaign=chrome-payment#"
+    "paymentMethods";
+
 const char kPaymentMethodsLearnMoreURL[] =
 #if defined(OS_CHROMEOS)
     "https://support.google.com/chromebook/?p=settings_autofill";
diff --git a/chrome/common/url_constants.h b/chrome/common/url_constants.h
index c54dac6c..af9ecc4 100644
--- a/chrome/common/url_constants.h
+++ b/chrome/common/url_constants.h
@@ -159,6 +159,9 @@
 
 extern const char kPasswordManagerLearnMoreURL[];
 
+// Help URL for the Payment methods page of the Google Pay site.
+extern const char kPaymentMethodsURL[];
+
 extern const char kPaymentMethodsLearnMoreURL[];
 
 // "Learn more" URL for the Privacy section under Options.