Commit d30bc834 authored by David Roger's avatar David Roger

[settings] Fix layout and text for the passhprase reset hints

Bug: 873739, 873644
Change-Id: I02e0819130678a1398106f0d0faf8068456e28dc
Reviewed-on: https://chromium-review.googlesource.com/1196451
Commit-Queue: David Roger <droger@chromium.org>
Reviewed-by: default avatarHector Carmona <hcarmona@chromium.org>
Reviewed-by: default avatarScott Chen <scottchen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#589142}
parent a0b8f6fc
...@@ -3617,10 +3617,10 @@ ...@@ -3617,10 +3617,10 @@
<message name="IDS_SETTINGS_PASSPHRASE_EXPLANATION_TEXT" desc="Message shown when explicit passphrase is selected."> <message name="IDS_SETTINGS_PASSPHRASE_EXPLANATION_TEXT" desc="Message shown when explicit passphrase is selected.">
Only someone with your passphrase can read your encrypted data. The passphrase is not sent to or stored by Google. If you forget your passphrase or want to change this setting, you'll need to <ph name="BEGIN_LINK">&lt;a href="$1" target=&quot;_blank&quot;&gt;<ex>&lt;a href="$1" target=&quot;_blank&quot;&gt;</ex></ph>reset sync<ph name="END_LINK">&lt;/a&gt;<ex>&lt;/a&gt;</ex></ph>. Only someone with your passphrase can read your encrypted data. The passphrase is not sent to or stored by Google. If you forget your passphrase or want to change this setting, you'll need to <ph name="BEGIN_LINK">&lt;a href="$1" target=&quot;_blank&quot;&gt;<ex>&lt;a href="$1" target=&quot;_blank&quot;&gt;</ex></ph>reset sync<ph name="END_LINK">&lt;/a&gt;<ex>&lt;/a&gt;</ex></ph>.
</message> </message>
<message name="IDS_SETTINGS_PASSPHRASE_RESET_HINT" desc="Informs user how to change their encryption setting."> <message name="IDS_SETTINGS_PASSPHRASE_RESET_HINT_ENCRYPTION" desc="Informs user how to change their encryption setting.">
To change this setting, <ph name="BEGIN_LINK">&lt;a href="$1" target=&quot;_blank&quot;&gt;<ex>&lt;a href="$1" target=&quot;_blank&quot;&gt;</ex></ph>reset sync<ph name="END_LINK">&lt;/a&gt;<ex>&lt;/a&gt;</ex></ph>. To change this setting, <ph name="BEGIN_LINK">&lt;a href="$1" target=&quot;_blank&quot;&gt;<ex>&lt;a href="$1" target=&quot;_blank&quot;&gt;</ex></ph>reset sync<ph name="END_LINK">&lt;/a&gt;<ex>&lt;/a&gt;</ex></ph> to remove your sync passphrase
</message> </message>
<message name="IDS_SETTINGS_PASSPHRASE_RESET_HINT_UNIFIED_CONSENT" desc="Informs user how to change their encryption setting when unified consent is enabled."> <message name="IDS_SETTINGS_PASSPHRASE_RESET_HINT_TOGGLE" desc="Informs user how to change their encryption setting when unified consent is enabled.">
To turn this on, <ph name="BEGIN_LINK">&lt;a href="$1" target=&quot;_blank&quot;&gt;<ex>&lt;a href="$1" target=&quot;_blank&quot;&gt;</ex></ph>reset sync<ph name="END_LINK">&lt;/a&gt;<ex>&lt;/a&gt;</ex></ph> to remove your sync passphrase To turn this on, <ph name="BEGIN_LINK">&lt;a href="$1" target=&quot;_blank&quot;&gt;<ex>&lt;a href="$1" target=&quot;_blank&quot;&gt;</ex></ph>reset sync<ph name="END_LINK">&lt;/a&gt;<ex>&lt;/a&gt;</ex></ph> to remove your sync passphrase
</message> </message>
<message name="IDS_SETTINGS_EMPTY_PASSPHRASE_ERROR" desc="Error message when the passphrase is empty."> <message name="IDS_SETTINGS_EMPTY_PASSPHRASE_ERROR" desc="Error message when the passphrase is empty.">
......
...@@ -31,9 +31,7 @@ ...@@ -31,9 +31,7 @@
opacity: var(--cr-disabled-opacity); opacity: var(--cr-disabled-opacity);
} }
#create-password-box, #create-password-box {
#reset-sync-message-box-encryption,
#reset-sync-message-box-user-events {
/* In order to line up with the encryption radio box text. */ /* In order to line up with the encryption radio box text. */
margin-inline-start: var(--settings-indent-width); margin-inline-start: var(--settings-indent-width);
} }
...@@ -73,6 +71,10 @@ ...@@ -73,6 +71,10 @@
border-top: var(--settings-separator-line); border-top: var(--settings-separator-line);
} }
.passphrase-reset-icon {
margin-right: 8px;
}
<if expr="not chromeos"> <if expr="not chromeos">
#toast { #toast {
color: white; color: white;
...@@ -361,19 +363,20 @@ ...@@ -361,19 +363,20 @@
<!-- User events is disabled and unchecked if data is encrypted or <!-- User events is disabled and unchecked if data is encrypted or
typed urls are disabled. --> typed urls are disabled. -->
<template is="dom-if" if="[[unifiedConsentEnabled]]"> <template is="dom-if" if="[[unifiedConsentEnabled]]">
<div class="layout horizontal list-item" <div hidden="[[!syncPrefs.userEventsRegistered]]"
hidden="[[!syncPrefs.userEventsRegistered]]"> class$="[[getPassphraseHintLines_(syncPrefs.encryptAllData)]]
layout horizontal list-item">
<div class="start" id="userEventsCheckboxLabel"> <div class="start" id="userEventsCheckboxLabel">
<div>$i18n{userEventsCheckboxLabel}</div> $i18n{userEventsCheckboxLabel}
<div class="secondary"> <div class="secondary">
$i18n{userEventsCheckboxText} $i18n{userEventsCheckboxText}
</div> <div id="reset-sync-message-box-user-events"
<div id="reset-sync-message-box-user-events" class="list-item" hidden="[[!syncPrefs.encryptAllData]]">
hidden="[[!syncPrefs.encryptAllData]]"> <iron-icon icon="settings:info-outline"
<span> class="passphrase-reset-icon">
<iron-icon icon="settings:info-outline"></iron-icon> </iron-icon>
$i18nRaw{passphraseResetHint} $i18nRaw{passphraseResetHintToggle}
</span> </div>
</div> </div>
</div> </div>
<cr-toggle id="userEventsToggle" <cr-toggle id="userEventsToggle"
...@@ -425,10 +428,19 @@ ...@@ -425,10 +428,19 @@
<div id="encryptionDescription" <div id="encryptionDescription"
hidden="[[syncPrefs.passphraseRequired]]" hidden="[[syncPrefs.passphraseRequired]]"
class$="two-line single-column class$="single-column
[[getPassphraseHintLines_(syncPrefs.encryptAllData)]]
[[getListItemClass_(unifiedConsentEnabled)]]"> [[getListItemClass_(unifiedConsentEnabled)]]">
<div>$i18n{encryptionOptionsTitle}</div> $i18n{encryptionOptionsTitle}
<div class="secondary">$i18n{syncDataEncryptedText}</div> <div class="secondary">
$i18n{syncDataEncryptedText}
<div hidden="[[!syncPrefs.encryptAllData]]">
<iron-icon icon="settings:info-outline"
class="passphrase-reset-icon">
</iron-icon>
$i18nRaw{passphraseResetHintEncryption}
</div>
</div>
</div> </div>
<div id="encryptionRadioGroupContainer" class="list-frame" <div id="encryptionRadioGroupContainer" class="list-frame"
...@@ -455,16 +467,6 @@ ...@@ -455,16 +467,6 @@
</template> </template>
</cr-radio-button> </cr-radio-button>
</paper-radio-group> </paper-radio-group>
<!-- duplicated from above -->
<div id="reset-sync-message-box-encryption" class="list-item"
hidden="[[!syncPrefs.encryptAllData]]">
<span>
<iron-icon icon="settings:info-outline"></iron-icon>
$i18nRaw{passphraseResetHint}
</span>
</div>
</div> </div>
<template is="dom-if" if="[[creatingNewPassphrase_]]"> <template is="dom-if" if="[[creatingNewPassphrase_]]">
......
...@@ -657,6 +657,16 @@ Polymer({ ...@@ -657,6 +657,16 @@ Polymer({
return this.unifiedConsentEnabled ? 'list-item' : 'settings-box'; return this.unifiedConsentEnabled ? 'list-item' : 'settings-box';
}, },
/**
* When there is a sync passphrase, some items have an additional line for the
* passphrase reset hint, making them three lines rather than two.
* @return {string}
* @private
*/
getPassphraseHintLines_: function() {
return this.syncPrefs.encryptAllData ? 'three-line' : 'two-line';
},
// <if expr="not chromeos"> // <if expr="not chromeos">
/** /**
* @return {boolean} * @return {boolean}
......
...@@ -196,6 +196,12 @@ ...@@ -196,6 +196,12 @@
min-height: var(--settings-row-two-line-min-height); min-height: var(--settings-row-two-line-min-height);
} }
/* A row with three lines of text. Often the lower lines will be
* .secondary. */
.three-line {
min-height: var(--settings-row-three-line-min-height);
}
/* A settings-box is a horizontal row of text or controls within a /* A settings-box is a horizontal row of text or controls within a
* setting section (page or subpage). */ * setting section (page or subpage). */
.settings-box { .settings-box {
......
...@@ -1777,12 +1777,13 @@ void AddPeopleStrings(content::WebUIDataSource* html_source, Profile* profile) { ...@@ -1777,12 +1777,13 @@ void AddPeopleStrings(content::WebUIDataSource* html_source, Profile* profile) {
l10n_util::GetStringFUTF8(IDS_SETTINGS_PASSPHRASE_EXPLANATION_TEXT, l10n_util::GetStringFUTF8(IDS_SETTINGS_PASSPHRASE_EXPLANATION_TEXT,
base::ASCIIToUTF16(sync_dashboard_url))); base::ASCIIToUTF16(sync_dashboard_url)));
html_source->AddString( html_source->AddString(
"passphraseResetHint", "passphraseResetHintEncryption",
l10n_util::GetStringFUTF8( l10n_util::GetStringFUTF8(IDS_SETTINGS_PASSPHRASE_RESET_HINT_ENCRYPTION,
unified_consent::IsUnifiedConsentFeatureEnabled() base::ASCIIToUTF16(sync_dashboard_url)));
? IDS_SETTINGS_PASSPHRASE_RESET_HINT_UNIFIED_CONSENT html_source->AddString(
: IDS_SETTINGS_PASSPHRASE_RESET_HINT, "passphraseResetHintToggle",
base::ASCIIToUTF16(sync_dashboard_url))); l10n_util::GetStringFUTF8(IDS_SETTINGS_PASSPHRASE_RESET_HINT_TOGGLE,
base::ASCIIToUTF16(sync_dashboard_url)));
html_source->AddString( html_source->AddString(
"passphraseRecover", "passphraseRecover",
l10n_util::GetStringFUTF8(IDS_SETTINGS_PASSPHRASE_RECOVER, l10n_util::GetStringFUTF8(IDS_SETTINGS_PASSPHRASE_RECOVER,
......
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