Commit afd88852 authored by Thomas Tangl's avatar Thomas Tangl Committed by Commit Bot

[Dice] Use first name for sync promo in settings

Instead of using the full name in the settings
sync promo, only the first name should be used.
This CL fixes this.

Bug: 810865
Cq-Include-Trybots: master.tryserver.chromium.linux:closure_compilation
Change-Id: Ib707abeebe65f8d5b02cfa94dca75c00596997e7
Reviewed-on: https://chromium-review.googlesource.com/941202
Commit-Queue: Thomas Tangl <tangltom@chromium.org>
Reviewed-by: default avatarScott Chen <scottchen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#539964}
parent ccdfae76
......@@ -162,7 +162,7 @@
hidden="[[syncStatus.signedIn]]"
disabled="[[syncStatus.setupInProgress]]">
[[getSubstituteLabel_(
'$i18nPolymer{syncAsName}', shownAccount_.fullName)]]
'$i18nPolymer{syncAsName}', shownAccount_.givenName)]]
</paper-button>
<paper-button class="secondary-button" on-click="onTurnOffButtonTap_"
hidden="[[!syncStatus.signedIn]]"
......
......@@ -11,6 +11,7 @@ cr.exportPath('settings');
/**
* @typedef {{fullName: (string|undefined),
* givenName: (string|undefined),
* email: string,
* avatarImage: (string|undefined)}}
* @see chrome/browser/ui/webui/settings/people_handler.cc
......
......@@ -473,6 +473,7 @@ std::unique_ptr<base::ListValue> PeopleHandler::GetStoredAccountsList() {
base::Value& acc = accounts_list->GetList().back();
acc.SetKey("email", base::Value(account.email));
acc.SetKey("fullName", base::Value(account.full_name));
acc.SetKey("givenName", base::Value(account.given_name));
const gfx::Image& account_image =
account_tracker->GetAccountImage(account.account_id);
if (!account_image.IsEmpty()) {
......
......@@ -110,10 +110,12 @@ cr.define('settings_sync_account_control', function() {
sync_test_util.simulateStoredAccounts([
{
fullName: 'fooName',
givenName: 'foo',
email: 'foo@foo.com',
},
{
fullName: 'barName',
givenName: 'bar',
email: 'bar@bar.com',
},
]);
......@@ -142,8 +144,8 @@ cr.define('settings_sync_account_control', function() {
// correct account when clicked.
assertVisible(syncButton, true);
assertVisible(testElement.$$('#avatar-row .secondary-button'), false);
assertTrue(syncButton.textContent.includes('fooName'));
assertFalse(syncButton.textContent.includes('barName'));
assertTrue(syncButton.textContent.includes('foo'));
assertFalse(syncButton.textContent.includes('bar'));
syncButton.click();
Polymer.dom.flush();
......@@ -168,8 +170,8 @@ cr.define('settings_sync_account_control', function() {
assertTrue(userInfo.textContent.includes('barName'));
assertTrue(userInfo.textContent.includes('bar@bar.com'));
assertVisible(syncButton, true);
assertTrue(syncButton.textContent.includes('barName'));
assertFalse(syncButton.textContent.includes('fooName'));
assertTrue(syncButton.textContent.includes('bar'));
assertFalse(syncButton.textContent.includes('foo'));
browserProxy.resetResolver('startSyncingWithEmail');
syncButton.click();
......@@ -192,10 +194,12 @@ cr.define('settings_sync_account_control', function() {
sync_test_util.simulateStoredAccounts([
{
fullName: 'fooName',
givenName: 'foo',
email: 'foo@foo.com',
},
{
fullName: 'barName',
givenName: 'bar',
email: 'bar@bar.com',
},
]);
......
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