Commit cfacb319 authored by Anastasiia Nikolaienko's avatar Anastasiia Nikolaienko Committed by Commit Bot

Update info icon to kite icon for child users

Show kite icon in Account Manager for child users instead of info icon.
Screenshot: http://screen/FNcYnvQJFwC

Bug: 1054798
Change-Id: Ic8f99fe4dcffd2766f43dc96fe2c48bff03103fe
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2132143
Commit-Queue: Anastasiia Nikolaienko <anastasiian@chromium.org>
Reviewed-by: default avatarKyle Horimoto <khorimoto@chromium.org>
Reviewed-by: default avatarAga Wronska <agawronska@chromium.org>
Reviewed-by: default avatarKush Sinha <sinhak@chromium.org>
Cr-Commit-Position: refs/heads/master@{#756190}
parent d2104e4a
...@@ -738,6 +738,12 @@ ...@@ -738,6 +738,12 @@
<message name="IDS_SETTINGS_ACCOUNT_MANAGER_PRIMARY_ACCOUNT_TOOLTIP" desc="Tooltip for the primary account in accounts list in Settings describing how to sign out."> <message name="IDS_SETTINGS_ACCOUNT_MANAGER_PRIMARY_ACCOUNT_TOOLTIP" desc="Tooltip for the primary account in accounts list in Settings describing how to sign out.">
To sign out of the primary account on this device, click the time on your screen. In the menu that appears, click "Sign out". To sign out of the primary account on this device, click the time on your screen. In the menu that appears, click "Sign out".
</message> </message>
<message name="IDS_SETTINGS_ACCOUNT_MANAGER_CHILD_MANAGED_BY_ONE_PARENT_TOOLTIP" desc="Tooltip for the primary account in accounts list in Settings showing that this user is managed by parent's account.">
Account managed by <ph name="PARENT_EMAIL">$1<ex>user@example.com</ex></ph>. To sign out of the primary account on this device, click the time on your screen. In the menu that appears, click "Sign out".
</message>
<message name="IDS_SETTINGS_ACCOUNT_MANAGER_CHILD_MANAGED_BY_TWO_PARENTS_TOOLTIP" desc="Tooltip for the primary account in accounts list in Settings showing that this user is managed by two parents' accounts.">
Account managed by <ph name="FIRST_PARENT_EMAIL">$1<ex>first@example.com</ex></ph> and <ph name="SECOND_PARENT_EMAIL">$2<ex>second@example.com</ex></ph>. To sign out of the primary account on this device, click the time on your screen. In the menu that appears, click "Sign out".
</message>
<message name="IDS_SETTINGS_ACCOUNT_MANAGER_REMOVE_ACCOUNT_LABEL" desc="Label of the Remove account button in Account Manager."> <message name="IDS_SETTINGS_ACCOUNT_MANAGER_REMOVE_ACCOUNT_LABEL" desc="Label of the Remove account button in Account Manager.">
Remove this account Remove this account
</message> </message>
......
...@@ -184,10 +184,10 @@ ...@@ -184,10 +184,10 @@
<!-- If this is the Device Account, display the management status --> <!-- If this is the Device Account, display the management status -->
<template is="dom-if" if="[[item.isDeviceAccount]]"> <template is="dom-if" if="[[item.isDeviceAccount]]">
<cr-tooltip-icon id="primaryAccountTooltip" aria-hidden="true" <cr-tooltip-icon id="primaryAccountTooltip" aria-hidden="true"
icon-class="cr:info-outline" icon-class="[[getPrimaryAccountTooltipIcon_(isChildUser_)]]"
class="tooltip-primary-account" class="tooltip-primary-account"
tooltip-text="$i18n{accountManagerPrimaryAccountTooltip}" tooltip-text="[[getPrimaryAccountTooltip_(isChildUser_)]]"
icon-aria-label="$i18n{accountManagerPrimaryAccountTooltip}"> icon-aria-label="[[getPrimaryAccountTooltip_(isChildUser_)]]">
</cr-tooltip-icon> </cr-tooltip-icon>
<span class="management-status" <span class="management-status"
aria-labelledby$="fullName-[[index]] email-[[index]]" aria-labelledby$="fullName-[[index]] email-[[index]]"
......
...@@ -115,6 +115,24 @@ Polymer({ ...@@ -115,6 +115,24 @@ Polymer({
: this.i18n('accountManagerSecondaryAccountsDisabledText'); : this.i18n('accountManagerSecondaryAccountsDisabledText');
}, },
/**
* @return {string} cr icon name.
* @private
*/
getPrimaryAccountTooltipIcon_() {
return this.isChildUser_ ? 'cr20:kite' : 'cr:info-outline';
},
/**
* @return {string} tooltip text
* @private
*/
getPrimaryAccountTooltip_() {
return this.isChildUser_ ?
this.i18n('accountManagerPrimaryAccountChildManagedTooltip') :
this.i18n('accountManagerPrimaryAccountTooltip');
},
/** /**
* @param {string} iconUrl * @param {string} iconUrl
* @return {string} A CSS image-set for multiple scale factors. * @return {string} A CSS image-set for multiple scale factors.
......
...@@ -31,6 +31,8 @@ ...@@ -31,6 +31,8 @@
#include "chrome/browser/chromeos/profiles/profile_helper.h" #include "chrome/browser/chromeos/profiles/profile_helper.h"
#include "chrome/browser/policy/profile_policy_connector.h" #include "chrome/browser/policy/profile_policy_connector.h"
#include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profile.h"
#include "chrome/browser/supervised_user/supervised_user_service.h"
#include "chrome/browser/supervised_user/supervised_user_service_factory.h"
#include "chrome/browser/ui/webui/chromeos/assistant_optin/assistant_optin_utils.h" #include "chrome/browser/ui/webui/chromeos/assistant_optin/assistant_optin_utils.h"
#include "chrome/browser/ui/webui/chromeos/bluetooth_dialog_localized_strings_provider.h" #include "chrome/browser/ui/webui/chromeos/bluetooth_dialog_localized_strings_provider.h"
#include "chrome/browser/ui/webui/chromeos/network_element_localized_strings_provider.h" #include "chrome/browser/ui/webui/chromeos/network_element_localized_strings_provider.h"
...@@ -861,7 +863,8 @@ void AddAppManagementStrings(content::WebUIDataSource* html_source) { ...@@ -861,7 +863,8 @@ void AddAppManagementStrings(content::WebUIDataSource* html_source) {
AddLocalizedStringsBulk(html_source, kLocalizedStrings); AddLocalizedStringsBulk(html_source, kLocalizedStrings);
} }
void AddParentalControlStrings(content::WebUIDataSource* html_source) { void AddParentalControlStrings(content::WebUIDataSource* html_source,
Profile* profile) {
static constexpr webui::LocalizedString kLocalizedStrings[] = { static constexpr webui::LocalizedString kLocalizedStrings[] = {
{"parentalControlsPageTitle", IDS_SETTINGS_PARENTAL_CONTROLS_PAGE_TITLE}, {"parentalControlsPageTitle", IDS_SETTINGS_PARENTAL_CONTROLS_PAGE_TITLE},
{"parentalControlsPageSetUpLabel", {"parentalControlsPageSetUpLabel",
...@@ -879,6 +882,27 @@ void AddParentalControlStrings(content::WebUIDataSource* html_source) { ...@@ -879,6 +882,27 @@ void AddParentalControlStrings(content::WebUIDataSource* html_source) {
html_source->AddBoolean( html_source->AddBoolean(
"isChild", user_manager::UserManager::Get()->IsLoggedInAsChildUser()); "isChild", user_manager::UserManager::Get()->IsLoggedInAsChildUser());
if (user_manager::UserManager::Get()->IsLoggedInAsChildUser()) {
SupervisedUserService* supervised_user_service =
SupervisedUserServiceFactory::GetForProfile(profile);
std::string custodian = supervised_user_service->GetCustodianName();
std::string second_custodian =
supervised_user_service->GetSecondCustodianName();
base::string16 child_managed_tooltip;
if (second_custodian.empty()) {
child_managed_tooltip = l10n_util::GetStringFUTF16(
IDS_SETTINGS_ACCOUNT_MANAGER_CHILD_MANAGED_BY_ONE_PARENT_TOOLTIP,
base::UTF8ToUTF16(custodian));
} else {
child_managed_tooltip = l10n_util::GetStringFUTF16(
IDS_SETTINGS_ACCOUNT_MANAGER_CHILD_MANAGED_BY_TWO_PARENTS_TOOLTIP,
base::UTF8ToUTF16(custodian), base::UTF8ToUTF16(second_custodian));
}
html_source->AddString("accountManagerPrimaryAccountChildManagedTooltip",
child_managed_tooltip);
}
} }
void AddBluetoothStrings(content::WebUIDataSource* html_source) { void AddBluetoothStrings(content::WebUIDataSource* html_source) {
...@@ -2051,7 +2075,7 @@ void OsSettingsLocalizedStringsProvider::AddOsLocalizedStrings( ...@@ -2051,7 +2075,7 @@ void OsSettingsLocalizedStringsProvider::AddOsLocalizedStrings(
AddGoogleAssistantStrings(html_source, profile); AddGoogleAssistantStrings(html_source, profile);
AddLanguagesStrings(html_source); AddLanguagesStrings(html_source);
AddMultideviceStrings(html_source); AddMultideviceStrings(html_source);
AddParentalControlStrings(html_source); AddParentalControlStrings(html_source, profile);
AddPageVisibilityStrings(html_source); AddPageVisibilityStrings(html_source);
AddPeoplePageStrings(html_source, profile); AddPeoplePageStrings(html_source, profile);
AddPersonalizationStrings(html_source); AddPersonalizationStrings(html_source);
......
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